:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(batch-exports): add AwsS3 and S3Compatible frontend destinations (#62689)
Rossb9cf148b1ebe
diff --git a/frontend/public/services/aws-s3.png b/frontend/public/services/aws-s3.pngindex 5cbe788c5a70..051e238f3b7a 100644Binary files a/frontend/public/services/aws-s3.png and b/frontend/public/services/aws-s3.png differdiff --git a/frontend/public/services/s3-compatible.png b/frontend/public/services/s3-compatible.pngnew file mode 100644index 000000000000..0ac016d3eef3Binary files /dev/null and b/frontend/public/services/s3-compatible.png differdiff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 75b13c2b746a..da7839b9b1f0 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -4275,73 +4275,81 @@ snapshots:scenes-app-annotations--annotations--light:hash: v1.k794b7964.5b57e6df85906128a99fa7b0f8a597a0a3d4ba38424f3f9ae1429b79531cb825.gzAp0xIv9lsfEf-JK-wan8dHZKPrbOojJNfg4A5X1qEscenes-app-batchexports--backfills-empty--dark:- hash: v1.k794b7964.fbc17d3cc7b8aafe1846f39fee06a378969e7a8892c7d13c0ba6491b07fc88c9.cCg-vICCfOTN1Y336PeZUrkYqpsvO3xtY3ZnFZvzaFk+ hash: v1.k794b7964.28507262548478e2d0211783c04f1078475fe387f5540c0b84a5a10bbd1e327d.5iPjqcsujNk379gMnile1JByq6y9F-64wSu3_-x_uQYscenes-app-batchexports--backfills-empty--light:- hash: v1.k794b7964.97f6b886652c92c1c7328cfa5f696e6cf3c8bc9191bd5cb0c5aabaf7948f34d0.iKMLZm38DiUk8tgXm2lTfTLIfNGjbGIDYkhc7MtuFqo+ hash: v1.k794b7964.ae8b01c8ee160e250066e3e2075d4bab4bfcd81da0ba48a580419e93638cfe6c.Cey0--rV5gHUojiVrZcckQQLbK6ZhWbTZp30lEdvjMwscenes-app-batchexports--backfills-with-estimates--dark:- hash: v1.k794b7964.f3c8d88f7960e65e6c7b5dfa72f14dd3aa0626dbe6b8c4dfb7598d32d2a9c52a.sjT8xm1LuaLCVGBqzjwrqmaO-y3OcC6x4e3OOSUPWtc+ hash: v1.k794b7964.8e959f4b3dd6956769b3418c34325b75ad9977901773c7e86d48552659f622a2.hvGzDl9XVQOvUtxFjrEGKbXeFaMnwDhsGsVRKdmHpQwscenes-app-batchexports--backfills-with-estimates--light:- hash: v1.k794b7964.ff65cb40f7e2201d018187cdbdea18316db0fc4a1d5d1f6354596c3a2f7134b6.Ty5F34_U08a4Xcj4XEr-mFtt7CP_4ulGFFaalXtYxBA+ hash: v1.k794b7964.9da458e4acd8fb9b6022d9fba650326c50ac986492e7d51f61f478f1240bd440.Hcfd3VcGaOEhEMWyDb0UIZAHwZDAYzLtjYDgfFLu4YAscenes-app-batchexports--existing-big-query-export--dark:- hash: v1.k794b7964.c497a11d9bc7c4197179439db96463e5007de1c68fe3b23eed386ffd71698ca7.PWzPAn_tQGmm4DFgQetKTfnqo8X9qrVGNqDB9X13lrA+ hash: v1.k794b7964.e73b2c0cee7b290fb63689e2ea869eb0d26267c338ed1ef8b757a87dcff69b1b.MPaqCHRUmmE5AXsFVrV9QxFxajGbXV2GXOXXK5N-1Qoscenes-app-batchexports--existing-big-query-export--light:- hash: v1.k794b7964.e32682b42312ab15395bbf6f953dda6a8be6297bf2beee8a6307f4c469a3275a.ZDpnCTUn_ulIPUSvIrci2MAbwiQAIFzaEYceiNefQgQ+ hash: v1.k794b7964.63ecca9da64bd704554b26e2fe373a5a8bba8081e6b00af7a816ac7135e0e712.I72BZqP-F9fWzLP0iBslCsSszFnH9GSfFXivgSHfMPgscenes-app-batchexports--history-empty--dark:- hash: v1.k794b7964.8c7742c97909864ee30c99ffdca41bb7f5487f5db9c71ae2b1e52ec6c5006621.4khsoQSxtDBQZwDnS8Hi6zEQskbCnpsNY0RqxoD2OPg+ hash: v1.k794b7964.56b478354a85ec9d0516d1fc4f92022682351295dd1896b16ae3579c961fec99.78pKPDwFQ0NTZSHAdKQLqzML8VKqaxH1b0Xu099HhfQscenes-app-batchexports--history-empty--light:- hash: v1.k794b7964.5d6e10afc1745a113a68e2842d6ba39c2e57823ab221701003d5a31709c81182.UNFq0uhbi55aBtYBCErLz6bL69UF6ZJOjgXS28-YxyU+ hash: v1.k794b7964.84b23f23f4cbc0fb04f92beb3b4f3c948a4cbbf6ba447c896d9ee4e01d80e9e3.ivDZsZKo-luDKEYetZmSbdcJLB_f8Npj6F0lsfjZ5IMscenes-app-batchexports--history-with-activity--dark:- hash: v1.k794b7964.df5acf9b439a1737c7b602aad18f087faf3277ba149077a4529544f05f2f9468.iJkJjM918NnqifKdXLlmm6pCoWVM5W5XGWF5bt8F360+ hash: v1.k794b7964.bc2d264c6ea0638086b159f92f7aea97791cb49a4b9fa6442010ebce89b3255d.Nd8YFjtj9Bx_iLc9WJ4NcezadqAejo8aReTRHMNVHYkscenes-app-batchexports--history-with-activity--light:- hash: v1.k794b7964.87c4f25d7bed5e1370c5af7e7ffe2682fbb9e145e795a02804f4e3829340628f.drIY5m6wNYzEPblcEU9fZpgota7MoxFnWWjcy2NC8f4+ hash: v1.k794b7964.df107c6325e84453b42e62c538d0c5012698383d33bcbff82d33c6893fce5db0.im9jLidp0FMkLNw8k2RxnTD0thXQJAUL_IPPbsFQuIsscenes-app-batchexports--logs--dark:- hash: v1.k794b7964.13a4f6b90bce52901bb03f35922bb0a7fc8a74d659fc6bf81e7dd18d66406fc9.Oo7tCO_uVTfiILFVS2kviGVqJi1iCqPs-7f-XWXqR1Y+ hash: v1.k794b7964.de2079f044d16c5562b38dc6fc322413dc5b0e74ea632a6ebd02e6434a3f41fa.ZbAcLlh5e3XFUF35r2kPJetJhmjMEjkNmP1l_j4Ql-Mscenes-app-batchexports--logs--light:- hash: v1.k794b7964.6d5d3a5edfa5a50fe6eb202830dc560989665cb53a3962c8e749ae5df0972c4c.4FMpNn6w1n-fkljiT3W2faPQ1TEhUunKo-bnCf3rFtQ+ hash: v1.k794b7964.e1cbf1a54a907feaf4fdb530bb9b78d80b1f1cb73745b30bcac016910da8c70a.WWZQ8C4QfY9B-GsCAXxkmnlBIIVyaMYm16o9FXsUpI8scenes-app-batchexports--metrics--dark:hash: v1.k794b7964.05d7f391fdbe1f565e9329575dd8fff8c86069cff8345c39c05c1a4f286df301.AM7OsTQnhgqypXvL58dwrdjoxBeSBt7EvF7GdNKix_Uscenes-app-batchexports--metrics--light:hash: v1.k794b7964.2a35529dda76e924c361be19057499c3aa72c98fc7b86e31184b1ccb7acbc938.6UBr4F4PNQVWEwdoGsRsEkA_af40UyfrYI7v2EyyWJ0+ scenes-app-batchexports--new-aws-s-3-export--dark:+ hash: v1.k794b7964.41f79befceaf770e88b798c12f787cb9d1ab145c7d80615bc26b9207340f79a6.aM-tMd6ZFwKekTp8mskvTCfaWrLdd6qE69xVms0rqcY+ scenes-app-batchexports--new-aws-s-3-export--light:+ hash: v1.k794b7964.357c474dff8efeb0e82e13cd34ca86e6d0d447b24c3e4c4c040722469dec9c28.pXZJFQZY1vntlseiUyrx8DV1UlfM1yUnGCvRDIL-nzsscenes-app-batchexports--new-azure-blob-export--dark:- hash: v1.k794b7964.d889b4305b0056ccfa2c51d2e6f1e6eb1ae6d5264cea194e3215d100e62818c7.6JLJrVz0vp_ceIn4eG6qqj6yHEkGmVAIbQXDD0e2OYY+ hash: v1.k794b7964.b23ecc05f98318003c287543dc6c766a65b4b9cad16688b193b60018a943b997.ER8pnLAtnsoZbNs-RpxbZWTo3IxzH8qj_unw_RB5aCoscenes-app-batchexports--new-azure-blob-export--light:- hash: v1.k794b7964.2f4fa15b571bd753e50ecc95371b3312d2ae007f94c60d23242ba50be982667c.8AmhbsCHMfm--TPjY0Iv3SS4xSIYXjGgAs1hEn6eudE+ hash: v1.k794b7964.391462a3dddcb97a9aaca2f48dfb820a3fbe576088258b2257eba1e2a02e2dec.IcPnuE7dwCAkD8s_VH1FqaDPWE6y-6GpvAZmPNawgqYscenes-app-batchexports--new-big-query-export--dark:- hash: v1.k794b7964.b0017a9704d860ae6dbefea6e35ad51210bcd9b0d1b9e880b40bff062ef0313e.Meevy2ppWpbV6N50Q-EXk7n3F55mpI_kBGxmJif-RG8+ hash: v1.k794b7964.bc48810ab49eb2fcee6f7b2b9fc0458f193f7569e3047d81e60c94fc826575d9.UDTOjOA1bcvpJIKdc6vikejyxvvJsN8Na0uWmlHA2kIscenes-app-batchexports--new-big-query-export--light:- hash: v1.k794b7964.d74e0bf9deea6e90d2f919bcf36fd70546c91c7aef5fc6068ca8ec5ac8e5212e.C8YO5nra2nSU2_FE6DYg--0rrHu0uYAR0OeevJTuPBk+ hash: v1.k794b7964.6e87b06b15b778047c33f4e9f9c7c65c8d738c45130e22029e0edc3524de69f4.bJlTlOxLPoC1muVtPtJLekL6polKkJS_zw1Pv4KS6Doscenes-app-batchexports--new-databricks-export--dark:- hash: v1.k794b7964.d54b3f7c4845b3c5f945b45689f5917c9bcde6a4ac4f72bf40d161f10d4f55fd.93WWAtDciTnt8SaNbW7U0AbnWuGyrb3Y3ZE3AvW6NVI+ hash: v1.k794b7964.b2693cdd07e72d6ad2e60a2d275699b51b232ab12bb248906220ed57e6af9c88.lXonb3KA8bkkq8Qe5hqciPUYDGbxw6ovvlLYT5U-AdEscenes-app-batchexports--new-databricks-export--light:- hash: v1.k794b7964.25a8b8417770d57fedd4a87ea1e565d8749e57e64511036f79ffa3e00cc3ac88.-rGyOuxDyRv6LxIlt41gnX8xgcfyPDo4_XPadJsX_1A+ hash: v1.k794b7964.0a998711fdddbc861172e7b9b17c094a0e15417765057cec3ed318e7a258d775.AV6jmttRTb7PputojhwtzxY4SEY4XOvfCSqVnjiuVbMscenes-app-batchexports--new-http-export--dark:- hash: v1.k794b7964.8a51cbc65d54323ce7921415a5addf2ef6636ae025e7f1ebd90bc779ef6340bd.5bsQAoyEK02dWepnexFwFlknBQaHA_rxqmzG8_VuYR8+ hash: v1.k794b7964.932803ac6be80e7f5d0a916a49f206357a7a5e54c55d81c2efc005b5c4edc9d8.PNMYz2VRF2MOhLxmSw0Gkpaj4RlToj32RLEDk0ZXiUIscenes-app-batchexports--new-http-export--light:- hash: v1.k794b7964.41b85adf2c732f7993fe8dafa8761d769de9e825b07a27e04bfd30a4b4e1e331.AeuHOHQ083cCjRCL8jgGsQBNUGtTY-v-lsEDL2brjM0+ hash: v1.k794b7964.57a9e794717b31d1d38c525bb94ccb83146dec6e5132b687b4d37b187dcc5f50.pPRfr3IHa9In8YGfVfqcW6W8Ia2hVO2D8snx_2Qgo20scenes-app-batchexports--new-postgres-export--dark:- hash: v1.k794b7964.e561016272750fba9398c089d1eab97ab0ef03b7c3097979f54ec5d012af2d95.3yAd7b56ixt10f9MJGGNsNdz6HnrVbQ6AoBB_F8wSBU+ hash: v1.k794b7964.6edf090d1ebd7d5457b60cac591cd4e3479fe5b0f26111a90665cfab6da8b787.F24aRAs1TCIrtG-0J03xBp7L4BdEHAZqthDa3_qf_yUscenes-app-batchexports--new-postgres-export--light:- hash: v1.k794b7964.3c78b42055b7d98c09546dfc41b4fc0f0e0cce043d9447f06b86733fd0503af8.dcAy1PghWvnE-NjkzKk17akgZdR7-tImG-BE9VjtDlM+ hash: v1.k794b7964.26f2cc2387acf287d0b6765d06859a7f9f1b4d0a825a02fe2992629f4d07cc8b.xXylSXY9SPOV2JJHWB7AyyS1cfvqVaJBeQNTXq-6K2gscenes-app-batchexports--new-redshift-export--dark:- hash: v1.k794b7964.0aac5a33d0d3acc010704bffeca2e41830ccadd9bfd6261ea9790ef91f403a13.3Edh4xHy7pPf3pRzqlryayXIsh_YDLrer5tyix2_jHE+ hash: v1.k794b7964.769e74e5097c2e53ae958785fdb3e6833a683f700a589f03dd7635fb4b2e0787.o50DQ7asE_mTNQg0veJYD6akpaYCutsM_lZRQrKhU7oscenes-app-batchexports--new-redshift-export--light:- hash: v1.k794b7964.6856b135d2cee2cbd2a1a9527aa85b1e90a707f3e2d885cc23291c0187950727.a2O1CYhMK8AU6b6Q2aqUmzSvdaVKa04jeFBJSppqBhU+ hash: v1.k794b7964.230bc08cd2af1a7c952c2ffdaade39e20fff9b4b97520f09e05419b7ae8b9313.a0jNd0-hfQA3h2BmtN1ITD_APsblx4Wvh1hpL_lqvyY+ scenes-app-batchexports--new-s-3-compatible-export--dark:+ hash: v1.k794b7964.73395ca9179587d471be2476b9870e0735ec352105c45c6573c6d0079643d59d.YVpqeeIKDkqzFyHE6gQNArsqXBL1m3NZu1CZ-vS2kmI+ scenes-app-batchexports--new-s-3-compatible-export--light:+ hash: v1.k794b7964.8ae6cceea5d17855a1d0a3c93fbdf23f4b16d7024c24c83a0712c3c06c9c2656.9hxJjl_0BWevFJAOlKruL2eiNMqjQAwmQ7MkS2GVB98scenes-app-batchexports--new-s-3-export--dark:- hash: v1.k794b7964.16c44e9771d0e22656f294bf4a3f8496f74d884e55f4c1975c32ff9db8575995.dhas1f5NftAK5emoP0pwlGK5BbXgVftA5e1z7fbCh48+ hash: v1.k794b7964.806a71cb77929968b5752b1e4ee114bc00ecc212bed909a4270b9e4b5dac43ad.7JHWAWNjSbnfk8ZOtLkAg4SDoPD4iZQwGoJUgUpJKgcscenes-app-batchexports--new-s-3-export--light:- hash: v1.k794b7964.9beb1795f4cea49e745ddda559a7af22233c7a2b9cd177f9f11c687ad867e730.pUIek5HBtefgmROQr34mIxWgg-9c71ZgpRBVtRazuG4+ hash: v1.k794b7964.1575893a2b44f8200e90792150f8799b1deb3043e39bf9e95f7595eb0c5b92a4.gXKhIx2xSWzXFHq38Tt5RWxPmksOywo6Ysp_F6pBplMscenes-app-batchexports--new-snowflake-export--dark:- hash: v1.k794b7964.d71afa50deeeff7b2e20d1bb35276409fab5c04a9980d5ed7e922389bf7214a7.n6T6TEpb1Mc_77pKNgeGCh0Ew5SbetLpN-ToCJ0YCWU+ hash: v1.k794b7964.4c3332868c9ec5350eb2499b37a90167f481e577ee5f55cacff991451258cc25.bdIHDI2-ZTy2I-rshZneb8mK5F-NPUCSSnMFmYT8Kesscenes-app-batchexports--new-snowflake-export--light:- hash: v1.k794b7964.23fe84ba49bf8a12e4b838d8a6cd092df08d8b917fa8c698bb8a7559f6c78e9f.F8cBpNu2gGhWQXzUgS-aLEcHjZjP-5RQSd30eoh99qA+ hash: v1.k794b7964.7c43f1e28b430ae917613442a2f83ae26fe675f8f9bca8e8747003c8f4bd2062.g40dGX8hGVAGnPUgMg9hxB0jeMAKM0MKB8-x-JR9za4scenes-app-batchexports--runs-empty--dark:- hash: v1.k794b7964.103efa98046087636634d3cdeac2bcf9018b137397177e8bb3b43354de35afa1.5-pXsFef6HCA_Z08n1pVKjgb1GnnOrpo--4lrN1EKts+ hash: v1.k794b7964.8ed31e44698ccfda832f6007c730a97aa3f1120b7bbdf0e0fbead04d41ed8933.Rmg6IGBdMuIg7PZEqZ-yq70yazKQ5fzneRfx3qhuNqQscenes-app-batchexports--runs-empty--light:- hash: v1.k794b7964.1fb5cb0bcb5e5f2f511e4fa3fd7c3b0b3770ecdc873be95c22b5ba301403f0be.d8NZwykoEUDBTJnAhiKdNjgDxvr3vc4u6VREQs_tA-w+ hash: v1.k794b7964.80e1844dfbb458265a5ce3b7eebbb8dafb5db8c3449dadeda14681b0c253e286.Qyb4QWBjm_OLf29mK8KX1k79QCL0u22b3B7HRwUS1Rsscenes-app-batchexports--runs-with-data--dark:- hash: v1.k794b7964.8d92e7a4cfe671a511d0acbb400a4a0eeab40ea56cba049f97d4fa65168966f5.hChKmlpjfgE0wgYxoqtjkMj7waVD4CQ8nmB6NBUQ7gU+ hash: v1.k794b7964.5b2ff6086ac67613dcbb32338dd670f8df40e2fd5e7c9107f079dd5d86afe6f6.4-in8CMoVhUNDKn354NyugDZ1GcNL3iWxGgQ_ro9mwMscenes-app-batchexports--runs-with-data--light:- hash: v1.k794b7964.f4a8d5cc4f5447f093d5ddbbcd8572e13f7297a7db8a89504f9290226e60a2bc._CkUe6i49hMMGaDUNDHeNZDgaVp5DJQCay44V8WqfR4+ hash: v1.k794b7964.144b41b97a76df864203804f6bf0b956998d6f0e6e4d81c4102c52dadce11813.DeXap8kCLxs-8UrwnfoTk5PIbkan4hrzxPCfyN_htMEscenes-app-customer-analytics-accounts--default--dark:hash: v1.k794b7964.2cfaa8253c84fdcf8c83cc7ba5a19ad9e23c94d53e22f56e283b70fdfaeba7ec.X3Et3UqSsRTSoIs_gmsFbWBV4l6eneKs60wf-rTmcTMscenes-app-customer-analytics-accounts--default--light:diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportIcon.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportIcon.tsxindex 9296d77657ef..ddb29a7028e5 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportIcon.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportIcon.tsx@@ -9,10 +9,13 @@ import IconBigQuery from 'public/services/bigquery.png'import IconDatabricks from 'public/services/databricks.png'import IconPostgres from 'public/services/postgres.png'import IconRedshift from 'public/services/redshift.png'+import IconS3Compatible from 'public/services/s3-compatible.png'import IconSnowflake from 'public/services/snowflake.png'-export function getBatchExportUrl(service: BatchExportService['type']): string {- return `https://posthog.com/docs/cdp/batch-exports/${service.toLowerCase()}`+export function getBatchExportDocsUrl(service: BatchExportService['type']): string {+ // The whole S3 family (legacy S3, AwsS3, S3Compatible) shares the one S3 docs page.+ const slug = service === 'AwsS3' || service === 'S3Compatible' ? 's3' : service.toLowerCase()+ return `https://posthog.com/docs/cdp/batch-exports/${slug}`}export const BATCH_EXPORT_ICON_MAP: Record<BatchExportService['type'], string> = {@@ -21,6 +24,8 @@ export const BATCH_EXPORT_ICON_MAP: Record<BatchExportService['type'], string> =Postgres: IconPostgres,Redshift: IconRedshift,S3: IconS3,+ AwsS3: IconS3,+ S3Compatible: IconS3Compatible,Snowflake: IconSnowflake,HTTP: IconHTTP,Databricks: IconDatabricks,@@ -48,7 +53,7 @@ export function RenderBatchExportIcon({</>}>- <Link to={getBatchExportUrl(type)}>+ <Link to={getBatchExportDocsUrl(type)}><img src={icon} alt={type} height={sizePx} width={sizePx} /></Link></Tooltip>diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsxindex 8a2e715b343c..2e456ae9f194 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.stories.tsx@@ -46,6 +46,19 @@ type Story = StoryObj<{}>// edit form (the per-destination `Fields` components in destinations/). The default// configuration drives any conditional UI: Redshift defaults to COPY (shows the S3// staging section), Snowflake to password auth.+export const NewAwsS3Export: Story = {+ parameters: {+ pageUrl: urls.batchExportNew('awss3'),+ },+}++export const NewS3CompatibleExport: Story = {+ parameters: {+ pageUrl: urls.batchExportNew('s3compatible'),+ },+}++// Legacy `S3` type — hidden from the picker but still renders for not-yet-migrated rows.export const NewS3Export: Story = {parameters: {pageUrl: urls.batchExportNew('s3'),diff --git a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsxindex d46d64debdb1..a9ac15e7bf0b 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/BatchExportScene.tsx@@ -140,7 +140,7 @@ function BatchExportSceneHeader(): JSX.Element {resourceType={{type: 'data_pipelines',forceIcon: configuration.destination ? (- <RenderBatchExportIcon size="medium" type={configuration.destination} />+ <RenderBatchExportIcon size="small" type={configuration.destination} />) : undefined,}}isLoading={batchExportConfigLoading}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.ts b/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.tsindex 24e5f4f6c477..5ac32268240b 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.ts+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportConfigFormLogic.test.ts@@ -58,6 +58,42 @@ const S3_BATCH_EXPORT = fixture('test-s3-id', 'S3 Export', {},})+const AWS_S3_BATCH_EXPORT = fixture('test-aws-s3-id', 'AWS S3 Export', {+ type: 'AwsS3',+ config: {+ bucket_name: 'test-bucket',+ region: 'us-east-1',+ prefix: 'posthog-events/',+ aws_access_key_id: 'AKIAIOSFODNN7EXAMPLE',+ aws_secret_access_key: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',+ exclude_events: [],+ include_events: [],+ compression: 'zstd',+ encryption: null,+ kms_key_id: null,+ file_format: 'Parquet',+ max_file_size_mb: null,+ },+})++const S3_COMPATIBLE_BATCH_EXPORT = fixture('test-s3-compatible-id', 'S3-compatible Export', {+ type: 'S3Compatible',+ config: {+ bucket_name: 'test-bucket',+ region: 'auto',+ prefix: 'posthog-events/',+ aws_access_key_id: 'AKIAIOSFODNN7EXAMPLE',+ aws_secret_access_key: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',+ exclude_events: [],+ include_events: [],+ compression: 'zstd',+ endpoint_url: 'https://test-minio-host:9000',+ use_virtual_style_addressing: false,+ file_format: 'Parquet',+ max_file_size_mb: null,+ },+})+// BigQuery exports are integration-backed: the config carries `integration` and the// credentials live on the integration, not in the config.const BIGQUERY_BATCH_EXPORT = fixture('test-bq-id', 'BigQuery Export', {@@ -248,6 +284,8 @@ const AZUREBLOB_BATCH_EXPORT = fixture('fixture-azureblob', 'Azure Blob Export',// Single map keyed by id; used to register GET + PATCH mocks dynamically below.const ALL_BATCH_EXPORTS: BatchExportConfiguration[] = [S3_BATCH_EXPORT,+ AWS_S3_BATCH_EXPORT,+ S3_COMPATIBLE_BATCH_EXPORT,BIGQUERY_BATCH_EXPORT,POSTGRES_BATCH_EXPORT,SNOWFLAKE_PASSWORD_BATCH_EXPORT,@@ -354,8 +392,6 @@ describe('batchExportConfigFormLogic', () => {})describe('required fields validation', () => {- // Expected required fields are hardcoded so this suite is decoupled from the implementation- // and runs unchanged before and after the destination-registry refactor.const GENERAL_REQUIRED_FIELDS = ['interval', 'name', 'model']it.each([{@@ -369,6 +405,29 @@ describe('batchExportConfigFormLogic', () => {'file_format',],},+ {+ service: 'AwsS3' as const,+ fields: [+ 'bucket_name',+ 'region',+ 'prefix',+ 'aws_access_key_id',+ 'aws_secret_access_key',+ 'file_format',+ ],+ },+ {+ service: 'S3Compatible' as const,+ fields: [+ 'bucket_name',+ 'region',+ 'prefix',+ 'endpoint_url',+ 'aws_access_key_id',+ 'aws_secret_access_key',+ 'file_format',+ ],+ },{service: 'Postgres' as const,fields: ['user', 'password', 'host', 'port', 'database', 'schema', 'table_name'],@@ -576,6 +635,26 @@ describe('batchExportConfigFormLogic', () => {model: 'events',},},+ {+ service: 'AwsS3',+ expected: {+ destination: 'AwsS3',+ file_format: 'Parquet',+ compression: 'zstd',+ paused: true,+ model: 'events',+ },+ },+ {+ service: 'S3Compatible',+ expected: {+ destination: 'S3Compatible',+ file_format: 'Parquet',+ compression: 'zstd',+ paused: true,+ model: 'events',+ },+ },{service: 'Snowflake',expected: { destination: 'Snowflake', authentication_type: 'password', paused: true, model: 'events' },@@ -652,6 +731,56 @@ describe('batchExportConfigFormLogic', () => {},},},+ {+ // AwsS3 must not leak endpoint_url / use_virtual_style_addressing into the payload.+ name: 'AwsS3',+ service: 'AwsS3' as const,+ requiredValues: {+ bucket_name: 'my-bucket',+ region: 'us-east-1',+ prefix: 'test/',+ aws_access_key_id: 'AKIA',+ aws_secret_access_key: 'secret',+ },+ expectedDestination: {+ type: 'AwsS3',+ config: {+ bucket_name: 'my-bucket',+ region: 'us-east-1',+ prefix: 'test/',+ aws_access_key_id: 'AKIA',+ aws_secret_access_key: 'secret',+ file_format: 'Parquet',+ compression: 'zstd',+ },+ },+ },+ {+ // S3Compatible requires endpoint_url and must not leak encryption / kms_key_id.+ name: 'S3Compatible',+ service: 'S3Compatible' as const,+ requiredValues: {+ bucket_name: 'my-bucket',+ region: 'auto',+ prefix: 'test/',+ endpoint_url: 'https://my-minio-host:9000',+ aws_access_key_id: 'AKIA',+ aws_secret_access_key: 'secret',+ },+ expectedDestination: {+ type: 'S3Compatible',+ config: {+ bucket_name: 'my-bucket',+ region: 'auto',+ prefix: 'test/',+ endpoint_url: 'https://my-minio-host:9000',+ aws_access_key_id: 'AKIA',+ aws_secret_access_key: 'secret',+ file_format: 'Parquet',+ compression: 'zstd',+ },+ },+ },{name: 'Postgres',service: 'Postgres' as const,@@ -837,6 +966,8 @@ describe('batchExportConfigFormLogic', () => {describe('round-trip: load and save preserves destination config', () => {it.each([{ name: 'S3', fixture: S3_BATCH_EXPORT },+ { name: 'AwsS3', fixture: AWS_S3_BATCH_EXPORT },+ { name: 'S3Compatible', fixture: S3_COMPATIBLE_BATCH_EXPORT },{ name: 'BigQuery', fixture: BIGQUERY_BATCH_EXPORT },{ name: 'Postgres', fixture: POSTGRES_BATCH_EXPORT },{ name: 'Snowflake (password)', fixture: SNOWFLAKE_PASSWORD_BATCH_EXPORT },diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsxnew file mode 100644index 000000000000..5b8554b0cd32--- /dev/null+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/awss3.tsx@@ -0,0 +1,44 @@+import {+ AWS_ONLY_REGION_OPTIONS,+ S3FamilyFields,+ S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS,+ validateBucketName,+} from './common'+import type { DestinationDefinition } from './types'++// AWS S3 — the first-class destination for buckets hosted on AWS. No endpoint or virtual-style+// addressing (those are derived from the AWS region); encryption + KMS are AWS-specific so they stay.+export const awsS3Definition: DestinationDefinition = {+ type: 'AwsS3',+ defaults: () => ({+ file_format: 'Parquet',+ compression: 'zstd',+ }),+ requiredFields: ({ isNew }) => [+ 'bucket_name',+ 'region',+ 'prefix',+ ...(isNew ? ['aws_access_key_id'] : []),+ ...(isNew ? ['aws_secret_access_key'] : []),+ ...(isNew ? ['file_format'] : []),+ ],+ validate: (formValues) => ({+ bucket_name: validateBucketName(formValues.bucket_name),+ }),+ eventTableExtraFields: S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS,+ eventTableOverrides: { includeGenericPersonFields: false },+ Fields: function AwsS3Fields({ isNew, formValues, configurationChanged }) {+ return (+ <S3FamilyFields+ isNew={isNew}+ formValues={formValues}+ configurationChanged={configurationChanged}+ regionOptions={AWS_ONLY_REGION_OPTIONS}+ awsBranded+ showEncryption+ showEndpointUrl={false}+ showVirtualStyleAddressing={false}+ />+ )+ },+}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsxindex d942c004afb8..2365eceffa2b 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/common.tsx@@ -1,8 +1,9 @@-import React from 'react'+import React, { type ReactNode } from 'react'-import { LemonInput, LemonSelect } from '@posthog/lemon-ui'+import { LemonCheckbox, LemonInput, LemonSelect, Link } from '@posthog/lemon-ui'import { LemonField } from 'lib/lemon-ui/LemonField'+import { LemonInputSelect } from 'lib/lemon-ui/LemonInputSelect'import type { DatabaseSchemaField } from '~/queries/schema/schema-general'@@ -53,8 +54,11 @@ export function validateAzureContainerName(name: string | undefined): string | ureturn undefined}-// Full S3 region list, including GCP Cloud Storage and a handful of S3-compatible providers.+// S3-family region list spanning AWS, Google Cloud Storage, Cloudflare R2, and OVHcloud. Non-AWS+// entries are prefixed with their provider; AWS-style codes are left bare because S3-compatible+// providers (MinIO, Wasabi, etc.) commonly reuse them (e.g. `us-east-1`) as a default region.export const S3_REGION_OPTIONS: { value: string; label: string }[] = [+ // AWS{ value: 'us-east-1', label: 'US East (N. Virginia)' },{ value: 'us-east-2', label: 'US East (Ohio)' },{ value: 'us-west-1', label: 'US West (N. California)' },@@ -80,27 +84,75 @@ export const S3_REGION_OPTIONS: { value: string; label: string }[] = [{ value: 'me-south-1', label: 'Middle East (Bahrain)' },{ value: 'me-central-1', label: 'Middle East (Riyadh)' },{ value: 'sa-east-1', label: 'South America (São Paulo)' },- { value: 'us-central1', label: 'GCP — US Central (Iowa)' },- { value: 'europe-west4', label: 'GCP — Europe (Netherlands)' },- { value: 'auto', label: 'Automatic (AUTO)' },- { value: 'apac', label: 'Asia Pacific (APAC)' },- { value: 'eeur', label: 'Eastern Europe (EEUR)' },- { value: 'enam', label: 'Eastern North America (ENAM)' },- { value: 'weur', label: 'Western Europe (WEUR)' },- { value: 'wnam', label: 'Western North America (WNAM)' },- { value: 'gra', label: 'Gravelines (GRA)' },- { value: 'rbx', label: 'Roubaix (RBX)' },- { value: 'sbg', label: 'Strasbourg (SBG)' },- { value: 'eu-west-par', label: 'Paris (PAR)' },- { value: 'eu-south-mil', label: 'Milan (MIL)' },- { value: 'de', label: 'Frankfurt (DE)' },- { value: 'uk', label: 'London (UK)' },- { value: 'waw', label: 'Warsaw (WAW)' },- { value: 'bhs', label: 'Beauharnois (BHS)' },- { value: 'ca-east-tor', label: 'Toronto (TOR)' },- { value: 'sgp', label: 'Singapore (SGP)' },- { value: 'ap-southeast-syd', label: 'Sydney (SYD)' },- { value: 'ap-south-mum', label: 'Mumbai (MUM)' },+ // Google Cloud Storage (via the S3-compatible XML API). https://docs.cloud.google.com/storage/docs/locations+ { value: 'northamerica-northeast1', label: 'GCP — Montréal (northamerica-northeast1)' },+ { value: 'northamerica-northeast2', label: 'GCP — Toronto (northamerica-northeast2)' },+ { value: 'northamerica-south1', label: 'GCP — Querétaro (northamerica-south1)' },+ { value: 'us-central1', label: 'GCP — Iowa (us-central1)' },+ { value: 'us-east1', label: 'GCP — South Carolina (us-east1)' },+ { value: 'us-east4', label: 'GCP — Northern Virginia (us-east4)' },+ { value: 'us-east5', label: 'GCP — Columbus (us-east5)' },+ { value: 'us-south1', label: 'GCP — Dallas (us-south1)' },+ { value: 'us-west1', label: 'GCP — Oregon (us-west1)' },+ { value: 'us-west2', label: 'GCP — Los Angeles (us-west2)' },+ { value: 'us-west3', label: 'GCP — Salt Lake City (us-west3)' },+ { value: 'us-west4', label: 'GCP — Las Vegas (us-west4)' },+ { value: 'southamerica-east1', label: 'GCP — São Paulo (southamerica-east1)' },+ { value: 'southamerica-west1', label: 'GCP — Santiago (southamerica-west1)' },+ { value: 'europe-central2', label: 'GCP — Warsaw (europe-central2)' },+ { value: 'europe-north1', label: 'GCP — Finland (europe-north1)' },+ { value: 'europe-north2', label: 'GCP — Stockholm (europe-north2)' },+ { value: 'europe-southwest1', label: 'GCP — Madrid (europe-southwest1)' },+ { value: 'europe-west1', label: 'GCP — Belgium (europe-west1)' },+ { value: 'europe-west2', label: 'GCP — London (europe-west2)' },+ { value: 'europe-west3', label: 'GCP — Frankfurt (europe-west3)' },+ { value: 'europe-west4', label: 'GCP — Netherlands (europe-west4)' },+ { value: 'europe-west6', label: 'GCP — Zürich (europe-west6)' },+ { value: 'europe-west8', label: 'GCP — Milan (europe-west8)' },+ { value: 'europe-west9', label: 'GCP — Paris (europe-west9)' },+ { value: 'europe-west10', label: 'GCP — Berlin (europe-west10)' },+ { value: 'europe-west12', label: 'GCP — Turin (europe-west12)' },+ { value: 'asia-east1', label: 'GCP — Taiwan (asia-east1)' },+ { value: 'asia-east2', label: 'GCP — Hong Kong (asia-east2)' },+ { value: 'asia-northeast1', label: 'GCP — Tokyo (asia-northeast1)' },+ { value: 'asia-northeast2', label: 'GCP — Osaka (asia-northeast2)' },+ { value: 'asia-northeast3', label: 'GCP — Seoul (asia-northeast3)' },+ { value: 'asia-south1', label: 'GCP — Mumbai (asia-south1)' },+ { value: 'asia-south2', label: 'GCP — Delhi (asia-south2)' },+ { value: 'asia-southeast1', label: 'GCP — Singapore (asia-southeast1)' },+ { value: 'asia-southeast2', label: 'GCP — Jakarta (asia-southeast2)' },+ { value: 'asia-southeast3', label: 'GCP — Bangkok (asia-southeast3)' },+ { value: 'me-central1', label: 'GCP — Doha (me-central1)' },+ { value: 'me-central2', label: 'GCP — Dammam (me-central2)' },+ { value: 'me-west1', label: 'GCP — Tel Aviv (me-west1)' },+ { value: 'australia-southeast1', label: 'GCP — Sydney (australia-southeast1)' },+ { value: 'australia-southeast2', label: 'GCP — Melbourne (australia-southeast2)' },+ { value: 'africa-south1', label: 'GCP — Johannesburg (africa-south1)' },+ { value: 'US', label: 'GCP — US (multi-region)' },+ { value: 'EU', label: 'GCP — EU (multi-region)' },+ { value: 'ASIA', label: 'GCP — Asia (multi-region)' },+ // Cloudflare R2 (location hints)+ { value: 'auto', label: 'Cloudflare R2 — Automatic (AUTO)' },+ { value: 'apac', label: 'Cloudflare R2 — Asia Pacific (APAC)' },+ { value: 'eeur', label: 'Cloudflare R2 — Eastern Europe (EEUR)' },+ { value: 'enam', label: 'Cloudflare R2 — Eastern North America (ENAM)' },+ { value: 'oc', label: 'Cloudflare R2 — Oceania (OC)' },+ { value: 'weur', label: 'Cloudflare R2 — Western Europe (WEUR)' },+ { value: 'wnam', label: 'Cloudflare R2 — Western North America (WNAM)' },+ // OVHcloud+ { value: 'gra', label: 'OVH — Gravelines (GRA)' },+ { value: 'rbx', label: 'OVH — Roubaix (RBX)' },+ { value: 'sbg', label: 'OVH — Strasbourg (SBG)' },+ { value: 'eu-west-par', label: 'OVH — Paris (PAR)' },+ { value: 'eu-south-mil', label: 'OVH — Milan (MIL)' },+ { value: 'de', label: 'OVH — Frankfurt (DE)' },+ { value: 'uk', label: 'OVH — London (UK)' },+ { value: 'waw', label: 'OVH — Warsaw (WAW)' },+ { value: 'bhs', label: 'OVH — Beauharnois (BHS)' },+ { value: 'ca-east-tor', label: 'OVH — Toronto (TOR)' },+ { value: 'sgp', label: 'OVH — Singapore (SGP)' },+ { value: 'ap-southeast-syd', label: 'OVH — Sydney (SYD)' },+ { value: 'ap-south-mum', label: 'OVH — Mumbai (MUM)' },]// AWS-only region subset used for the Redshift COPY S3 staging bucket.@@ -234,6 +286,202 @@ export function MaxFileSizeField(): JSX.Element {)}+// Event table preview columns shared by every S3-family destination (S3, AwsS3, S3Compatible).+export const S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS: Record<string, DatabaseSchemaField> = {+ person_id: {+ name: 'person_id',+ hogql_value: 'toString(person_id)',+ type: 'string',+ schema_valid: true,+ },+ person_properties: {+ name: 'person_properties',+ hogql_value: "nullIf(person_properties, '')",+ type: 'string',+ schema_valid: true,+ },+ created_at: {+ name: 'created_at',+ hogql_value: 'created_at',+ type: 'datetime',+ schema_valid: true,+ },+}++// Shared form fields for the S3-family destinations (S3 legacy, AwsS3, S3Compatible). Per-destination+// definitions toggle the AWS-only (encryption/KMS) and S3-compatible-only (endpoint/virtual-style)+// blocks and supply the region option set; everything else is identical.+export function S3FamilyFields({+ isNew,+ formValues,+ configurationChanged,+ regionOptions,+ awsBranded,+ allowCustomRegion = false,+ showEncryption,+ showEndpointUrl,+ endpointUrlRequired = false,+ showVirtualStyleAddressing,+ endpointHelpText,+}: {+ isNew: boolean+ formValues: Record<string, any>+ configurationChanged: boolean+ regionOptions: { value: string; label: string }[]+ // Prefix the credential labels with "AWS" — only true for AWS S3, not the S3-compatible catch-all.+ awsBranded: boolean+ // Let users type a region not in the preset list. True for the S3-compatible catch-all, where we+ // can't enumerate every provider's regions; false for AWS S3, whose regions are a closed set.+ allowCustomRegion?: boolean+ showEncryption: boolean+ showEndpointUrl: boolean+ endpointUrlRequired?: boolean+ showVirtualStyleAddressing: boolean+ endpointHelpText?: ReactNode+}): JSX.Element {+ return (+ <>+ <div className="flex gap-4">+ <LemonField name="bucket_name" label="Bucket" className="flex-1">+ <LemonInput placeholder="e.g. my-bucket" />+ </LemonField>+ <LemonField name="region" label="Region" className="flex-1">+ {({ value, onChange }) =>+ allowCustomRegion ? (+ <LemonInputSelect+ mode="single"+ allowCustomValues+ fullWidth+ value={value ? [value] : []}+ onChange={(vals) => onChange((vals[0] ?? '').trim())}+ options={regionOptions.map((o) => ({ key: o.value, label: o.label }))}+ placeholder="Select or enter a region"+ />+ ) : (+ <LemonSelect value={value} onChange={onChange} options={regionOptions} />+ )+ }+ </LemonField>+ </div>+ <LemonField+ name="prefix"+ label="Key prefix"+ info={+ <>+ Template variables are supported. Please check out the{' '}+ <Link+ to="https://posthog.com/docs/cdp/batch-exports/s3#s3-key-prefix-template-variables"+ target="_blank"+ >+ docs+ </Link>{' '}+ for more information.+ </>+ }+ >+ <LemonInput placeholder="e.g. posthog-events/" />+ </LemonField>++ <div className="flex gap-4">+ <FileFormatField />+ <MaxFileSizeField />+ </div>++ <div className="flex gap-4">+ <CompressionField+ fileFormat={formValues.file_format}+ isNew={isNew}+ configurationChanged={configurationChanged}+ />++ {showEncryption && (+ <LemonField name="encryption" label="Encryption" className="flex-1">+ <LemonSelect+ options={[+ { value: 'AES256', label: 'AES256' },+ { value: 'aws:kms', label: 'aws:kms' },+ { value: null, label: 'No encryption' },+ ]}+ />+ </LemonField>+ )}+ </div>++ <div className="flex gap-4">+ <LemonField+ name="aws_access_key_id"+ label={awsBranded ? 'AWS Access Key ID' : 'Access Key ID'}+ className="flex-1"+ >+ <LemonInput+ placeholder={isNew ? 'e.g. AKIAIOSFODNN7EXAMPLE' : 'Leave unchanged'}+ autoComplete="off"+ />+ </LemonField>++ <LemonField+ name="aws_secret_access_key"+ label={awsBranded ? 'AWS Secret Access Key' : 'Secret Access Key'}+ className="flex-1"+ >+ <LemonInput+ placeholder={isNew ? 'e.g. secret-key' : 'Leave unchanged'}+ type="password"+ autoComplete="new-password"+ />+ </LemonField>++ {showEncryption && formValues.encryption == 'aws:kms' && (+ <LemonField name="kms_key_id" label="AWS KMS Key ID" className="flex-1">+ <LemonInput+ placeholder={isNew ? 'e.g. 1234abcd-12ab-34cd-56ef-1234567890ab' : 'leave unchanged'}+ />+ </LemonField>+ )}+ </div>++ {showEndpointUrl && (+ <LemonField+ name="endpoint_url"+ label="Endpoint URL"+ showOptional={!endpointUrlRequired}+ info={+ endpointHelpText ?? (+ <>+ The endpoint URL corresponding to your provider (e.g. Cloudflare R2, DigitalOcean+ Spaces, Supabase, etc.). Works with any S3-compatible storage.+ </>+ )+ }+ >+ <LemonInput+ placeholder={isNew ? 'e.g. https://<account-id>.r2.cloudflarestorage.com' : 'Leave unchanged'}+ />+ </LemonField>+ )}++ {showVirtualStyleAddressing && (+ <LemonField+ name="use_virtual_style_addressing"+ label="Virtual style addressing"+ showOptional+ info={+ <>+ Some non-AWS S3-compatible destinations may require this setting enabled. Check your+ destination's documentation if "virtual hosted style" is required, otherwise leave unchecked+ </>+ }+ >+ <LemonCheckbox+ bordered+ label={<span className="flex gap-2 items-center">Use virtual style addressing</span>}+ />+ </LemonField>+ )}+ </>+ )+}+// Generic person-related event columns shared by Postgres, Redshift, Snowflake, BigQuery, HTTP.// S3 and Databricks override these (S3 uses person_id/person_properties/created_at; Databricks// emits a different team_id+ingestion-timestamp pair).diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/index.ts b/frontend/src/scenes/data-pipelines/batch-exports/destinations/index.tsindex abc0924a0122..57816214b2d5 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/index.ts+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/index.ts@@ -1,3 +1,4 @@+import { awsS3Definition } from './awss3'import { azureBlobDefinition } from './azureblob'import { bigqueryDefinition } from './bigquery'import { databricksDefinition } from './databricks'@@ -5,11 +6,14 @@ import { httpDefinition } from './http'import { postgresDefinition } from './postgres'import { redshiftDefinition } from './redshift'import { s3Definition } from './s3'+import { s3CompatibleDefinition } from './s3compatible'import { snowflakeDefinition } from './snowflake'import type { BatchExportServiceType, DestinationDefinition } from './types'export const DESTINATIONS: Record<BatchExportServiceType, DestinationDefinition> = {S3: s3Definition,+ AwsS3: awsS3Definition,+ S3Compatible: s3CompatibleDefinition,Postgres: postgresDefinition,Redshift: redshiftDefinition,Snowflake: snowflakeDefinition,diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3.tsxindex da11eed3876e..824397f203b0 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3.tsx+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3.tsx@@ -1,10 +1,9 @@-import { LemonCheckbox, LemonInput, LemonSelect, Link } from '@posthog/lemon-ui'--import { LemonField } from 'lib/lemon-ui/LemonField'--import { CompressionField, FileFormatField, MaxFileSizeField, S3_REGION_OPTIONS, validateBucketName } from './common'+import { S3FamilyFields, S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS, S3_REGION_OPTIONS, validateBucketName } from './common'import type { DestinationDefinition } from './types'+// Legacy `S3` destination, kept for batch exports created before the AwsS3 / S3Compatible split and+// hidden from the picker. It shows every S3-family field so any not-yet-reclassified row keeps working.+// TODO: cleanup once all batch exports have been migrated to AwsS3 or S3Compatibleexport const s3Definition: DestinationDefinition = {type: 'S3',defaults: () => ({@@ -22,131 +21,21 @@ export const s3Definition: DestinationDefinition = {validate: (formValues) => ({bucket_name: validateBucketName(formValues.bucket_name),}),- eventTableExtraFields: {- person_id: {- name: 'person_id',- hogql_value: 'toString(person_id)',- type: 'string',- schema_valid: true,- },- person_properties: {- name: 'person_properties',- hogql_value: "nullIf(person_properties, '')",- type: 'string',- schema_valid: true,- },- created_at: {- name: 'created_at',- hogql_value: 'created_at',- type: 'datetime',- schema_valid: true,- },- },+ eventTableExtraFields: S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS,eventTableOverrides: { includeGenericPersonFields: false },Fields: function S3Fields({ isNew, formValues, configurationChanged }) {return (- <>- <div className="flex gap-4">- <LemonField name="bucket_name" label="Bucket" className="flex-1">- <LemonInput placeholder="e.g. my-bucket" />- </LemonField>- <LemonField name="region" label="Region" className="flex-1">- <LemonSelect options={S3_REGION_OPTIONS} />- </LemonField>- </div>- <LemonField- name="prefix"- label="Key prefix"- info={- <>- Template variables are supported. Please check out the{' '}- <Link- to="https://posthog.com/docs/cdp/batch-exports/s3#s3-key-prefix-template-variables"- target="_blank"- >- docs- </Link>{' '}- for more information.- </>- }- >- <LemonInput placeholder="e.g. posthog-events/" />- </LemonField>-- <div className="flex gap-4">- <FileFormatField />- <MaxFileSizeField />- </div>-- <div className="flex gap-4">- <CompressionField- fileFormat={formValues.file_format}- isNew={isNew}- configurationChanged={configurationChanged}- />-- <LemonField name="encryption" label="Encryption" className="flex-1">- <LemonSelect- options={[- { value: 'AES256', label: 'AES256' },- { value: 'aws:kms', label: 'aws:kms' },- { value: null, label: 'No encryption' },- ]}- />- </LemonField>- </div>-- <div className="flex gap-4">- <LemonField name="aws_access_key_id" label="AWS Access Key ID" className="flex-1">- <LemonInput- placeholder={isNew ? 'e.g. AKIAIOSFODNN7EXAMPLE' : 'Leave unchanged'}- autoComplete="off"- />- </LemonField>-- <LemonField name="aws_secret_access_key" label="AWS Secret Access Key" className="flex-1">- <LemonInput- placeholder={isNew ? 'e.g. secret-key' : 'Leave unchanged'}- type="password"- autoComplete="new-password"- />- </LemonField>-- {formValues.encryption == 'aws:kms' && (- <LemonField name="kms_key_id" label="AWS KMS Key ID" className="flex-1">- <LemonInput- placeholder={isNew ? 'e.g. 1234abcd-12ab-34cd-56ef-1234567890ab' : 'leave unchanged'}- />- </LemonField>- )}- </div>-- <LemonField- name="endpoint_url"- label="Endpoint URL"- showOptional- info={<>Only required if exporting to an S3-compatible blob storage (like MinIO)</>}- >- <LemonInput placeholder={isNew ? 'e.g. https://your-minio-host:9000' : 'Leave unchanged'} />- </LemonField>-- <LemonField- name="use_virtual_style_addressing"- label="Virtual style addressing"- showOptional- info={- <>- Some non-AWS S3-compatible destinations may require this setting enabled. Check your- destination's documentation if "virtual hosted style" is required, otherwise leave unchecked- </>- }- >- <LemonCheckbox- bordered- label={<span className="flex gap-2 items-center">Use virtual style addressing</span>}- />- </LemonField>- </>+ <S3FamilyFields+ isNew={isNew}+ formValues={formValues}+ configurationChanged={configurationChanged}+ regionOptions={S3_REGION_OPTIONS}+ awsBranded+ allowCustomRegion+ showEncryption+ showEndpointUrl+ showVirtualStyleAddressing+ />)},}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsx b/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsxnew file mode 100644index 000000000000..0139dd688aea--- /dev/null+++ b/frontend/src/scenes/data-pipelines/batch-exports/destinations/s3compatible.tsx@@ -0,0 +1,42 @@+import { S3FamilyFields, S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS, S3_REGION_OPTIONS, validateBucketName } from './common'+import type { DestinationDefinition } from './types'++// Catch-all for any non-AWS S3-compatible object storage. Requires an endpoint URL and exposes+// virtual-style addressing; no AWS-specific encryption / KMS fields.+export const s3CompatibleDefinition: DestinationDefinition = {+ type: 'S3Compatible',+ defaults: () => ({+ file_format: 'Parquet',+ compression: 'zstd',+ }),+ requiredFields: ({ isNew }) => [+ 'bucket_name',+ 'region',+ 'prefix',+ 'endpoint_url',+ ...(isNew ? ['aws_access_key_id'] : []),+ ...(isNew ? ['aws_secret_access_key'] : []),+ ...(isNew ? ['file_format'] : []),+ ],+ validate: (formValues) => ({+ bucket_name: validateBucketName(formValues.bucket_name),+ }),+ eventTableExtraFields: S3_FAMILY_EVENT_TABLE_EXTRA_FIELDS,+ eventTableOverrides: { includeGenericPersonFields: false },+ Fields: function S3CompatibleFields({ isNew, formValues, configurationChanged }) {+ return (+ <S3FamilyFields+ isNew={isNew}+ formValues={formValues}+ configurationChanged={configurationChanged}+ regionOptions={S3_REGION_OPTIONS}+ awsBranded={false}+ allowCustomRegion+ showEncryption={false}+ showEndpointUrl+ endpointUrlRequired+ showVirtualStyleAddressing+ />+ )+ },+}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/types.ts b/frontend/src/scenes/data-pipelines/batch-exports/types.tsindex 659af5620d92..ae1ce3a9466b 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/types.ts+++ b/frontend/src/scenes/data-pipelines/batch-exports/types.ts@@ -2,6 +2,7 @@ import { Dayjs } from 'lib/dayjs'import {BatchExportConfiguration,+ BatchExportServiceAwsS3,BatchExportServiceAzureBlob,BatchExportServiceBigQuery,BatchExportServiceDatabricks,@@ -9,6 +10,7 @@ import {BatchExportServicePostgres,BatchExportServiceRedshift,BatchExportServiceS3,+ BatchExportServiceS3Compatible,BatchExportServiceSnowflake,} from '~/types'@@ -22,11 +24,23 @@ export type BatchExportConfigurationForm = Omit<Partial<BatchExportServiceRedshift['config']> &Partial<BatchExportServiceBigQuery['config']> &Partial<BatchExportServiceS3['config']> &+ Partial<BatchExportServiceAwsS3['config']> &+ Partial<BatchExportServiceS3Compatible['config']> &Partial<BatchExportServiceSnowflake['config']> &Partial<BatchExportServiceDatabricks['config']> &Partial<BatchExportServiceHTTP['config']> &Partial<BatchExportServiceAzureBlob['config']> & {- destination: 'S3' | 'Snowflake' | 'Postgres' | 'BigQuery' | 'Redshift' | 'Databricks' | 'HTTP' | 'AzureBlob'+ destination:+ | 'S3'+ | 'AwsS3'+ | 'S3Compatible'+ | 'Snowflake'+ | 'Postgres'+ | 'BigQuery'+ | 'Redshift'+ | 'Databricks'+ | 'HTTP'+ | 'AzureBlob'start_at: Dayjs | nullend_at: Dayjs | null}diff --git a/frontend/src/scenes/data-pipelines/batch-exports/utils.ts b/frontend/src/scenes/data-pipelines/batch-exports/utils.tsindex 292b7f89a9a6..5cabbed44302 100644--- a/frontend/src/scenes/data-pipelines/batch-exports/utils.ts+++ b/frontend/src/scenes/data-pipelines/batch-exports/utils.ts@@ -10,11 +10,27 @@ export const humanizeBatchExportName = (service: BatchExportService['type']): streturn 'PostHog HTTP'case 'AzureBlob':return 'Azure Blob Storage'+ case 'AwsS3':+ return 'AWS S3'+ case 'S3Compatible':+ return 'S3-compatible'default:return service}}+// TODO: move this to DestinationDefinition so all destination config is in a single place+export const humanizeBatchExportDescription = (service: BatchExportService['type']): string => {+ switch (service) {+ case 'AwsS3':+ return 'Batch export data to an AWS S3 bucket'+ case 'S3Compatible':+ return 'Batch export data to an S3-compatible destination'+ default:+ return `${humanizeBatchExportName(service)} batch export`+ }+}+export const normalizeBatchExportService = (service: string): BatchExportService['type'] => {return (BATCH_EXPORT_SERVICE_NAMES.find((s) => s.toLowerCase() === service.toLowerCase()) ??diff --git a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsxindex 8a318c07ed90..140f7728fbcc 100644--- a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx+++ b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx@@ -4,7 +4,7 @@ import { Link } from '@posthog/lemon-ui'import { FEATURE_FLAGS, type FeatureFlagKey } from 'lib/constants'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'-import { humanizeBatchExportName } from 'scenes/data-pipelines/batch-exports/utils'+import { humanizeBatchExportDescription, humanizeBatchExportName } from 'scenes/data-pipelines/batch-exports/utils'import { userLogic } from 'scenes/userLogic'import { SourceConfig } from '~/queries/schema/schema-general'@@ -142,9 +142,18 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicTypeconst httpEnabled =featureFlags[FEATURE_FLAGS.BATCH_EXPORTS_POSTHOG_HTTP] || user?.is_impersonated || user?.is_staff- const services = BATCH_EXPORT_SERVICE_NAMES.filter((service) =>- httpEnabled ? true : service !== ('HTTP' as const)- )+ const services = BATCH_EXPORT_SERVICE_NAMES.filter((service) => {+ // Legacy alias — superseded in the picker by AwsS3 + S3Compatible. Kept in the+ // service list so existing 'S3' rows still load and render.+ if (service === 'S3') {+ return false+ }+ // HTTP is only for Cloud-to-Cloud migrations; gated behind a flag / staff.+ if (service === 'HTTP') {+ return httpEnabled+ }+ return true+ })return services.map((service): HogFunctionTemplateType => ({@@ -159,7 +168,7 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicTypefilters: null,masking: null,free: false,- description: `${humanizeBatchExportName(service)} batch export`,+ description: humanizeBatchExportDescription(service),}))},diff --git a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsxindex 9e735cbf1758..eb4f4fe226ef 100644--- a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx+++ b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx@@ -13,6 +13,7 @@ import { HogFunctionType, PluginConfigTypeNew, PluginType } from '~/types'import { sourceWizardLogic } from 'products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic'import { BATCH_EXPORT_ICON_MAP } from '../batch-exports/BatchExportIcon'+import { humanizeBatchExportDescription } from '../batch-exports/utils'import type { nonHogFunctionsLogicType } from './nonHogFunctionsLogicType'export const nonHogFunctionsLogic = kea<nonHogFunctionsLogicType>([@@ -147,7 +148,7 @@ export const nonHogFunctionsLogic = kea<nonHogFunctionsLogicType>([hogFunctions.push({id: `batch-export-${batchExport.id}`,name: batchExport.name,- description: `${batchExport.destination.type} batch export`,+ description: humanizeBatchExportDescription(batchExport.destination.type),type: 'destination',created_by: null,created_at: batchExport.created_at,diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex a147f8b8040d..01ec92e08757 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -6160,6 +6160,42 @@ export type BatchExportServiceS3 = {}}+export type BatchExportServiceAwsS3 = {+ type: 'AwsS3'+ config: {+ bucket_name: string+ region: string+ prefix: string+ aws_access_key_id: string+ aws_secret_access_key: string+ exclude_events: string[]+ include_events: string[]+ compression: string | null+ encryption: string | null+ kms_key_id: string | null+ file_format: string+ max_file_size_mb: number | null+ }+}++export type BatchExportServiceS3Compatible = {+ type: 'S3Compatible'+ config: {+ bucket_name: string+ region: string+ prefix: string+ aws_access_key_id: string+ aws_secret_access_key: string+ exclude_events: string[]+ include_events: string[]+ compression: string | null+ endpoint_url: string+ use_virtual_style_addressing: boolean+ file_format: string+ max_file_size_mb: number | null+ }+}+export type BatchExportServicePostgres = {type: 'Postgres'config: {@@ -6281,7 +6317,11 @@ export type BatchExportServiceAzureBlob = {// frontend/public/services/// and update RenderBatchExportIconexport const BATCH_EXPORT_SERVICE_NAMES: BatchExportService['type'][] = [+ // 'S3' is the legacy alias kept for reading existing rows and the BatchExportScene validity+ // guard — it is filtered out of the destination picker in favour of AwsS3 + S3Compatible.'S3',+ 'AwsS3',+ 'S3Compatible','Snowflake','Postgres','BigQuery',@@ -6292,6 +6332,8 @@ export const BATCH_EXPORT_SERVICE_NAMES: BatchExportService['type'][] = []export type BatchExportService =| BatchExportServiceS3+ | BatchExportServiceAwsS3+ | BatchExportServiceS3Compatible| BatchExportServiceSnowflake| BatchExportServicePostgres| BatchExportServiceBigQuerydiff --git a/playwright/e2e/batch-exports/batch-export-config.spec.ts b/playwright/e2e/batch-exports/batch-export-config.spec.tsindex 000098998633..7ecf9e77b7ff 100644--- a/playwright/e2e/batch-exports/batch-export-config.spec.ts+++ b/playwright/e2e/batch-exports/batch-export-config.spec.ts@@ -12,8 +12,8 @@ test.describe('Batch export configuration', () => {await playwrightSetup.login(page, workspace!)})- test('Create new S3 batch export', async ({ page }) => {- const name = randomString('S3 Export')+ test('Create new AWS S3 batch export', async ({ page }) => {+ const name = randomString('AWS S3 Export')const mockId = '01234567-0123-0123-0123-0123456789ab'// Mock the batch export creation endpoint (requires Temporal in real env)@@ -29,7 +29,7 @@ test.describe('Batch export configuration', () => {name: body.name,model: 'events',destination: {- type: 'S3',+ type: 'AwsS3',config: {bucket_name: body.destination.config.bucket_name,region: body.destination.config.region,@@ -53,8 +53,8 @@ test.describe('Batch export configuration', () => {}})- await page.goto('/pipeline/batch-exports/new/s3')- await expect(page.locator('.scene-name')).toContainText('S3')+ await page.goto('/pipeline/batch-exports/new/awss3')+ await expect(page.locator('.scene-name')).toContainText('AWS S3')// Edit the name of the batch exportawait page.click('.scene-name button')@@ -84,8 +84,8 @@ test.describe('Batch export configuration', () => {})test('Validate required fields prevent save', async ({ page }) => {- await page.goto('/pipeline/batch-exports/new/s3')- await expect(page.locator('.scene-name')).toContainText('S3')+ await page.goto('/pipeline/batch-exports/new/awss3')+ await expect(page.locator('.scene-name')).toContainText('AWS S3')// Create button should be disabled when required fields are emptyawait expect(page.locator('form').getByRole('button', { name: 'Create' })).toBeDisabled()