cdk-nextjs 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +117 -45
- package/.jsii.tabl.json +1 -1
- package/API.md +66 -1
- package/assets/lambdas/post-deploy/post-deploy.lambda/index.js +10 -7
- package/docs/breaking-changes.md +23 -3
- package/lib/generated-structs/OptionalNextjsPostDeployProps.d.ts +5 -0
- package/lib/generated-structs/OptionalNextjsPostDeployProps.js +1 -1
- package/lib/generated-structs/OptionalPostDeployCustomResourceProperties.d.ts +7 -0
- package/lib/generated-structs/OptionalPostDeployCustomResourceProperties.js +1 -1
- package/lib/lambdas/post-deploy/post-deploy.lambda.js +3 -2
- package/lib/lambdas/post-deploy/prune-s3.d.ts +9 -2
- package/lib/lambdas/post-deploy/prune-s3.js +17 -7
- package/lib/lambdas/post-deploy/prune-s3.test.d.ts +1 -0
- package/lib/lambdas/post-deploy/prune-s3.test.js +176 -0
- package/lib/nextjs-api.d.ts +5 -0
- package/lib/nextjs-api.js +13 -3
- package/lib/nextjs-api.test.js +46 -1
- package/lib/nextjs-build/nextjs-build.js +1 -1
- package/lib/nextjs-cache.js +1 -1
- package/lib/nextjs-compute/nextjs-containers.js +1 -1
- package/lib/nextjs-compute/nextjs-functions.js +1 -1
- package/lib/nextjs-compute/nextjs-image-function.js +1 -1
- package/lib/nextjs-distribution.js +1 -1
- package/lib/nextjs-post-deploy.d.ts +12 -0
- package/lib/nextjs-post-deploy.js +3 -2
- package/lib/nextjs-static-assets.d.ts +6 -0
- package/lib/nextjs-static-assets.js +9 -3
- package/lib/nextjs-static-assets.test.js +20 -1
- package/lib/root-constructs/nextjs-base-construct.d.ts +16 -0
- package/lib/root-constructs/nextjs-base-construct.js +21 -3
- package/lib/root-constructs/nextjs-global-containers.js +3 -2
- package/lib/root-constructs/nextjs-global-functions.js +3 -2
- package/lib/root-constructs/nextjs-regional-containers.d.ts +7 -0
- package/lib/root-constructs/nextjs-regional-containers.js +12 -3
- package/lib/root-constructs/nextjs-regional-functions.js +3 -2
- package/lib/utils/base-path.d.ts +19 -0
- package/lib/utils/base-path.js +25 -1
- package/lib/utils/base-path.test.js +58 -1
- package/package.json +1 -1
package/.jsii.tabl.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2","toolVersion":"5.9.63","snippets":{"4e2896734468b985525afbd29693cab61108bdfb0e909e1b89fa635d76e14eae":{"translations":{"python":{"source":"from next import NextConfig\n\n\nnext_config = {\n # ...\n \"adapter_path\": import.meta.resolve(\"cdk-nextjs/adapter\")\n}export default nextConfig;","version":"2"},"csharp":{"source":"using Next;\n\n\nvar nextConfig = new Dictionary<string, object> {\n // ...\n { \"adapterPath\", import.meta.Resolve(\"cdk-nextjs/adapter\") }\n};export default nextConfig;","version":"1"},"java":{"source":"import next.NextConfig;\n\n\nNextConfig nextConfig = Map.of(\n // ...\n \"adapterPath\", import.meta.resolve(\"cdk-nextjs/adapter\"));export default nextConfig;","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/next\"\n\n\nnextConfig := map[string]interface{}{\n\t// ...\n\t\"adapterPath\": import.meta.resolve(jsii.String(\"cdk-nextjs/adapter\")),\n}export default nextConfig;","version":"1"},"$":{"source":"import { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: import.meta.resolve(\"cdk-nextjs/adapter\"), // for ESM\n // adapterPath: require.resolve(\"cdk-nextjs/adapter\"), // for CJS\n};\n\nexport default nextConfig;","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":51}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { NextConfig } from \"next\";\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: import.meta.resolve(\"cdk-nextjs/adapter\"), // for ESM\n // adapterPath: require.resolve(\"cdk-nextjs/adapter\"), // for CJS\n};\n\nexport default nextConfig;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":7,"184":1,"211":1,"212":1,"214":1,"237":1,"244":1,"261":1,"262":1,"273":1,"274":1,"276":1,"277":1,"278":1,"304":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"29f119aec1e5478a318ae318279508e9b76b5c834a9be35edf466c62e5077306":{"translations":{"python":{"source":"from aws_cdk import App, Stack, StackProps\nfrom constructs import Construct\nfrom cdk_nextjs import NextjsGlobalFunctions\nfrom node:path import join\n\n\nclass WebStack(Stack):\n def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, notificationArns=None, synthesizer=None, terminationProtection=None, analyticsReporting=None, crossRegionReferences=None, permissionsBoundary=None, suppressTemplateIndentation=None, propertyInjectors=None):\n super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, notificationArns=notificationArns, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting, crossRegionReferences=crossRegionReferences, permissionsBoundary=permissionsBoundary, suppressTemplateIndentation=suppressTemplateIndentation, propertyInjectors=propertyInjectors)\n NextjsGlobalFunctions(self, \"Nextjs\",\n build_directory=join(import.meta.dirname),\n health_check_path=\"/api/health\"\n )\n\napp = App()\n\nWebStack(app, \"web-stack\")","version":"2"},"csharp":{"source":"using Amazon.CDK;\nusing Constructs;\nusing Cdk.Nextjs;\nusing Node.Path;\n\nclass WebStack : Stack\n{\n public WebStack(Construct scope, string id, StackProps? props=null) : base(scope, id, props)\n {\n new NextjsGlobalFunctions(this, \"Nextjs\", new NextjsGlobalFunctionsProps {\n BuildDirectory = Join(import.meta.Dirname),\n HealthCheckPath = \"/api/health\"\n });\n }\n}\n\nvar app = new App();\n\nnew WebStack(app, \"web-stack\");","version":"1"},"java":{"source":"import software.amazon.awscdk.App;\nimport software.amazon.awscdk.Stack;\nimport software.amazon.awscdk.StackProps;\nimport software.constructs.Construct;\nimport cdk.nextjs.NextjsGlobalFunctions;\nimport node.path.join.*;\n\n\npublic class WebStack extends Stack {\n public WebStack(Construct scope, String id) {\n this(scope, id, null);\n }\n\n public WebStack(Construct scope, String id, StackProps props) {\n super(scope, id, props);\n NextjsGlobalFunctions.Builder.create(this, \"Nextjs\")\n .buildDirectory(join(import.meta.getDirname()))\n .healthCheckPath(\"/api/health\")\n .build();\n }\n}\n\nApp app = new App();\n\nnew WebStack(app, \"web-stack\");","version":"1"},"go":{"source":"import \"github.com/aws/aws-cdk-go/awscdk\"\nimport \"github.com/aws/constructs-go/constructs\"\nimport \"github.com/aws-samples/dummy/cdknextjs\"\nimport \"github.com/aws-samples/dummy/nodepath\"\n\n\ntype webStack struct {\n\tStack\n}\n\nfunc newWebStack(scope Construct, id *string, props StackProps) *webStack {\n\tthis := &webStack{}\n\tnewStack_Override(this, scope, id, props)\n\tcdknextjs.NewNextjsGlobalFunctions(this, jsii.String(\"Nextjs\"), &NextjsGlobalFunctionsProps{\n\t\tBuildDirectory: *nodepath.Join(import.meta.dirname),\n\t\tHealthCheckPath: jsii.String(\"/api/health\"),\n\t})\n\treturn this\n}\n\napp := awscdk.NewApp()\n\nNewWebStack(app, jsii.String(\"web-stack\"))","version":"1"},"$":{"source":"import { App, Stack, StackProps } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { NextjsGlobalFunctions } from \"cdk-nextjs\";\nimport { join } from \"node:path\";\n\nclass WebStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n healthCheckPath: \"/api/health\",\n });\n }\n}\n\nconst app = new App();\n\nnew WebStack(app, \"web-stack\");","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":72}},"didCompile":false,"fqnsReferenced":["aws-cdk-lib.App","aws-cdk-lib.Stack","aws-cdk-lib.StackProps","cdk-nextjs.NextjsGlobalFunctions","cdk-nextjs.NextjsGlobalFunctionsProps","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { App, Stack, StackProps } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { NextjsGlobalFunctions } from \"cdk-nextjs\";\nimport { join } from \"node:path\";\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nclass WebStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n healthCheckPath: \"/api/health\",\n });\n }\n}\n\nconst app = new App();\n\nnew WebStack(app, \"web-stack\");\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":7,"58":1,"80":26,"108":1,"110":1,"154":1,"170":3,"177":1,"184":2,"211":1,"212":1,"214":2,"215":3,"234":1,"237":1,"242":1,"244":1,"245":3,"261":1,"262":1,"264":1,"273":4,"274":4,"276":4,"277":6,"299":1,"304":2,"308":1},"fqnsFingerprint":"9929371ee601b5a1c726453a30926ed6a347f16786e6ce8883440d3e454824f4"},"d1f22faa68ac77f64682156b6d2791c788b48db8661c81875c6d7d608da8e8c8":{"translations":{"python":{"source":"nextjs = NextjsRegionalContainers(self, \"Nextjs\",\n # ...\n alb=shared_alb,\n ecs_cluster=shared_cluster\n)\nnextjs.nextjs_containers.remove_auto_created_listener()","version":"2"},"csharp":{"source":"var nextjs = new NextjsRegionalContainers(this, \"Nextjs\", new Struct {\n // ...\n Alb = sharedAlb,\n EcsCluster = sharedCluster\n});\nnextjs.NextjsContainers.RemoveAutoCreatedListener();","version":"1"},"java":{"source":"Object nextjs = NextjsRegionalContainers.Builder.create(this, \"Nextjs\")\n // ...\n .alb(sharedAlb)\n .ecsCluster(sharedCluster)\n .build();\nnextjs.nextjsContainers.removeAutoCreatedListener();","version":"1"},"go":{"source":"nextjs := NewNextjsRegionalContainers(this, jsii.String(\"Nextjs\"), map[string]interface{}{\n\t// ...\n\t\"alb\": sharedAlb,\n\t\"ecsCluster\": sharedCluster,\n})\nnextjs.nextjsContainers.removeAutoCreatedListener()","version":"1"},"$":{"source":"const nextjs = new NextjsRegionalContainers(this, \"Nextjs\", {\n // ...\n alb: sharedAlb,\n ecsCluster: sharedCluster,\n});\nnextjs.nextjsContainers.removeAutoCreatedListener();","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":290}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst nextjs = new NextjsRegionalContainers(this, \"Nextjs\", {\n // ...\n alb: sharedAlb,\n ecsCluster: sharedCluster,\n});\nnextjs.nextjsContainers.removeAutoCreatedListener();\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":9,"110":1,"211":1,"212":2,"214":1,"215":1,"244":1,"245":1,"261":1,"262":1,"304":2},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"eebd1de809f293785090f12b543c097e97d49dda8190f1af2cdea4bba3f0ff19":{"translations":{"python":{"source":"join(import.meta.dirname, \"..\", \"web\")or\"/path/to/nextjs/app\"","version":"2"},"csharp":{"source":"Join(import.meta.Dirname, \"..\", \"web\");or;\"/path/to/nextjs/app\";","version":"1"},"java":{"source":"join(import.meta.getDirname(), \"..\", \"web\");or;\"/path/to/nextjs/app\";","version":"1"},"go":{"source":"join(import.meta.dirname, jsii.String(\"..\"), jsii.String(\"web\"))or\"/path/to/nextjs/app\"","version":"1"},"$":{"source":"join(import.meta.dirname, \"..\", \"web\") or \"/path/to/nextjs/app\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBaseProps","memberName":"buildDirectory"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\njoin(import.meta.dirname, \"..\", \"web\") or \"/path/to/nextjs/app\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":3,"80":4,"212":1,"214":1,"237":1,"245":3},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"a7b9d2f8587b8d5b579035aaa8e7a16f3fc2ab9bc33261b18c6274f5c63a18a5":{"translations":{"python":{"source":"# api/health/route.ts\nfrom next.server import NextResponse\n\n\ndef GET(self):\n return NextResponse.json(\"\")","version":"2"},"csharp":{"source":"// api/health/route.ts\nusing Next.Server;\n\n\npublic void GET()\n{\n return NextResponse.Json(\"\");\n}","version":"1"},"java":{"source":"// api/health/route.ts\nimport next.server.NextResponse;\n\n\npublic void GET() {\n return NextResponse.json(\"\");\n}","version":"1"},"go":{"source":"// api/health/route.ts\nimport \"github.com/aws-samples/dummy/next/server\"\n\n\nfunc GET() {\n\treturn nextserver.NextResponse_Json(jsii.String(\"\"))\n}","version":"1"},"$":{"source":"// api/health/route.ts\nimport { NextResponse } from \"next/server\";\n\nexport function GET() {\n return NextResponse.json(\"\");\n}","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBaseProps","memberName":"healthCheckPath"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\n// api/health/route.ts\nimport { NextResponse } from \"next/server\";\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nexport function GET() {\n return NextResponse.json(\"\");\n}\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":4,"95":1,"212":1,"214":1,"242":1,"254":1,"263":1,"273":1,"274":1,"276":1,"277":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"1cbb888be6a3669675e797a75a9f52fb0a6a159d237defd0f8435ac3d4d3ebb4":{"translations":{"python":{"source":"\"/my-base-path\"","version":"2"},"csharp":{"source":"\"/my-base-path\";","version":"1"},"java":{"source":"\"/my-base-path\";","version":"1"},"go":{"source":"\"/my-base-path\"","version":"1"},"$":{"source":"\"/my-base-path\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBaseProps","memberName":"basePath"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/my-base-path\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"f905a28200f10c594d3eb92a4d1493c9f86e5e51f0a7ab26cb2174f8ad7f5e50":{"translations":{"python":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"2"},"csharp":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"java":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"go":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"1"},"$":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"initCacheDir"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"2a436a09ffe5a1e0afff87dc56af97f78eaacdf9234591d3b5e0355b0a2f6ab6":{"translations":{"python":{"source":"\"/Users/john/myapp/public\"","version":"2"},"csharp":{"source":"\"/Users/john/myapp/public\";","version":"1"},"java":{"source":"\"/Users/john/myapp/public\";","version":"1"},"go":{"source":"\"/Users/john/myapp/public\"","version":"1"},"$":{"source":"\"/Users/john/myapp/public\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"publicDirEntries"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/Users/john/myapp/public\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"eb4fd1c904ebd2230509f4b8d9fe8f13e8f95c0fb55ca31da9b3a6d7666f4e68":{"translations":{"python":{"source":"\"./packages/ui/server.js\"(monorepo)","version":"2"},"csharp":{"source":"\"./packages/ui/server.js\"(monorepo);","version":"1"},"java":{"source":"\"./packages/ui/server.js\"(monorepo);","version":"1"},"go":{"source":"\"./packages/ui/server.js\"(monorepo)","version":"1"},"$":{"source":"\"./packages/ui/server.js\" (monorepo)","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"relativePathToEntrypoint"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"./packages/ui/server.js\" (monorepo)\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":1,"214":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"186f22f1a60359d2b2bd35fe7e2a4f5e43201b583be96c160ac9bc2c6f0a1e95":{"translations":{"python":{"source":"\"./apps/web\"for monorepo apps","version":"2"},"csharp":{"source":"\"./apps/web\";for monorepo apps","version":"1"},"java":{"source":"\"./apps/web\";for monorepo apps","version":"1"},"go":{"source":"\"./apps/web\"for monorepo apps","version":"1"},"$":{"source":"\"./apps/web\" for monorepo apps","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"relativePathToPackage"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"./apps/web\" for monorepo apps\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":4,"245":2,"249":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"d68554f1f764c619c525f6b65f384648a5aace63035f4a7b863ebde1914d3df2":{"translations":{"python":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"2"},"csharp":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"java":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"go":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"1"},"$":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsCacheProps","memberName":"initCacheDir"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"5fc189c24759b4e5e2cea45070d7fd9cf597aebbd5a3bdbc0a2c727e76671e1b":{"translations":{"python":{"source":"\"/my-base-path\"","version":"2"},"csharp":{"source":"\"/my-base-path\";","version":"1"},"java":{"source":"\"/my-base-path\";","version":"1"},"go":{"source":"\"/my-base-path\"","version":"1"},"$":{"source":"\"/my-base-path\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsStaticAssetsProps","memberName":"basePath"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/my-base-path\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"cd644042f0973329e2dccbf56e94f70ca3e8f314957ab500562b37d8a25b6f2a":{"translations":{"python":{"source":"# use the provider framework from aws-cdk/custom-resources:\nprovider = customresources.Provider(self, \"ResourceProvider\",\n on_event_handler=on_event_handler,\n is_complete_handler=is_complete_handler\n)\n\nCustomResource(self, \"MyResource\",\n service_token=provider.service_token\n)","version":"2"},"csharp":{"source":"// use the provider framework from aws-cdk/custom-resources:\nvar provider = new customresources.Provider(this, \"ResourceProvider\", new Struct {\n OnEventHandler = onEventHandler,\n IsCompleteHandler = isCompleteHandler\n});\n\nnew CustomResource(this, \"MyResource\", new Struct {\n ServiceToken = provider.ServiceToken\n});","version":"1"},"java":{"source":"// use the provider framework from aws-cdk/custom-resources:\nObject provider = Provider.Builder.create(this, \"ResourceProvider\")\n .onEventHandler(onEventHandler)\n .isCompleteHandler(isCompleteHandler)\n .build();\n\nCustomResource.Builder.create(this, \"MyResource\")\n .serviceToken(provider.getServiceToken())\n .build();","version":"1"},"go":{"source":"// use the provider framework from aws-cdk/custom-resources:\nprovider := customresources.NewProvider(this, jsii.String(\"ResourceProvider\"), map[string]interface{}{\n\t\"onEventHandler\": onEventHandler,\n\t\"isCompleteHandler\": isCompleteHandler,\n})\n\nNewCustomResource(this, jsii.String(\"MyResource\"), map[string]interface{}{\n\t\"serviceToken\": provider.serviceToken,\n})","version":"1"},"$":{"source":"// use the provider framework from aws-cdk/custom-resources:\nconst provider = new customresources.Provider(this, 'ResourceProvider', {\n onEventHandler,\n isCompleteHandler, // optional\n});\n\nnew CustomResource(this, 'MyResource', {\n serviceToken: provider.serviceToken,\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalCustomResourceProps","memberName":"serviceToken"},"field":{"field":"markdown","line":11}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// use the provider framework from aws-cdk/custom-resources:\nconst provider = new customresources.Provider(this, 'ResourceProvider', {\n onEventHandler,\n isCompleteHandler, // optional\n});\n\nnew CustomResource(this, 'MyResource', {\n serviceToken: provider.serviceToken,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":9,"110":2,"211":2,"212":2,"215":2,"244":1,"245":1,"261":1,"262":1,"304":1,"305":2},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"5442213b3596082847e8f52535f015070c171ef269b2fc2cc70080da1248abd3":{"translations":{"python":{"source":"# invoke an AWS Lambda function when a lifecycle event occurs:\nCustomResource(self, \"MyResource\",\n service_token=my_function.function_arn\n)","version":"2"},"csharp":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\n// invoke an AWS Lambda function when a lifecycle event occurs:\nnew CustomResource(this, \"MyResource\", new Struct {\n ServiceToken = myFunction.FunctionArn\n});","version":"1"},"java":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\n// invoke an AWS Lambda function when a lifecycle event occurs:\nCustomResource.Builder.create(this, \"MyResource\")\n .serviceToken(myFunction.getFunctionArn())\n .build();","version":"1"},"go":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\n// invoke an AWS Lambda function when a lifecycle event occurs:\nNewCustomResource(this, jsii.String(\"MyResource\"), map[string]interface{}{\n\t\"serviceToken\": myFunction.functionArn,\n})","version":"1"},"$":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myFunction.functionArn,\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalCustomResourceProps","memberName":"serviceToken"},"field":{"field":"markdown","line":26}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// invoke an AWS Lambda function when a lifecycle event occurs:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myFunction.functionArn,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":4,"110":1,"211":1,"212":1,"215":1,"245":1,"304":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"1aa088d0fe1a5c8b611ee12b98f8ddddf680e78e92b8bfbc004d7f1d81e0db05":{"translations":{"python":{"source":"# publish lifecycle events to an SNS topic:\nCustomResource(self, \"MyResource\",\n service_token=my_topic.topic_arn\n)","version":"2"},"csharp":{"source":"// publish lifecycle events to an SNS topic:\n// publish lifecycle events to an SNS topic:\nnew CustomResource(this, \"MyResource\", new Struct {\n ServiceToken = myTopic.TopicArn\n});","version":"1"},"java":{"source":"// publish lifecycle events to an SNS topic:\n// publish lifecycle events to an SNS topic:\nCustomResource.Builder.create(this, \"MyResource\")\n .serviceToken(myTopic.getTopicArn())\n .build();","version":"1"},"go":{"source":"// publish lifecycle events to an SNS topic:\n// publish lifecycle events to an SNS topic:\nNewCustomResource(this, jsii.String(\"MyResource\"), map[string]interface{}{\n\t\"serviceToken\": myTopic.topicArn,\n})","version":"1"},"$":{"source":"// publish lifecycle events to an SNS topic:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myTopic.topicArn,\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalCustomResourceProps","memberName":"serviceToken"},"field":{"field":"markdown","line":36}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// publish lifecycle events to an SNS topic:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myTopic.topicArn,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":4,"110":1,"211":1,"212":1,"215":1,"245":1,"304":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"416cd627e7165af9844b0610f2556618f7e4e17c479a2b5cb37749b400206b42":{"translations":{"python":{"source":"import aws_cdk.aws_logs as logs\n\n# my_log_group: logs.LogGroup\n\nmy_log_group.log_group_name","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Logs;\n\nLogGroup myLogGroup;\n\nmyLogGroup.LogGroupName;","version":"1"},"java":{"source":"import software.amazon.awscdk.services.logs.*;\n\nLogGroup myLogGroup;\n\nmyLogGroup.getLogGroupName();","version":"1"},"go":{"source":"import logs \"github.com/aws/aws-cdk-go/awscdk\"\n\nvar myLogGroup LogGroup\n\nmyLogGroup.logGroupName","version":"1"},"$":{"source":"import * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\nmyLogGroup.logGroupName;","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalDockerImageFunctionProps","memberName":"logRetention"},"field":{"field":"markdown","line":12}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nmyLogGroup.logGroupName;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":6,"138":1,"167":1,"184":1,"212":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"275":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"8649823826e479c4a10bdb07d7c9d4248a9e1f7d74b0ad412728a606cb14b9e0":{"translations":{"python":{"source":"import aws_cdk.aws_logs as logs\n\n# my_log_group: logs.LogGroup\n\nmy_log_group.log_group_name","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Logs;\n\nLogGroup myLogGroup;\n\nmyLogGroup.LogGroupName;","version":"1"},"java":{"source":"import software.amazon.awscdk.services.logs.*;\n\nLogGroup myLogGroup;\n\nmyLogGroup.getLogGroupName();","version":"1"},"go":{"source":"import logs \"github.com/aws/aws-cdk-go/awscdk\"\n\nvar myLogGroup LogGroup\n\nmyLogGroup.logGroupName","version":"1"},"$":{"source":"import * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\nmyLogGroup.logGroupName;","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalEdgeFunctionProps","memberName":"logRetention"},"field":{"field":"markdown","line":12}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nmyLogGroup.logGroupName;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":6,"138":1,"167":1,"184":1,"212":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"275":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"7a3ea40a322406557f6dd54b49201abcd4b96cf7ddf4d4049324acbe8f6aaa67":{"translations":{"python":{"source":"import aws_cdk.aws_logs as logs\n\n# my_log_group: logs.LogGroup\n\nmy_log_group.log_group_name","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Logs;\n\nLogGroup myLogGroup;\n\nmyLogGroup.LogGroupName;","version":"1"},"java":{"source":"import software.amazon.awscdk.services.logs.*;\n\nLogGroup myLogGroup;\n\nmyLogGroup.getLogGroupName();","version":"1"},"go":{"source":"import logs \"github.com/aws/aws-cdk-go/awscdk\"\n\nvar myLogGroup LogGroup\n\nmyLogGroup.logGroupName","version":"1"},"$":{"source":"import * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\nmyLogGroup.logGroupName;","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalFunctionProps","memberName":"logRetention"},"field":{"field":"markdown","line":12}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nmyLogGroup.logGroupName;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":6,"138":1,"167":1,"184":1,"212":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"275":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"24dbf2206251fc4c3783340dbeecc425f704203d1ed3601b7afe676188f4677a":{"translations":{"python":{"source":"ec2.Vpc(self, \"VPC\",\n subnet_configuration=[{\n \"cidr_mask\": 24,\n \"name\": \"ingress\",\n \"subnet_type\": ec2.SubnetType.PUBLIC\n }, {\n \"cidr_mask\": 24,\n \"name\": \"application\",\n \"subnet_type\": ec2.SubnetType.PRIVATE_WITH_EGRESS\n }, {\n \"cidr_mask\": 28,\n \"name\": \"rds\",\n \"subnet_type\": ec2.SubnetType.PRIVATE_ISOLATED\n }\n ]\n)","version":"2"},"csharp":{"source":"new ec2.Vpc(this, \"VPC\", new Struct {\n SubnetConfiguration = new [] { new Struct {\n CidrMask = 24,\n Name = \"ingress\",\n SubnetType = ec2.SubnetType.PUBLIC\n }, new Struct {\n CidrMask = 24,\n Name = \"application\",\n SubnetType = ec2.SubnetType.PRIVATE_WITH_EGRESS\n }, new Struct {\n CidrMask = 28,\n Name = \"rds\",\n SubnetType = ec2.SubnetType.PRIVATE_ISOLATED\n } }\n});","version":"1"},"java":{"source":"Vpc.Builder.create(this, \"VPC\")\n .subnetConfiguration(List.of(Map.of(\n \"cidrMask\", 24,\n \"name\", \"ingress\",\n \"subnetType\", ec2.getSubnetType().getPUBLIC()), Map.of(\n \"cidrMask\", 24,\n \"name\", \"application\",\n \"subnetType\", ec2.getSubnetType().getPRIVATE_WITH_EGRESS()), Map.of(\n \"cidrMask\", 28,\n \"name\", \"rds\",\n \"subnetType\", ec2.getSubnetType().getPRIVATE_ISOLATED())))\n .build();","version":"1"},"go":{"source":"ec2.NewVpc(this, jsii.String(\"VPC\"), map[string][]map[string]interface{}{\n\t\"subnetConfiguration\": []map[string]interface{}{\n\t\tmap[string]interface{}{\n\t\t\t\"cidrMask\": jsii.Number(24),\n\t\t\t\"name\": jsii.String(\"ingress\"),\n\t\t\t\"subnetType\": ec2.SubnetType_PUBLIC,\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"cidrMask\": jsii.Number(24),\n\t\t\t\"name\": jsii.String(\"application\"),\n\t\t\t\"subnetType\": ec2.SubnetType_PRIVATE_WITH_EGRESS,\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"cidrMask\": jsii.Number(28),\n\t\t\t\"name\": jsii.String(\"rds\"),\n\t\t\t\"subnetType\": ec2.SubnetType_PRIVATE_ISOLATED,\n\t\t},\n\t},\n})","version":"1"},"$":{"source":"new ec2.Vpc(this, 'VPC', {\n subnetConfiguration: [\n {\n cidrMask: 24,\n name: 'ingress',\n subnetType: ec2.SubnetType.PUBLIC,\n },\n {\n cidrMask: 24,\n name: 'application',\n subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,\n },\n {\n cidrMask: 28,\n name: 'rds',\n subnetType: ec2.SubnetType.PRIVATE_ISOLATED,\n }\n ]\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalVpcProps","memberName":"subnetConfiguration"},"field":{"field":"markdown","line":7}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew ec2.Vpc(this, 'VPC', {\n subnetConfiguration: [\n {\n cidrMask: 24,\n name: 'ingress',\n subnetType: ec2.SubnetType.PUBLIC,\n },\n {\n cidrMask: 24,\n name: 'application',\n subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,\n },\n {\n cidrMask: 28,\n name: 'rds',\n subnetType: ec2.SubnetType.PRIVATE_ISOLATED,\n }\n ]\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"9":3,"11":4,"80":21,"110":1,"210":1,"211":4,"212":7,"215":1,"245":1,"304":10},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}}}
|
|
1
|
+
{"version":"2","toolVersion":"5.9.63","snippets":{"4e2896734468b985525afbd29693cab61108bdfb0e909e1b89fa635d76e14eae":{"translations":{"python":{"source":"from next import NextConfig\n\n\nnext_config = {\n # ...\n \"adapter_path\": import.meta.resolve(\"cdk-nextjs/adapter\")\n}export default nextConfig;","version":"2"},"csharp":{"source":"using Next;\n\n\nvar nextConfig = new Dictionary<string, object> {\n // ...\n { \"adapterPath\", import.meta.Resolve(\"cdk-nextjs/adapter\") }\n};export default nextConfig;","version":"1"},"java":{"source":"import next.NextConfig;\n\n\nNextConfig nextConfig = Map.of(\n // ...\n \"adapterPath\", import.meta.resolve(\"cdk-nextjs/adapter\"));export default nextConfig;","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/next\"\n\n\nnextConfig := map[string]interface{}{\n\t// ...\n\t\"adapterPath\": import.meta.resolve(jsii.String(\"cdk-nextjs/adapter\")),\n}export default nextConfig;","version":"1"},"$":{"source":"import { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: import.meta.resolve(\"cdk-nextjs/adapter\"), // for ESM\n // adapterPath: require.resolve(\"cdk-nextjs/adapter\"), // for CJS\n};\n\nexport default nextConfig;","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":51}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { NextConfig } from \"next\";\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: import.meta.resolve(\"cdk-nextjs/adapter\"), // for ESM\n // adapterPath: require.resolve(\"cdk-nextjs/adapter\"), // for CJS\n};\n\nexport default nextConfig;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":7,"184":1,"211":1,"212":1,"214":1,"237":1,"244":1,"261":1,"262":1,"273":1,"274":1,"276":1,"277":1,"278":1,"304":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"29f119aec1e5478a318ae318279508e9b76b5c834a9be35edf466c62e5077306":{"translations":{"python":{"source":"from aws_cdk import App, Stack, StackProps\nfrom constructs import Construct\nfrom cdk_nextjs import NextjsGlobalFunctions\nfrom node:path import join\n\n\nclass WebStack(Stack):\n def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, notificationArns=None, synthesizer=None, terminationProtection=None, analyticsReporting=None, crossRegionReferences=None, permissionsBoundary=None, suppressTemplateIndentation=None, propertyInjectors=None):\n super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, notificationArns=notificationArns, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting, crossRegionReferences=crossRegionReferences, permissionsBoundary=permissionsBoundary, suppressTemplateIndentation=suppressTemplateIndentation, propertyInjectors=propertyInjectors)\n NextjsGlobalFunctions(self, \"Nextjs\",\n build_directory=join(import.meta.dirname),\n health_check_path=\"/api/health\"\n )\n\napp = App()\n\nWebStack(app, \"web-stack\")","version":"2"},"csharp":{"source":"using Amazon.CDK;\nusing Constructs;\nusing Cdk.Nextjs;\nusing Node.Path;\n\nclass WebStack : Stack\n{\n public WebStack(Construct scope, string id, StackProps? props=null) : base(scope, id, props)\n {\n new NextjsGlobalFunctions(this, \"Nextjs\", new NextjsGlobalFunctionsProps {\n BuildDirectory = Join(import.meta.Dirname),\n HealthCheckPath = \"/api/health\"\n });\n }\n}\n\nvar app = new App();\n\nnew WebStack(app, \"web-stack\");","version":"1"},"java":{"source":"import software.amazon.awscdk.App;\nimport software.amazon.awscdk.Stack;\nimport software.amazon.awscdk.StackProps;\nimport software.constructs.Construct;\nimport cdk.nextjs.NextjsGlobalFunctions;\nimport node.path.join.*;\n\n\npublic class WebStack extends Stack {\n public WebStack(Construct scope, String id) {\n this(scope, id, null);\n }\n\n public WebStack(Construct scope, String id, StackProps props) {\n super(scope, id, props);\n NextjsGlobalFunctions.Builder.create(this, \"Nextjs\")\n .buildDirectory(join(import.meta.getDirname()))\n .healthCheckPath(\"/api/health\")\n .build();\n }\n}\n\nApp app = new App();\n\nnew WebStack(app, \"web-stack\");","version":"1"},"go":{"source":"import \"github.com/aws/aws-cdk-go/awscdk\"\nimport \"github.com/aws/constructs-go/constructs\"\nimport \"github.com/aws-samples/dummy/cdknextjs\"\nimport \"github.com/aws-samples/dummy/nodepath\"\n\n\ntype webStack struct {\n\tStack\n}\n\nfunc newWebStack(scope Construct, id *string, props StackProps) *webStack {\n\tthis := &webStack{}\n\tnewStack_Override(this, scope, id, props)\n\tcdknextjs.NewNextjsGlobalFunctions(this, jsii.String(\"Nextjs\"), &NextjsGlobalFunctionsProps{\n\t\tBuildDirectory: *nodepath.Join(import.meta.dirname),\n\t\tHealthCheckPath: jsii.String(\"/api/health\"),\n\t})\n\treturn this\n}\n\napp := awscdk.NewApp()\n\nNewWebStack(app, jsii.String(\"web-stack\"))","version":"1"},"$":{"source":"import { App, Stack, StackProps } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { NextjsGlobalFunctions } from \"cdk-nextjs\";\nimport { join } from \"node:path\";\n\nclass WebStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n healthCheckPath: \"/api/health\",\n });\n }\n}\n\nconst app = new App();\n\nnew WebStack(app, \"web-stack\");","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":72}},"didCompile":false,"fqnsReferenced":["aws-cdk-lib.App","aws-cdk-lib.Stack","aws-cdk-lib.StackProps","cdk-nextjs.NextjsGlobalFunctions","cdk-nextjs.NextjsGlobalFunctionsProps","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { App, Stack, StackProps } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { NextjsGlobalFunctions } from \"cdk-nextjs\";\nimport { join } from \"node:path\";\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nclass WebStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n healthCheckPath: \"/api/health\",\n });\n }\n}\n\nconst app = new App();\n\nnew WebStack(app, \"web-stack\");\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":7,"58":1,"80":26,"108":1,"110":1,"154":1,"170":3,"177":1,"184":2,"211":1,"212":1,"214":2,"215":3,"234":1,"237":1,"242":1,"244":1,"245":3,"261":1,"262":1,"264":1,"273":4,"274":4,"276":4,"277":6,"299":1,"304":2,"308":1},"fqnsFingerprint":"ea911c0e4cf4a3e7eef7bbc6b1a7ab09d75b207e1405aae18280e6bac3e16ebc"},"d1f22faa68ac77f64682156b6d2791c788b48db8661c81875c6d7d608da8e8c8":{"translations":{"python":{"source":"nextjs = NextjsRegionalContainers(self, \"Nextjs\",\n # ...\n alb=shared_alb,\n ecs_cluster=shared_cluster\n)\nnextjs.nextjs_containers.remove_auto_created_listener()","version":"2"},"csharp":{"source":"var nextjs = new NextjsRegionalContainers(this, \"Nextjs\", new Struct {\n // ...\n Alb = sharedAlb,\n EcsCluster = sharedCluster\n});\nnextjs.NextjsContainers.RemoveAutoCreatedListener();","version":"1"},"java":{"source":"Object nextjs = NextjsRegionalContainers.Builder.create(this, \"Nextjs\")\n // ...\n .alb(sharedAlb)\n .ecsCluster(sharedCluster)\n .build();\nnextjs.nextjsContainers.removeAutoCreatedListener();","version":"1"},"go":{"source":"nextjs := NewNextjsRegionalContainers(this, jsii.String(\"Nextjs\"), map[string]interface{}{\n\t// ...\n\t\"alb\": sharedAlb,\n\t\"ecsCluster\": sharedCluster,\n})\nnextjs.nextjsContainers.removeAutoCreatedListener()","version":"1"},"$":{"source":"const nextjs = new NextjsRegionalContainers(this, \"Nextjs\", {\n // ...\n alb: sharedAlb,\n ecsCluster: sharedCluster,\n});\nnextjs.nextjsContainers.removeAutoCreatedListener();","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":290}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst nextjs = new NextjsRegionalContainers(this, \"Nextjs\", {\n // ...\n alb: sharedAlb,\n ecsCluster: sharedCluster,\n});\nnextjs.nextjsContainers.removeAutoCreatedListener();\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":9,"110":1,"211":1,"212":2,"214":1,"215":1,"244":1,"245":1,"261":1,"262":1,"304":2},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"eebd1de809f293785090f12b543c097e97d49dda8190f1af2cdea4bba3f0ff19":{"translations":{"python":{"source":"join(import.meta.dirname, \"..\", \"web\")or\"/path/to/nextjs/app\"","version":"2"},"csharp":{"source":"Join(import.meta.Dirname, \"..\", \"web\");or;\"/path/to/nextjs/app\";","version":"1"},"java":{"source":"join(import.meta.getDirname(), \"..\", \"web\");or;\"/path/to/nextjs/app\";","version":"1"},"go":{"source":"join(import.meta.dirname, jsii.String(\"..\"), jsii.String(\"web\"))or\"/path/to/nextjs/app\"","version":"1"},"$":{"source":"join(import.meta.dirname, \"..\", \"web\") or \"/path/to/nextjs/app\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBaseProps","memberName":"buildDirectory"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\njoin(import.meta.dirname, \"..\", \"web\") or \"/path/to/nextjs/app\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":3,"80":4,"212":1,"214":1,"237":1,"245":3},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"a7b9d2f8587b8d5b579035aaa8e7a16f3fc2ab9bc33261b18c6274f5c63a18a5":{"translations":{"python":{"source":"# api/health/route.ts\nfrom next.server import NextResponse\n\n\ndef GET(self):\n return NextResponse.json(\"\")","version":"2"},"csharp":{"source":"// api/health/route.ts\nusing Next.Server;\n\n\npublic void GET()\n{\n return NextResponse.Json(\"\");\n}","version":"1"},"java":{"source":"// api/health/route.ts\nimport next.server.NextResponse;\n\n\npublic void GET() {\n return NextResponse.json(\"\");\n}","version":"1"},"go":{"source":"// api/health/route.ts\nimport \"github.com/aws-samples/dummy/next/server\"\n\n\nfunc GET() {\n\treturn nextserver.NextResponse_Json(jsii.String(\"\"))\n}","version":"1"},"$":{"source":"// api/health/route.ts\nimport { NextResponse } from \"next/server\";\n\nexport function GET() {\n return NextResponse.json(\"\");\n}","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBaseProps","memberName":"healthCheckPath"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\n// api/health/route.ts\nimport { NextResponse } from \"next/server\";\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nexport function GET() {\n return NextResponse.json(\"\");\n}\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":4,"95":1,"212":1,"214":1,"242":1,"254":1,"263":1,"273":1,"274":1,"276":1,"277":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"1cbb888be6a3669675e797a75a9f52fb0a6a159d237defd0f8435ac3d4d3ebb4":{"translations":{"python":{"source":"\"/my-base-path\"","version":"2"},"csharp":{"source":"\"/my-base-path\";","version":"1"},"java":{"source":"\"/my-base-path\";","version":"1"},"go":{"source":"\"/my-base-path\"","version":"1"},"$":{"source":"\"/my-base-path\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBaseProps","memberName":"basePath"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/my-base-path\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"f905a28200f10c594d3eb92a4d1493c9f86e5e51f0a7ab26cb2174f8ad7f5e50":{"translations":{"python":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"2"},"csharp":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"java":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"go":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"1"},"$":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"initCacheDir"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"2a436a09ffe5a1e0afff87dc56af97f78eaacdf9234591d3b5e0355b0a2f6ab6":{"translations":{"python":{"source":"\"/Users/john/myapp/public\"","version":"2"},"csharp":{"source":"\"/Users/john/myapp/public\";","version":"1"},"java":{"source":"\"/Users/john/myapp/public\";","version":"1"},"go":{"source":"\"/Users/john/myapp/public\"","version":"1"},"$":{"source":"\"/Users/john/myapp/public\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"publicDirEntries"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/Users/john/myapp/public\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"eb4fd1c904ebd2230509f4b8d9fe8f13e8f95c0fb55ca31da9b3a6d7666f4e68":{"translations":{"python":{"source":"\"./packages/ui/server.js\"(monorepo)","version":"2"},"csharp":{"source":"\"./packages/ui/server.js\"(monorepo);","version":"1"},"java":{"source":"\"./packages/ui/server.js\"(monorepo);","version":"1"},"go":{"source":"\"./packages/ui/server.js\"(monorepo)","version":"1"},"$":{"source":"\"./packages/ui/server.js\" (monorepo)","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"relativePathToEntrypoint"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"./packages/ui/server.js\" (monorepo)\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":1,"214":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"186f22f1a60359d2b2bd35fe7e2a4f5e43201b583be96c160ac9bc2c6f0a1e95":{"translations":{"python":{"source":"\"./apps/web\"for monorepo apps","version":"2"},"csharp":{"source":"\"./apps/web\";for monorepo apps","version":"1"},"java":{"source":"\"./apps/web\";for monorepo apps","version":"1"},"go":{"source":"\"./apps/web\"for monorepo apps","version":"1"},"$":{"source":"\"./apps/web\" for monorepo apps","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"relativePathToPackage"},"field":{"field":"example"}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"./apps/web\" for monorepo apps\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":4,"245":2,"249":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"d68554f1f764c619c525f6b65f384648a5aace63035f4a7b863ebde1914d3df2":{"translations":{"python":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"2"},"csharp":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"java":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\";","version":"1"},"go":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"1"},"$":{"source":"\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsCacheProps","memberName":"initCacheDir"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/Users/john/myapp/.next/cdk-nextjs-init-cache\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"5fc189c24759b4e5e2cea45070d7fd9cf597aebbd5a3bdbc0a2c727e76671e1b":{"translations":{"python":{"source":"\"/my-base-path\"","version":"2"},"csharp":{"source":"\"/my-base-path\";","version":"1"},"java":{"source":"\"/my-base-path\";","version":"1"},"go":{"source":"\"/my-base-path\"","version":"1"},"$":{"source":"\"/my-base-path\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsStaticAssetsProps","memberName":"basePath"},"field":{"field":"example"}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\"/my-base-path\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"cd644042f0973329e2dccbf56e94f70ca3e8f314957ab500562b37d8a25b6f2a":{"translations":{"python":{"source":"# use the provider framework from aws-cdk/custom-resources:\nprovider = customresources.Provider(self, \"ResourceProvider\",\n on_event_handler=on_event_handler,\n is_complete_handler=is_complete_handler\n)\n\nCustomResource(self, \"MyResource\",\n service_token=provider.service_token\n)","version":"2"},"csharp":{"source":"// use the provider framework from aws-cdk/custom-resources:\nvar provider = new customresources.Provider(this, \"ResourceProvider\", new Struct {\n OnEventHandler = onEventHandler,\n IsCompleteHandler = isCompleteHandler\n});\n\nnew CustomResource(this, \"MyResource\", new Struct {\n ServiceToken = provider.ServiceToken\n});","version":"1"},"java":{"source":"// use the provider framework from aws-cdk/custom-resources:\nObject provider = Provider.Builder.create(this, \"ResourceProvider\")\n .onEventHandler(onEventHandler)\n .isCompleteHandler(isCompleteHandler)\n .build();\n\nCustomResource.Builder.create(this, \"MyResource\")\n .serviceToken(provider.getServiceToken())\n .build();","version":"1"},"go":{"source":"// use the provider framework from aws-cdk/custom-resources:\nprovider := customresources.NewProvider(this, jsii.String(\"ResourceProvider\"), map[string]interface{}{\n\t\"onEventHandler\": onEventHandler,\n\t\"isCompleteHandler\": isCompleteHandler,\n})\n\nNewCustomResource(this, jsii.String(\"MyResource\"), map[string]interface{}{\n\t\"serviceToken\": provider.serviceToken,\n})","version":"1"},"$":{"source":"// use the provider framework from aws-cdk/custom-resources:\nconst provider = new customresources.Provider(this, 'ResourceProvider', {\n onEventHandler,\n isCompleteHandler, // optional\n});\n\nnew CustomResource(this, 'MyResource', {\n serviceToken: provider.serviceToken,\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalCustomResourceProps","memberName":"serviceToken"},"field":{"field":"markdown","line":11}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// use the provider framework from aws-cdk/custom-resources:\nconst provider = new customresources.Provider(this, 'ResourceProvider', {\n onEventHandler,\n isCompleteHandler, // optional\n});\n\nnew CustomResource(this, 'MyResource', {\n serviceToken: provider.serviceToken,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":9,"110":2,"211":2,"212":2,"215":2,"244":1,"245":1,"261":1,"262":1,"304":1,"305":2},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"5442213b3596082847e8f52535f015070c171ef269b2fc2cc70080da1248abd3":{"translations":{"python":{"source":"# invoke an AWS Lambda function when a lifecycle event occurs:\nCustomResource(self, \"MyResource\",\n service_token=my_function.function_arn\n)","version":"2"},"csharp":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\n// invoke an AWS Lambda function when a lifecycle event occurs:\nnew CustomResource(this, \"MyResource\", new Struct {\n ServiceToken = myFunction.FunctionArn\n});","version":"1"},"java":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\n// invoke an AWS Lambda function when a lifecycle event occurs:\nCustomResource.Builder.create(this, \"MyResource\")\n .serviceToken(myFunction.getFunctionArn())\n .build();","version":"1"},"go":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\n// invoke an AWS Lambda function when a lifecycle event occurs:\nNewCustomResource(this, jsii.String(\"MyResource\"), map[string]interface{}{\n\t\"serviceToken\": myFunction.functionArn,\n})","version":"1"},"$":{"source":"// invoke an AWS Lambda function when a lifecycle event occurs:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myFunction.functionArn,\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalCustomResourceProps","memberName":"serviceToken"},"field":{"field":"markdown","line":26}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// invoke an AWS Lambda function when a lifecycle event occurs:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myFunction.functionArn,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":4,"110":1,"211":1,"212":1,"215":1,"245":1,"304":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"1aa088d0fe1a5c8b611ee12b98f8ddddf680e78e92b8bfbc004d7f1d81e0db05":{"translations":{"python":{"source":"# publish lifecycle events to an SNS topic:\nCustomResource(self, \"MyResource\",\n service_token=my_topic.topic_arn\n)","version":"2"},"csharp":{"source":"// publish lifecycle events to an SNS topic:\n// publish lifecycle events to an SNS topic:\nnew CustomResource(this, \"MyResource\", new Struct {\n ServiceToken = myTopic.TopicArn\n});","version":"1"},"java":{"source":"// publish lifecycle events to an SNS topic:\n// publish lifecycle events to an SNS topic:\nCustomResource.Builder.create(this, \"MyResource\")\n .serviceToken(myTopic.getTopicArn())\n .build();","version":"1"},"go":{"source":"// publish lifecycle events to an SNS topic:\n// publish lifecycle events to an SNS topic:\nNewCustomResource(this, jsii.String(\"MyResource\"), map[string]interface{}{\n\t\"serviceToken\": myTopic.topicArn,\n})","version":"1"},"$":{"source":"// publish lifecycle events to an SNS topic:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myTopic.topicArn,\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalCustomResourceProps","memberName":"serviceToken"},"field":{"field":"markdown","line":36}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// publish lifecycle events to an SNS topic:\nnew CustomResource(this, 'MyResource', {\n serviceToken: myTopic.topicArn,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":4,"110":1,"211":1,"212":1,"215":1,"245":1,"304":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"416cd627e7165af9844b0610f2556618f7e4e17c479a2b5cb37749b400206b42":{"translations":{"python":{"source":"import aws_cdk.aws_logs as logs\n\n# my_log_group: logs.LogGroup\n\nmy_log_group.log_group_name","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Logs;\n\nLogGroup myLogGroup;\n\nmyLogGroup.LogGroupName;","version":"1"},"java":{"source":"import software.amazon.awscdk.services.logs.*;\n\nLogGroup myLogGroup;\n\nmyLogGroup.getLogGroupName();","version":"1"},"go":{"source":"import logs \"github.com/aws/aws-cdk-go/awscdk\"\n\nvar myLogGroup LogGroup\n\nmyLogGroup.logGroupName","version":"1"},"$":{"source":"import * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\nmyLogGroup.logGroupName;","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalDockerImageFunctionProps","memberName":"logRetention"},"field":{"field":"markdown","line":12}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nmyLogGroup.logGroupName;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":6,"138":1,"167":1,"184":1,"212":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"275":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"8649823826e479c4a10bdb07d7c9d4248a9e1f7d74b0ad412728a606cb14b9e0":{"translations":{"python":{"source":"import aws_cdk.aws_logs as logs\n\n# my_log_group: logs.LogGroup\n\nmy_log_group.log_group_name","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Logs;\n\nLogGroup myLogGroup;\n\nmyLogGroup.LogGroupName;","version":"1"},"java":{"source":"import software.amazon.awscdk.services.logs.*;\n\nLogGroup myLogGroup;\n\nmyLogGroup.getLogGroupName();","version":"1"},"go":{"source":"import logs \"github.com/aws/aws-cdk-go/awscdk\"\n\nvar myLogGroup LogGroup\n\nmyLogGroup.logGroupName","version":"1"},"$":{"source":"import * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\nmyLogGroup.logGroupName;","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalEdgeFunctionProps","memberName":"logRetention"},"field":{"field":"markdown","line":12}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nmyLogGroup.logGroupName;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":6,"138":1,"167":1,"184":1,"212":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"275":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"7a3ea40a322406557f6dd54b49201abcd4b96cf7ddf4d4049324acbe8f6aaa67":{"translations":{"python":{"source":"import aws_cdk.aws_logs as logs\n\n# my_log_group: logs.LogGroup\n\nmy_log_group.log_group_name","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Logs;\n\nLogGroup myLogGroup;\n\nmyLogGroup.LogGroupName;","version":"1"},"java":{"source":"import software.amazon.awscdk.services.logs.*;\n\nLogGroup myLogGroup;\n\nmyLogGroup.getLogGroupName();","version":"1"},"go":{"source":"import logs \"github.com/aws/aws-cdk-go/awscdk\"\n\nvar myLogGroup LogGroup\n\nmyLogGroup.logGroupName","version":"1"},"$":{"source":"import * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\nmyLogGroup.logGroupName;","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalFunctionProps","memberName":"logRetention"},"field":{"field":"markdown","line":12}},"didCompile":true,"fqnsReferenced":[],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as logs from 'aws-cdk-lib/aws-logs';\n\ndeclare const myLogGroup: logs.LogGroup;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nmyLogGroup.logGroupName;\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"80":6,"138":1,"167":1,"184":1,"212":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"275":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"24dbf2206251fc4c3783340dbeecc425f704203d1ed3601b7afe676188f4677a":{"translations":{"python":{"source":"ec2.Vpc(self, \"VPC\",\n subnet_configuration=[{\n \"cidr_mask\": 24,\n \"name\": \"ingress\",\n \"subnet_type\": ec2.SubnetType.PUBLIC\n }, {\n \"cidr_mask\": 24,\n \"name\": \"application\",\n \"subnet_type\": ec2.SubnetType.PRIVATE_WITH_EGRESS\n }, {\n \"cidr_mask\": 28,\n \"name\": \"rds\",\n \"subnet_type\": ec2.SubnetType.PRIVATE_ISOLATED\n }\n ]\n)","version":"2"},"csharp":{"source":"new ec2.Vpc(this, \"VPC\", new Struct {\n SubnetConfiguration = new [] { new Struct {\n CidrMask = 24,\n Name = \"ingress\",\n SubnetType = ec2.SubnetType.PUBLIC\n }, new Struct {\n CidrMask = 24,\n Name = \"application\",\n SubnetType = ec2.SubnetType.PRIVATE_WITH_EGRESS\n }, new Struct {\n CidrMask = 28,\n Name = \"rds\",\n SubnetType = ec2.SubnetType.PRIVATE_ISOLATED\n } }\n});","version":"1"},"java":{"source":"Vpc.Builder.create(this, \"VPC\")\n .subnetConfiguration(List.of(Map.of(\n \"cidrMask\", 24,\n \"name\", \"ingress\",\n \"subnetType\", ec2.getSubnetType().getPUBLIC()), Map.of(\n \"cidrMask\", 24,\n \"name\", \"application\",\n \"subnetType\", ec2.getSubnetType().getPRIVATE_WITH_EGRESS()), Map.of(\n \"cidrMask\", 28,\n \"name\", \"rds\",\n \"subnetType\", ec2.getSubnetType().getPRIVATE_ISOLATED())))\n .build();","version":"1"},"go":{"source":"ec2.NewVpc(this, jsii.String(\"VPC\"), map[string][]map[string]interface{}{\n\t\"subnetConfiguration\": []map[string]interface{}{\n\t\tmap[string]interface{}{\n\t\t\t\"cidrMask\": jsii.Number(24),\n\t\t\t\"name\": jsii.String(\"ingress\"),\n\t\t\t\"subnetType\": ec2.SubnetType_PUBLIC,\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"cidrMask\": jsii.Number(24),\n\t\t\t\"name\": jsii.String(\"application\"),\n\t\t\t\"subnetType\": ec2.SubnetType_PRIVATE_WITH_EGRESS,\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"cidrMask\": jsii.Number(28),\n\t\t\t\"name\": jsii.String(\"rds\"),\n\t\t\t\"subnetType\": ec2.SubnetType_PRIVATE_ISOLATED,\n\t\t},\n\t},\n})","version":"1"},"$":{"source":"new ec2.Vpc(this, 'VPC', {\n subnetConfiguration: [\n {\n cidrMask: 24,\n name: 'ingress',\n subnetType: ec2.SubnetType.PUBLIC,\n },\n {\n cidrMask: 24,\n name: 'application',\n subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,\n },\n {\n cidrMask: 28,\n name: 'rds',\n subnetType: ec2.SubnetType.PRIVATE_ISOLATED,\n }\n ]\n});","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.OptionalVpcProps","memberName":"subnetConfiguration"},"field":{"field":"markdown","line":7}},"didCompile":false,"fqnsReferenced":[],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew ec2.Vpc(this, 'VPC', {\n subnetConfiguration: [\n {\n cidrMask: 24,\n name: 'ingress',\n subnetType: ec2.SubnetType.PUBLIC,\n },\n {\n cidrMask: 24,\n name: 'application',\n subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,\n },\n {\n cidrMask: 28,\n name: 'rds',\n subnetType: ec2.SubnetType.PRIVATE_ISOLATED,\n }\n ]\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"9":3,"11":4,"80":21,"110":1,"210":1,"211":4,"212":7,"215":1,"245":1,"304":10},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}}}
|
package/API.md
CHANGED
|
@@ -2213,7 +2213,7 @@ Any object.
|
|
|
2213
2213
|
| **Name** | **Type** | **Description** |
|
|
2214
2214
|
| --- | --- | --- |
|
|
2215
2215
|
| <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
2216
|
-
| <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.url">url</a></code> | <code>string</code> |
|
|
2216
|
+
| <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.url">url</a></code> | <code>string</code> | The ALB forwards every path to the container unchanged, so the app only answers under its own `basePath`. |
|
|
2217
2217
|
| <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsBuild">nextjsBuild</a></code> | <code><a href="#cdk-nextjs.NextjsBuild">NextjsBuild</a></code> | *No description.* |
|
|
2218
2218
|
| <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsCache">nextjsCache</a></code> | <code><a href="#cdk-nextjs.NextjsCache">NextjsCache</a></code> | *No description.* |
|
|
2219
2219
|
| <code><a href="#cdk-nextjs.NextjsRegionalContainers.property.nextjsStaticAssets">nextjsStaticAssets</a></code> | <code><a href="#cdk-nextjs.NextjsStaticAssets">NextjsStaticAssets</a></code> | *No description.* |
|
|
@@ -2242,6 +2242,13 @@ public readonly url: string;
|
|
|
2242
2242
|
|
|
2243
2243
|
- *Type:* string
|
|
2244
2244
|
|
|
2245
|
+
The ALB forwards every path to the container unchanged, so the app only answers under its own `basePath`.
|
|
2246
|
+
|
|
2247
|
+
`resolvedBasePath` is deliberately not
|
|
2248
|
+
used here: for this `NextjsType` it only namespaces the S3 bucket and has no
|
|
2249
|
+
routing meaning, whereas the app's own `basePath` is what the container
|
|
2250
|
+
serves from.
|
|
2251
|
+
|
|
2245
2252
|
---
|
|
2246
2253
|
|
|
2247
2254
|
##### `nextjsBuild`<sup>Required</sup> <a name="nextjsBuild" id="cdk-nextjs.NextjsRegionalContainers.property.nextjsBuild"></a>
|
|
@@ -5616,6 +5623,7 @@ const nextjsPostDeployProps: NextjsPostDeployProps = { ... }
|
|
|
5616
5623
|
| <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsPostDeployOverrides">NextjsPostDeployOverrides</a></code> | Override props for every construct. |
|
|
5617
5624
|
| <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.revalidationTable">revalidationTable</a></code> | <code>aws-cdk-lib.aws_dynamodb.ITableV2</code> | DynamoDB table for cleaning up old BUILD_ID prefixed revalidation entries. |
|
|
5618
5625
|
| <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.IBucket</code> | Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`. |
|
|
5626
|
+
| <code><a href="#cdk-nextjs.NextjsPostDeployProps.property.staticAssetsKeyPrefix">staticAssetsKeyPrefix</a></code> | <code>string</code> | S3 key prefix the static assets were uploaded under (`NextjsStaticAssets.keyPrefix`). Scopes pruning to this app's objects, so that apps or branches sharing one bucket under different `basePath`s don't prune each other's assets. |
|
|
5619
5627
|
|
|
5620
5628
|
---
|
|
5621
5629
|
|
|
@@ -5702,6 +5710,18 @@ Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`.
|
|
|
5702
5710
|
|
|
5703
5711
|
---
|
|
5704
5712
|
|
|
5713
|
+
##### `staticAssetsKeyPrefix`<sup>Optional</sup> <a name="staticAssetsKeyPrefix" id="cdk-nextjs.NextjsPostDeployProps.property.staticAssetsKeyPrefix"></a>
|
|
5714
|
+
|
|
5715
|
+
```typescript
|
|
5716
|
+
public readonly staticAssetsKeyPrefix: string;
|
|
5717
|
+
```
|
|
5718
|
+
|
|
5719
|
+
- *Type:* string
|
|
5720
|
+
|
|
5721
|
+
S3 key prefix the static assets were uploaded under (`NextjsStaticAssets.keyPrefix`). Scopes pruning to this app's objects, so that apps or branches sharing one bucket under different `basePath`s don't prune each other's assets.
|
|
5722
|
+
|
|
5723
|
+
---
|
|
5724
|
+
|
|
5705
5725
|
### NextjsRegionalContainersConstructOverrides <a name="NextjsRegionalContainersConstructOverrides" id="cdk-nextjs.NextjsRegionalContainersConstructOverrides"></a>
|
|
5706
5726
|
|
|
5707
5727
|
#### Initializer <a name="Initializer" id="cdk-nextjs.NextjsRegionalContainersConstructOverrides.Initializer"></a>
|
|
@@ -11282,6 +11302,7 @@ const optionalNextjsPostDeployProps: OptionalNextjsPostDeployProps = { ... }
|
|
|
11282
11302
|
| <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | CloudFront Distribution to invalidate. |
|
|
11283
11303
|
| <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.revalidationTable">revalidationTable</a></code> | <code>aws-cdk-lib.aws_dynamodb.ITableV2</code> | DynamoDB table for cleaning up old BUILD_ID prefixed revalidation entries. |
|
|
11284
11304
|
| <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.staticAssetsBucket">staticAssetsBucket</a></code> | <code>aws-cdk-lib.aws_s3.IBucket</code> | Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`. |
|
|
11305
|
+
| <code><a href="#cdk-nextjs.OptionalNextjsPostDeployProps.property.staticAssetsKeyPrefix">staticAssetsKeyPrefix</a></code> | <code>string</code> | S3 key prefix the static assets were uploaded under (`NextjsStaticAssets.keyPrefix`). Scopes pruning to this app's objects, so that apps or branches sharing one bucket under different `basePath`s don't prune each other's assets. |
|
|
11285
11306
|
|
|
11286
11307
|
---
|
|
11287
11308
|
|
|
@@ -11356,6 +11377,18 @@ Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`.
|
|
|
11356
11377
|
|
|
11357
11378
|
---
|
|
11358
11379
|
|
|
11380
|
+
##### `staticAssetsKeyPrefix`<sup>Optional</sup> <a name="staticAssetsKeyPrefix" id="cdk-nextjs.OptionalNextjsPostDeployProps.property.staticAssetsKeyPrefix"></a>
|
|
11381
|
+
|
|
11382
|
+
```typescript
|
|
11383
|
+
public readonly staticAssetsKeyPrefix: string;
|
|
11384
|
+
```
|
|
11385
|
+
|
|
11386
|
+
- *Type:* string
|
|
11387
|
+
|
|
11388
|
+
S3 key prefix the static assets were uploaded under (`NextjsStaticAssets.keyPrefix`). Scopes pruning to this app's objects, so that apps or branches sharing one bucket under different `basePath`s don't prune each other's assets.
|
|
11389
|
+
|
|
11390
|
+
---
|
|
11391
|
+
|
|
11359
11392
|
### OptionalPostDeployCustomResourceProperties <a name="OptionalPostDeployCustomResourceProperties" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties"></a>
|
|
11360
11393
|
|
|
11361
11394
|
OptionalPostDeployCustomResourceProperties.
|
|
@@ -11378,6 +11411,7 @@ const optionalPostDeployCustomResourceProperties: OptionalPostDeployCustomResour
|
|
|
11378
11411
|
| <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.msTtl">msTtl</a></code> | <code>string</code> | Time to live in milliseconds. |
|
|
11379
11412
|
| <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.revalidationTableName">revalidationTableName</a></code> | <code>string</code> | DynamoDB revalidation table name for cleaning up old BUILD_ID prefixed entries. |
|
|
11380
11413
|
| <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.staticAssetsBucketName">staticAssetsBucketName</a></code> | <code>string</code> | *No description.* |
|
|
11414
|
+
| <code><a href="#cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.staticAssetsKeyPrefix">staticAssetsKeyPrefix</a></code> | <code>string</code> | S3 key prefix to scope static asset pruning to. |
|
|
11381
11415
|
|
|
11382
11416
|
---
|
|
11383
11417
|
|
|
@@ -11457,6 +11491,21 @@ public readonly staticAssetsBucketName: string;
|
|
|
11457
11491
|
|
|
11458
11492
|
---
|
|
11459
11493
|
|
|
11494
|
+
##### `staticAssetsKeyPrefix`<sup>Optional</sup> <a name="staticAssetsKeyPrefix" id="cdk-nextjs.OptionalPostDeployCustomResourceProperties.property.staticAssetsKeyPrefix"></a>
|
|
11495
|
+
|
|
11496
|
+
```typescript
|
|
11497
|
+
public readonly staticAssetsKeyPrefix: string;
|
|
11498
|
+
```
|
|
11499
|
+
|
|
11500
|
+
- *Type:* string
|
|
11501
|
+
|
|
11502
|
+
S3 key prefix to scope static asset pruning to.
|
|
11503
|
+
|
|
11504
|
+
Empty or absent prunes the
|
|
11505
|
+
whole bucket.
|
|
11506
|
+
|
|
11507
|
+
---
|
|
11508
|
+
|
|
11460
11509
|
### OptionalS3OriginBucketWithOACProps <a name="OptionalS3OriginBucketWithOACProps" id="cdk-nextjs.OptionalS3OriginBucketWithOACProps"></a>
|
|
11461
11510
|
|
|
11462
11511
|
OptionalS3OriginBucketWithOACProps.
|
|
@@ -12086,6 +12135,7 @@ const postDeployCustomResourceProperties: PostDeployCustomResourceProperties = {
|
|
|
12086
12135
|
| <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.createInvalidationCommandInput">createInvalidationCommandInput</a></code> | <code>{[ key: string ]: any}</code> | *No description.* |
|
|
12087
12136
|
| <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.revalidationTableName">revalidationTableName</a></code> | <code>string</code> | DynamoDB revalidation table name for cleaning up old BUILD_ID prefixed entries. |
|
|
12088
12137
|
| <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.staticAssetsBucketName">staticAssetsBucketName</a></code> | <code>string</code> | *No description.* |
|
|
12138
|
+
| <code><a href="#cdk-nextjs.PostDeployCustomResourceProperties.property.staticAssetsKeyPrefix">staticAssetsKeyPrefix</a></code> | <code>string</code> | S3 key prefix to scope static asset pruning to. |
|
|
12089
12139
|
|
|
12090
12140
|
---
|
|
12091
12141
|
|
|
@@ -12167,6 +12217,21 @@ public readonly staticAssetsBucketName: string;
|
|
|
12167
12217
|
|
|
12168
12218
|
---
|
|
12169
12219
|
|
|
12220
|
+
##### `staticAssetsKeyPrefix`<sup>Optional</sup> <a name="staticAssetsKeyPrefix" id="cdk-nextjs.PostDeployCustomResourceProperties.property.staticAssetsKeyPrefix"></a>
|
|
12221
|
+
|
|
12222
|
+
```typescript
|
|
12223
|
+
public readonly staticAssetsKeyPrefix: string;
|
|
12224
|
+
```
|
|
12225
|
+
|
|
12226
|
+
- *Type:* string
|
|
12227
|
+
|
|
12228
|
+
S3 key prefix to scope static asset pruning to.
|
|
12229
|
+
|
|
12230
|
+
Empty or absent prunes the
|
|
12231
|
+
whole bucket.
|
|
12232
|
+
|
|
12233
|
+
---
|
|
12234
|
+
|
|
12170
12235
|
### PublicDirEntry <a name="PublicDirEntry" id="cdk-nextjs.PublicDirEntry"></a>
|
|
12171
12236
|
|
|
12172
12237
|
#### Initializer <a name="Initializer" id="cdk-nextjs.PublicDirEntry.Initializer"></a>
|
|
@@ -1036,7 +1036,9 @@ var debug3 = (0, import_debug3.default)("cdk-nextjs:post-deploy:prune-s3");
|
|
|
1036
1036
|
var s3Client2 = new import_client_s32.S3Client();
|
|
1037
1037
|
var MAX_CONCURRENT_OPERATIONS = 50;
|
|
1038
1038
|
async function pruneS3(props) {
|
|
1039
|
-
const { bucketName, currentBuildId, msTtl } = props;
|
|
1039
|
+
const { bucketName, currentBuildId, msTtl, keyPrefix } = props;
|
|
1040
|
+
const bare = (keyPrefix || "").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
1041
|
+
const prefix = bare ? `${bare}/` : void 0;
|
|
1040
1042
|
const cutoffDate = new Date(Date.now() - msTtl);
|
|
1041
1043
|
const objectsToDelete = [];
|
|
1042
1044
|
let continuationToken = void 0;
|
|
@@ -1044,7 +1046,8 @@ async function pruneS3(props) {
|
|
|
1044
1046
|
do {
|
|
1045
1047
|
const listObjectsV2Input = {
|
|
1046
1048
|
Bucket: bucketName,
|
|
1047
|
-
ContinuationToken: continuationToken
|
|
1049
|
+
ContinuationToken: continuationToken,
|
|
1050
|
+
Prefix: prefix
|
|
1048
1051
|
};
|
|
1049
1052
|
const listResponse = await s3Client2.send(
|
|
1050
1053
|
new import_client_s32.ListObjectsV2Command(listObjectsV2Input)
|
|
@@ -1084,9 +1087,7 @@ async function pruneS3(props) {
|
|
|
1084
1087
|
objectsToDelete.push(
|
|
1085
1088
|
...checkResults.filter(Boolean)
|
|
1086
1089
|
);
|
|
1087
|
-
|
|
1088
|
-
continuationToken = listResponse.NextContinuationToken;
|
|
1089
|
-
}
|
|
1090
|
+
continuationToken = listResponse.NextContinuationToken;
|
|
1090
1091
|
listObjectsCount++;
|
|
1091
1092
|
} while (continuationToken && listObjectsCount <= 100);
|
|
1092
1093
|
if (objectsToDelete.length > 0) {
|
|
@@ -1163,7 +1164,8 @@ var handler = async (event, context) => {
|
|
|
1163
1164
|
createInvalidationCommandInput,
|
|
1164
1165
|
msTtl,
|
|
1165
1166
|
revalidationTableName,
|
|
1166
|
-
staticAssetsBucketName
|
|
1167
|
+
staticAssetsBucketName,
|
|
1168
|
+
staticAssetsKeyPrefix
|
|
1167
1169
|
} = props;
|
|
1168
1170
|
const promises = [];
|
|
1169
1171
|
if (createInvalidationCommandInput) {
|
|
@@ -1190,7 +1192,8 @@ var handler = async (event, context) => {
|
|
|
1190
1192
|
pruneS3({
|
|
1191
1193
|
bucketName: staticAssetsBucketName,
|
|
1192
1194
|
currentBuildId: buildId,
|
|
1193
|
-
msTtl: parseInt(msTtl)
|
|
1195
|
+
msTtl: parseInt(msTtl),
|
|
1196
|
+
keyPrefix: staticAssetsKeyPrefix
|
|
1194
1197
|
})
|
|
1195
1198
|
);
|
|
1196
1199
|
}
|
package/docs/breaking-changes.md
CHANGED
|
@@ -21,9 +21,10 @@ at synth, and derived from the app where there's only one value that can work.
|
|
|
21
21
|
`basePath` must end with it — either equal to it, or prefixed by the stage or
|
|
22
22
|
base path mapping API Gateway strips (`basePath: "/prod/base"` with the prop
|
|
23
23
|
set to `"/base"`). Anything else throws.
|
|
24
|
-
- `NextjsRegionalContainers`:
|
|
25
|
-
container, which serves its own static assets, so the prop only
|
|
26
|
-
S3 bucket and
|
|
24
|
+
- `NextjsRegionalContainers`: the prop is unconstrained. The ALB forwards every
|
|
25
|
+
path to the container, which serves its own static assets, so the prop only
|
|
26
|
+
namespaces the S3 bucket and can't disagree with the app. Its `url` does
|
|
27
|
+
change, though — see below.
|
|
27
28
|
- Surrounding slashes on the prop are now normalized away, so `"/base"`,
|
|
28
29
|
`"base"` and `"/base/"` all behave identically. Previously the prop was passed
|
|
29
30
|
through to `NextjsDistribution` as written, so a trailing slash produced cache
|
|
@@ -41,6 +42,25 @@ at synth, and derived from the app where there's only one value that can work.
|
|
|
41
42
|
`basePath`, and `NextjsRegionalFunctions.url` reports the custom domain and
|
|
42
43
|
base path mapping when one is configured. All three previously returned a URL
|
|
43
44
|
the app answers with a 404 under these setups.
|
|
45
|
+
- `NextjsRegionalContainers.url` now includes your app's own `basePath` too, for
|
|
46
|
+
the same reason: the ALB forwards the path to the container unchanged, and the
|
|
47
|
+
container only answers under its `basePath`. **If you were appending `basePath`
|
|
48
|
+
to `url` yourself** — in a `CfnOutput`, say — remove that, or the value doubles
|
|
49
|
+
to `http://<alb>/base/base`.
|
|
50
|
+
- `healthCheckPath` is now prefixed with your app's `basePath` before it reaches
|
|
51
|
+
the ALB target group health check, the Lambda Web Adapter readiness check, and
|
|
52
|
+
the container's `wget` probe. Unprefixed, every check 404'd, so the target never
|
|
53
|
+
turned healthy and the deployment rolled back. **If you prefixed
|
|
54
|
+
`healthCheckPath` by hand** to work around that — `"/base/api/health"` on an app
|
|
55
|
+
based at `"/base"` — drop the prefix: the prop is now the path as your app
|
|
56
|
+
routes it, and a prefixed value becomes `/base/base/api/health`, which 404s.
|
|
57
|
+
Left as the default `"/api/health"`, nothing changes for you.
|
|
58
|
+
- Static asset pruning is now scoped to the app's S3 key prefix, so apps or
|
|
59
|
+
branches sharing one bucket under different `basePath`s no longer delete each
|
|
60
|
+
other's assets once they age past `msTtl`. One-time cleanup: **if you are
|
|
61
|
+
adding a `basePath` to an existing deployment**, objects already uploaded under
|
|
62
|
+
the old prefix (the bucket root, usually) are outside the new listing and will
|
|
63
|
+
never be pruned. Delete them yourself once after the first deploy.
|
|
44
64
|
|
|
45
65
|
- **Migration:** If your app sets `basePath` and you deploy a Global construct,
|
|
46
66
|
either drop the `basePath` prop or set it to the same value your app uses. The
|
|
@@ -3,6 +3,11 @@ import type { aws_cloudfront, aws_dynamodb, aws_s3 } from 'aws-cdk-lib';
|
|
|
3
3
|
* OptionalNextjsPostDeployProps
|
|
4
4
|
*/
|
|
5
5
|
export interface OptionalNextjsPostDeployProps {
|
|
6
|
+
/**
|
|
7
|
+
* S3 key prefix the static assets were uploaded under (`NextjsStaticAssets.keyPrefix`). Scopes pruning to this app's objects, so that apps or branches sharing one bucket under different `basePath`s don't prune each other's assets.
|
|
8
|
+
* @stability stable
|
|
9
|
+
*/
|
|
10
|
+
readonly staticAssetsKeyPrefix?: string;
|
|
6
11
|
/**
|
|
7
12
|
* Required for `NextjsType.GlobalFunctions` and `NextjsType.GlobalContainers`.
|
|
8
13
|
* @stability stable
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT3B0aW9uYWxOZXh0anNQb3N0RGVwbG95UHJvcHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ2VuZXJhdGVkLXN0cnVjdHMvT3B0aW9uYWxOZXh0anNQb3N0RGVwbG95UHJvcHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8vIH5+
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT3B0aW9uYWxOZXh0anNQb3N0RGVwbG95UHJvcHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ2VuZXJhdGVkLXN0cnVjdHMvT3B0aW9uYWxOZXh0anNQb3N0RGVwbG95UHJvcHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8vIH5+IEdlbmVyYXRlZCBieSBwcm9qZW4uIFRvIG1vZGlmeSwgZWRpdCAucHJvamVucmMudHMgYW5kIHJ1biBcInBucG0gZGx4IHByb2plblwiLlxuaW1wb3J0IHR5cGUgeyBhd3NfY2xvdWRmcm9udCwgYXdzX2R5bmFtb2RiLCBhd3NfczMgfSBmcm9tICdhd3MtY2RrLWxpYic7XG5cbi8qKlxuICogT3B0aW9uYWxOZXh0anNQb3N0RGVwbG95UHJvcHNcbiAqL1xuZXhwb3J0IGludGVyZmFjZSBPcHRpb25hbE5leHRqc1Bvc3REZXBsb3lQcm9wcyB7XG4gIC8qKlxuICAgKiBTMyBrZXkgcHJlZml4IHRoZSBzdGF0aWMgYXNzZXRzIHdlcmUgdXBsb2FkZWQgdW5kZXIgKGBOZXh0anNTdGF0aWNBc3NldHMua2V5UHJlZml4YCkuIFNjb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VhZG9ubHkgZGVidWc/OiBib29sZWFuO1xuICAvKipcbiAgICogQ2FjaGUgYnVja2V0IGZvciBjbGVhbmluZyB1cCBvbGQgQlVJTERfSUQgcHJlZml4ZWQgb2JqZWN0cy5cbiAgICogQHN0YWJpbGl0eSBzdGFibGVcbiAgICovXG4gIHJlYWRvbmx5IGNhY2hlQnVja2V0PzogYXdzX3MzLklCdWNrZXQ7XG4gIC8qKlxuICAgKiBAc3RhYmlsaXR5IHN0YWJsZVxuICAgKi9cbiAgcmVhZG9ubHkgYnVpbGRJZD86IHN0cmluZztcbn1cbiJdfQ==
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
* OptionalPostDeployCustomResourceProperties
|
|
3
3
|
*/
|
|
4
4
|
export interface OptionalPostDeployCustomResourceProperties {
|
|
5
|
+
/**
|
|
6
|
+
* S3 key prefix to scope static asset pruning to.
|
|
7
|
+
* Empty or absent prunes the
|
|
8
|
+
* whole bucket.
|
|
9
|
+
* @stability stable
|
|
10
|
+
*/
|
|
11
|
+
readonly staticAssetsKeyPrefix?: string;
|
|
5
12
|
/**
|
|
6
13
|
* @stability stable
|
|
7
14
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm dlx projen".
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT3B0aW9uYWxQb3N0RGVwbG95Q3VzdG9tUmVzb3VyY2VQcm9wZXJ0aWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dlbmVyYXRlZC1zdHJ1Y3RzL09wdGlvbmFsUG9zdERlcGxveUN1c3RvbVJlc291cmNlUHJvcGVydGllcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdz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zIGJhc2VkIG9uIG1ldGFkYXRhIGFuZCBgbXNUdGxgXG4gICAqIEBzdGFiaWxpdHkgc3RhYmxlXG4gICAqL1xuICByZWFkb25seSBidWlsZElkPzogc3RyaW5nO1xufVxuIl19
|
|
@@ -25,7 +25,7 @@ const handler = async (event, context) => {
|
|
|
25
25
|
try {
|
|
26
26
|
const props = event.ResourceProperties;
|
|
27
27
|
if (event.RequestType === "Create" || event.RequestType === "Update") {
|
|
28
|
-
const { buildId, cacheBucketName, createInvalidationCommandInput, msTtl, revalidationTableName, staticAssetsBucketName, } = props;
|
|
28
|
+
const { buildId, cacheBucketName, createInvalidationCommandInput, msTtl, revalidationTableName, staticAssetsBucketName, staticAssetsKeyPrefix, } = props;
|
|
29
29
|
const promises = [];
|
|
30
30
|
if (createInvalidationCommandInput) {
|
|
31
31
|
promises.push((0, create_invalidation_1.createInvalidation)(createInvalidationCommandInput));
|
|
@@ -48,6 +48,7 @@ const handler = async (event, context) => {
|
|
|
48
48
|
bucketName: staticAssetsBucketName,
|
|
49
49
|
currentBuildId: buildId,
|
|
50
50
|
msTtl: parseInt(msTtl),
|
|
51
|
+
keyPrefix: staticAssetsKeyPrefix,
|
|
51
52
|
}));
|
|
52
53
|
}
|
|
53
54
|
await Promise.all(promises);
|
|
@@ -70,4 +71,4 @@ const handler = async (event, context) => {
|
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
exports.handler = handler;
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
74
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zdC1kZXBsb3kubGFtYmRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xhbWJkYXMvcG9zdC1kZXBsb3kvcG9zdC1kZXBsb3kubGFtYmRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUNBLGtEQUE2QjtBQUM3QiwrRE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W5kSW5wdXQpIHtcbiAgICAgICAgcHJvbWlzZXMucHVzaChjcmVhdGVJbnZhbGlkYXRpb24oY3JlYXRlSW52YWxpZGF0aW9uQ29tbWFuZElucHV0KSk7XG4gICAgICB9XG4gICAgICBpZiAoY2FjaGVCdWNrZXROYW1lKSB7XG4gICAgICAgIHByb21pc2VzLnB1c2goXG4gICAgICAgICAgcHJ1bmVDYWNoZUJ1Y2tldCh7XG4gICAgICAgICAgICBidWNrZXROYW1lOiBjYWNoZUJ1Y2tldE5hbWUsXG4gICAgICAgICAgICBjdXJyZW50QnVpbGRJZDogYnVpbGRJZCxcbiAgICAgICAgICB9KSxcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICAgIGlmIChyZXZhbGlkYXRpb25UYWJsZU5hbWUpIHtcbiAgICAgICAgcHJvbWlzZXMucHVzaChcbiAgICAgICAgICBwcnVuZVJldmFsaWRhdGlvblRhYmxlKHtcbiAgICAgICAgICAgIHRhYmxlTmFtZTogcmV2YWxpZGF0aW9uVGFibGVOYW1lLFxuICAgICAgICAgICAgY3VycmVudEJ1aWxkSWQ6IGJ1aWxkSWQsXG4gICAgICAgICAgfSksXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICBpZiAoc3RhdGljQXNzZXRzQnVja2V0TmFtZSkge1xuICAgICAgICAvLyB3aWxsIG5vdCBydW4gZm9yIHJlZ2lvbmFsXG4gICAgICAgIHByb21pc2VzLnB1c2goXG4gICAgICAgICAgcHJ1bmVTMyh7XG4gICAgICAgICAgICBidWNrZXROYW1lOiBzdGF0aWNBc3NldHNCdWNrZXROYW1lLFxuICAgICAgICAgICAgY3VycmVudEJ1aWxkSWQ6IGJ1aWxkSWQsXG4gICAgICAgICAgICBtc1R0bDogcGFyc2VJbnQobXNUdGwpLFxuICAgICAgICAgICAga2V5UHJlZml4OiBzdGF0aWNBc3NldHNLZXlQcmVmaXgsXG4gICAgICAgICAgfSksXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICBhd2FpdCBQcm9taXNlLmFsbChwcm9taXNlcyk7XG4gICAgICByZXNwb25zZVN0YXR1cyA9IENmblJlc3BvbnNlU3RhdHVzLlN1Y2Nlc3M7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3BvbnNlU3RhdHVzID0gQ2ZuUmVzcG9uc2VTdGF0dXMuU3VjY2VzcztcbiAgICB9XG4gIH0gY2F0Y2ggKGVycikge1xuICAgIGNvbnNvbGUuZXJyb3IoZXJyKTtcbiAgfSBmaW5hbGx5IHtcbiAgICBhd2FpdCBjZm5SZXNwb25zZSh7XG4gICAgICBldmVudCxcbiAgICAgIGNvbnRleHQsXG4gICAgICByZXNwb25zZVN0YXR1cyxcbiAgICAgIHJlc3BvbnNlRGF0YToge30sXG4gICAgfSk7XG4gIH1cbn07XG4iXX0=
|
|
@@ -5,10 +5,17 @@ interface PruneS3Props {
|
|
|
5
5
|
* Time to live in milliseconds.
|
|
6
6
|
*/
|
|
7
7
|
msTtl: number;
|
|
8
|
+
/**
|
|
9
|
+
* S3 key prefix the app's static assets live under. Surrounding slashes are
|
|
10
|
+
* normalized away. Scopes pruning to this app's objects so that apps or
|
|
11
|
+
* branches sharing one bucket under different `basePath`s don't delete each
|
|
12
|
+
* other's assets. Empty or omitted prunes the whole bucket.
|
|
13
|
+
*/
|
|
14
|
+
keyPrefix?: string;
|
|
8
15
|
}
|
|
9
16
|
/**
|
|
10
|
-
* Given `bucketName`, `currentBuildId`, and `msTtl`, list
|
|
11
|
-
*
|
|
17
|
+
* Given `bucketName`, `currentBuildId`, and `msTtl`, list the objects under
|
|
18
|
+
* `keyPrefix` and delete any that 1/ do not have a metadata key of "next-build-id"
|
|
12
19
|
* and value of `currentBuildId` and 2/ were created more than `msTtl` ago
|
|
13
20
|
*/
|
|
14
21
|
export declare function pruneS3(props: PruneS3Props): Promise<void>;
|