cdk-nextjs 0.7.12 → 0.7.13
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 +237 -81
- package/.jsii.tabl.json +1 -1
- package/API.md +152 -0
- package/README.md +115 -100
- package/docs/breaking-changes.md +4 -2
- package/docs/development-guide.md +10 -0
- package/lib/adapter/adapter.mjs +4 -1
- package/lib/generated-structs/OptionalNextjsDistributionProps.d.ts +21 -0
- package/lib/generated-structs/OptionalNextjsDistributionProps.js +1 -1
- package/lib/nextjs-api.js +1 -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-distribution.d.ts +71 -2
- package/lib/nextjs-distribution.js +156 -107
- package/lib/nextjs-distribution.test.js +361 -12
- package/lib/nextjs-post-deploy.js +1 -1
- package/lib/nextjs-static-assets.js +1 -1
- package/lib/nextjs-static-assets.test.js +19 -7
- package/lib/root-constructs/nextjs-base-construct.js +1 -1
- package/lib/root-constructs/nextjs-global-containers.d.ts +16 -1
- package/lib/root-constructs/nextjs-global-containers.js +4 -2
- package/lib/root-constructs/nextjs-global-functions.d.ts +16 -1
- package/lib/root-constructs/nextjs-global-functions.js +4 -2
- package/lib/root-constructs/nextjs-regional-containers.js +1 -1
- package/lib/root-constructs/nextjs-regional-functions.js +1 -1
- package/lib/runtime/lambda.mjs +4 -1
- package/lib/runtime/server.mjs +4 -1
- package/lib/utils/viewer-request-functions.d.ts +53 -0
- package/lib/utils/viewer-request-functions.js +172 -0
- package/lib/utils/viewer-request-functions.test.d.ts +1 -0
- package/lib/utils/viewer-request-functions.test.js +43 -0
- package/package.json +4 -1
- package/scripts/e2e-harness/app.js +7 -2
- package/scripts/render-diagrams.mjs +121 -0
package/.jsii.tabl.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2","toolVersion":"5.9.67","snippets":{"681da166f7b018ef44eaabfc167936ea0fda6ebec95f01d088df13b3881e009c":{"translations":{"python":{"source":"from next import NextConfig\n\n\nnext_config = {\n # ...\n \"adapter_path\": require.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\", require.Resolve(\"cdk-nextjs/adapter\") }\n};export default nextConfig;","version":"1"},"java":{"source":"import next.NextConfig;\n\n\nNextConfig nextConfig = Map.of(\n // ...\n \"adapterPath\", require.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\": require.resolve(jsii.String(\"cdk-nextjs/adapter\")),\n}export default nextConfig;","version":"1"},"$":{"source":"import { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: require.resolve(\"cdk-nextjs/adapter\"),\n};\n\nexport default nextConfig;","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":62}},"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: require.resolve(\"cdk-nextjs/adapter\"),\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,"244":1,"261":1,"262":1,"273":1,"274":1,"276":1,"277":1,"278":1,"304":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"eea5ab7b39f180dffa5b06407a60a4e7ffb8dfbbad2cc192338c61029f245dc5":{"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 )\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 });\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 .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})\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 });\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":83}},"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 });\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":6,"58":1,"80":25,"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":1,"308":1},"fqnsFingerprint":"204944eee96487676fa960dc8e8ba3535259949e786112a1d8e3856caea9fffd"},"2bbedaf887d0a5ca5cf1bd5b74eb969419424a5c45f9b7e0b591196a72bc19e2":{"translations":{"python":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"2"},"csharp":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"1"},"java":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"1"},"go":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"1"},"$":{"source":"// NextjsGlobalFunctions / NextjsRegionalFunctions\noverrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n},\n\n// NextjsGlobalContainers / NextjsRegionalContainers\noverrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n},","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":110}},"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// NextjsGlobalFunctions / NextjsRegionalFunctions\noverrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}\n\n// NextjsGlobalContainers / NextjsRegionalContainers\noverrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":10,"242":8,"245":2,"257":10},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"7075426c8231aee6566866dad3807893ca8a2ccbd238796591aef619eecea120":{"translations":{"python":{"source":"NextjsGlobalFunctions(self, \"Nextjs\",\n build_directory=join(import.meta.dirname, \"..\", \"web\"),\n function_groups=[{\"name\": \"reports\", \"routes\": [\"/dashboard/reports/**\"]}, {\"name\": \"admin\", \"routes\": [\"/admin\", \"/admin/**\", \"/settings\"]}\n ]\n)","version":"2"},"csharp":{"source":"new NextjsGlobalFunctions(this, \"Nextjs\", new Struct {\n BuildDirectory = Join(import.meta.Dirname, \"..\", \"web\"),\n FunctionGroups = new [] { new Struct { Name = \"reports\", Routes = new [] { \"/dashboard/reports/**\" } }, new Struct { Name = \"admin\", Routes = new [] { \"/admin\", \"/admin/**\", \"/settings\" } } }\n});","version":"1"},"java":{"source":"NextjsGlobalFunctions.Builder.create(this, \"Nextjs\")\n .buildDirectory(join(import.meta.getDirname(), \"..\", \"web\"))\n .functionGroups(List.of(Map.of(\"name\", \"reports\", \"routes\", List.of(\"/dashboard/reports/**\")), Map.of(\"name\", \"admin\", \"routes\", List.of(\"/admin\", \"/admin/**\", \"/settings\"))))\n .build();","version":"1"},"go":{"source":"NewNextjsGlobalFunctions(this, jsii.String(\"Nextjs\"), map[string]interface{}{\n\t\"buildDirectory\": join(import.meta.dirname, jsii.String(\"..\"), jsii.String(\"web\")),\n\t\"functionGroups\": []map[string]interface{}{\n\t\tmap[string]interface{}{\n\t\t\t\"name\": jsii.String(\"reports\"),\n\t\t\t\"routes\": []*string{\n\t\t\t\tjsii.String(\"/dashboard/reports/**\"),\n\t\t\t},\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"name\": jsii.String(\"admin\"),\n\t\t\t\"routes\": []*string{\n\t\t\t\tjsii.String(\"/admin\"),\n\t\t\t\tjsii.String(\"/admin/**\"),\n\t\t\t\tjsii.String(\"/settings\"),\n\t\t\t},\n\t\t},\n\t},\n})","version":"1"},"$":{"source":"new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname, \"..\", \"web\"),\n functionGroups: [\n { name: \"reports\", routes: [\"/dashboard/reports/**\"] },\n { name: \"admin\", routes: [\"/admin\", \"/admin/**\", \"/settings\"] },\n ],\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":317}},"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 NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname, \"..\", \"web\"),\n functionGroups: [\n { name: \"reports\", routes: [\"/dashboard/reports/**\"] },\n { name: \"admin\", routes: [\"/admin\", \"/admin/**\", \"/settings\"] },\n ],\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":9,"80":10,"110":1,"210":3,"211":3,"212":1,"214":1,"215":1,"237":1,"245":1,"304":6},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"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":551}},"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"},"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"},"dae30b62e0775e8f2b2bef7b327b1a796cd98bbdfe61c68dc0dd494fa9227f22":{"translations":{"python":{"source":"\"cdk-nextjs-runtime/server.mjs\"","version":"2"},"csharp":{"source":"\"cdk-nextjs-runtime/server.mjs\";","version":"1"},"java":{"source":"\"cdk-nextjs-runtime/server.mjs\";","version":"1"},"go":{"source":"\"cdk-nextjs-runtime/server.mjs\"","version":"1"},"$":{"source":"\"cdk-nextjs-runtime/server.mjs\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"relativePathToEntrypoint"},"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\"cdk-nextjs-runtime/server.mjs\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":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"},"3dd0c05334d9b64fa88aff18c8531b5f57143eb06669d23e554cbbb9e1e781ec":{"translations":{"python":{"source":"\"/api/health\"","version":"2"},"csharp":{"source":"\"/api/health\";","version":"1"},"java":{"source":"\"/api/health\";","version":"1"},"go":{"source":"\"/api/health\"","version":"1"},"$":{"source":"\"/api/health\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsContainersProps","memberName":"healthCheckPath"},"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\"/api/health\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"c07df70c698f45013b7c8ca5923eb078e454c795d1d377050206e34ebd15c388":{"translations":{"python":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"2"},"csharp":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"1"},"java":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"1"},"go":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"1"},"$":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"0"}},"location":{"api":{"api":"type","fqn":"cdk-nextjs.NextjsFunctionGroup"},"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\nfunctionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"9":1,"11":4,"80":8,"210":3,"211":4,"245":1,"257":1,"304":7},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"983f1c7187f2dd1a6ec187c3a9b2791ed614c7db4fd74fba31538d2b749daa47":{"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.NextjsGlobalContainersProps","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"},"0d636c16f20e1dd752150dc7cccabfdf142caf0c61aeb5f01fdc863cc022e058":{"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.NextjsRegionalContainersProps","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"},"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"},"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.67","snippets":{"681da166f7b018ef44eaabfc167936ea0fda6ebec95f01d088df13b3881e009c":{"translations":{"python":{"source":"from next import NextConfig\n\n\nnext_config = {\n # ...\n \"adapter_path\": require.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\", require.Resolve(\"cdk-nextjs/adapter\") }\n};export default nextConfig;","version":"1"},"java":{"source":"import next.NextConfig;\n\n\nNextConfig nextConfig = Map.of(\n // ...\n \"adapterPath\", require.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\": require.resolve(jsii.String(\"cdk-nextjs/adapter\")),\n}export default nextConfig;","version":"1"},"$":{"source":"import { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n // ...\n adapterPath: require.resolve(\"cdk-nextjs/adapter\"),\n};\n\nexport default nextConfig;","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":73}},"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: require.resolve(\"cdk-nextjs/adapter\"),\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,"244":1,"261":1,"262":1,"273":1,"274":1,"276":1,"277":1,"278":1,"304":1,"308":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"eea5ab7b39f180dffa5b06407a60a4e7ffb8dfbbad2cc192338c61029f245dc5":{"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 )\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 });\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 .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})\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 });\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":94}},"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 });\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":6,"58":1,"80":25,"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":1,"308":1},"fqnsFingerprint":"dddd21a9f363ab837a6e5f55a92a0b66d859a762c270e2d658117e0facae49d1"},"2bbedaf887d0a5ca5cf1bd5b74eb969419424a5c45f9b7e0b591196a72bc19e2":{"translations":{"python":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"2"},"csharp":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"1"},"java":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"1"},"go":{"source":"overrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}overrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}","version":"1"},"$":{"source":"// NextjsGlobalFunctions / NextjsRegionalFunctions\noverrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n},\n\n// NextjsGlobalContainers / NextjsRegionalContainers\noverrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n},","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":149}},"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// NextjsGlobalFunctions / NextjsRegionalFunctions\noverrides: {\n nextjsFunctions: {\n functionProps: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}\n\n// NextjsGlobalContainers / NextjsRegionalContainers\noverrides: {\n nextjsContainers: {\n taskImageOptions: { environment: { CDK_NEXTJS_MEMORY_CACHE_TTL_MS: \"0\" } },\n },\n}\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":2,"80":10,"242":8,"245":2,"257":10},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"7075426c8231aee6566866dad3807893ca8a2ccbd238796591aef619eecea120":{"translations":{"python":{"source":"NextjsGlobalFunctions(self, \"Nextjs\",\n build_directory=join(import.meta.dirname, \"..\", \"web\"),\n function_groups=[{\"name\": \"reports\", \"routes\": [\"/dashboard/reports/**\"]}, {\"name\": \"admin\", \"routes\": [\"/admin\", \"/admin/**\", \"/settings\"]}\n ]\n)","version":"2"},"csharp":{"source":"new NextjsGlobalFunctions(this, \"Nextjs\", new Struct {\n BuildDirectory = Join(import.meta.Dirname, \"..\", \"web\"),\n FunctionGroups = new [] { new Struct { Name = \"reports\", Routes = new [] { \"/dashboard/reports/**\" } }, new Struct { Name = \"admin\", Routes = new [] { \"/admin\", \"/admin/**\", \"/settings\" } } }\n});","version":"1"},"java":{"source":"NextjsGlobalFunctions.Builder.create(this, \"Nextjs\")\n .buildDirectory(join(import.meta.getDirname(), \"..\", \"web\"))\n .functionGroups(List.of(Map.of(\"name\", \"reports\", \"routes\", List.of(\"/dashboard/reports/**\")), Map.of(\"name\", \"admin\", \"routes\", List.of(\"/admin\", \"/admin/**\", \"/settings\"))))\n .build();","version":"1"},"go":{"source":"NewNextjsGlobalFunctions(this, jsii.String(\"Nextjs\"), map[string]interface{}{\n\t\"buildDirectory\": join(import.meta.dirname, jsii.String(\"..\"), jsii.String(\"web\")),\n\t\"functionGroups\": []map[string]interface{}{\n\t\tmap[string]interface{}{\n\t\t\t\"name\": jsii.String(\"reports\"),\n\t\t\t\"routes\": []*string{\n\t\t\t\tjsii.String(\"/dashboard/reports/**\"),\n\t\t\t},\n\t\t},\n\t\tmap[string]interface{}{\n\t\t\t\"name\": jsii.String(\"admin\"),\n\t\t\t\"routes\": []*string{\n\t\t\t\tjsii.String(\"/admin\"),\n\t\t\t\tjsii.String(\"/admin/**\"),\n\t\t\t\tjsii.String(\"/settings\"),\n\t\t\t},\n\t\t},\n\t},\n})","version":"1"},"$":{"source":"new NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname, \"..\", \"web\"),\n functionGroups: [\n { name: \"reports\", routes: [\"/dashboard/reports/**\"] },\n { name: \"admin\", routes: [\"/admin\", \"/admin/**\", \"/settings\"] },\n ],\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":356}},"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 NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname, \"..\", \"web\"),\n functionGroups: [\n { name: \"reports\", routes: [\"/dashboard/reports/**\"] },\n { name: \"admin\", routes: [\"/admin\", \"/admin/**\", \"/settings\"] },\n ],\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":9,"80":10,"110":1,"210":3,"211":3,"212":1,"214":1,"215":1,"237":1,"245":1,"304":6},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"5357d9a89210a324f6bdd5a5f902721a39e74ff7873d8cc0d8ab2c0de83a080f":{"translations":{"python":{"source":"from aws_cdk.aws_cloudfront import FunctionCode, KeyValueStore\n\n\ncredentials = KeyValueStore(self, \"Credentials\")\nNextjsGlobalFunctions(self, \"Nextjs\",\n build_directory=join(import.meta.dirname),\n viewer_request_key_value_store=credentials,\n viewer_request_function_code=FunctionCode.from_inline(\"\"\"\n import cf from \"cloudfront\";\n const kvs = cf.kvs();\n async function viewerRequest(event) {\n const auth = event.request.headers.authorization;\n try {\n if (auth && auth.value === \"Basic \" + (await kvs.get(\"basic-auth\"))) {\n // verified: don't pass the site's credentials on to the origin\n delete event.request.headers.authorization;\n return;\n }\n } catch (e) {\n // no \"basic-auth\" key yet: stay locked\n }\n return {\n statusCode: 401,\n statusDescription: \"Unauthorized\",\n headers: { \"www-authenticate\": { value: 'Basic realm=\"preview\"' } },\n };\n }\n \"\"\")\n)","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.CloudFront;\n\n\nvar credentials = new KeyValueStore(this, \"Credentials\");\nnew NextjsGlobalFunctions(this, \"Nextjs\", new Struct {\n BuildDirectory = Join(import.meta.Dirname),\n ViewerRequestKeyValueStore = credentials,\n ViewerRequestFunctionCode = FunctionCode.FromInline(@\"\n import cf from \"\"cloudfront\"\";\n const kvs = cf.kvs();\n async function viewerRequest(event) {\n const auth = event.request.headers.authorization;\n try {\n if (auth && auth.value === \"\"Basic \"\" + (await kvs.get(\"\"basic-auth\"\"))) {\n // verified: don't pass the site's credentials on to the origin\n delete event.request.headers.authorization;\n return;\n }\n } catch (e) {\n // no \"\"basic-auth\"\" key yet: stay locked\n }\n return {\n statusCode: 401,\n statusDescription: \"\"Unauthorized\"\",\n headers: { \"\"www-authenticate\"\": { value: 'Basic realm=\"\"preview\"\"' } },\n };\n }\n \")\n});","version":"1"},"java":{"source":"import software.amazon.awscdk.services.cloudfront.FunctionCode;\nimport software.amazon.awscdk.services.cloudfront.KeyValueStore;\n\n\nKeyValueStore credentials = new KeyValueStore(this, \"Credentials\");\nNextjsGlobalFunctions.Builder.create(this, \"Nextjs\")\n .buildDirectory(join(import.meta.getDirname()))\n .viewerRequestKeyValueStore(credentials)\n .viewerRequestFunctionCode(FunctionCode.fromInline(\"\\n import cf from \\\"cloudfront\\\";\\n const kvs = cf.kvs();\\n async function viewerRequest(event) {\\n const auth = event.request.headers.authorization;\\n try {\\n if (auth && auth.value === \\\"Basic \\\" + (await kvs.get(\\\"basic-auth\\\"))) {\\n // verified: don't pass the site's credentials on to the origin\\n delete event.request.headers.authorization;\\n return;\\n }\\n } catch (e) {\\n // no \\\"basic-auth\\\" key yet: stay locked\\n }\\n return {\\n statusCode: 401,\\n statusDescription: \\\"Unauthorized\\\",\\n headers: { \\\"www-authenticate\\\": { value: 'Basic realm=\\\"preview\\\"' } },\\n };\\n }\\n \"))\n .build();","version":"1"},"go":{"source":"import \"github.com/aws/aws-cdk-go/awscdk\"\n\n\ncredentials := awscdk.NewKeyValueStore(this, jsii.String(\"Credentials\"))\nNewNextjsGlobalFunctions(this, jsii.String(\"Nextjs\"), map[string]interface{}{\n\t\"buildDirectory\": join(import.meta.dirname),\n\t\"viewerRequestKeyValueStore\": credentials,\n\t\"viewerRequestFunctionCode\": awscdk.FunctionCode_fromInline(jsii.String(`\n\t import cf from \"cloudfront\";\n\t const kvs = cf.kvs();\n\t async function viewerRequest(event) {\n\t const auth = event.request.headers.authorization;\n\t try {\n\t if (auth && auth.value === \"Basic \" + (await kvs.get(\"basic-auth\"))) {\n\t // verified: don't pass the site's credentials on to the origin\n\t delete event.request.headers.authorization;\n\t return;\n\t }\n\t } catch (e) {\n\t // no \"basic-auth\" key yet: stay locked\n\t }\n\t return {\n\t statusCode: 401,\n\t statusDescription: \"Unauthorized\",\n\t headers: { \"www-authenticate\": { value: 'Basic realm=\"preview\"' } },\n\t };\n\t }\n\t `)),\n})","version":"1"},"$":{"source":"import { FunctionCode, KeyValueStore } from \"aws-cdk-lib/aws-cloudfront\";\n\nconst credentials = new KeyValueStore(this, \"Credentials\");\nnew NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n viewerRequestKeyValueStore: credentials,\n viewerRequestFunctionCode: FunctionCode.fromInline(`\n import cf from \"cloudfront\";\n const kvs = cf.kvs();\n async function viewerRequest(event) {\n const auth = event.request.headers.authorization;\n try {\n if (auth && auth.value === \"Basic \" + (await kvs.get(\"basic-auth\"))) {\n // verified: don't pass the site's credentials on to the origin\n delete event.request.headers.authorization;\n return;\n }\n } catch (e) {\n // no \"basic-auth\" key yet: stay locked\n }\n return {\n statusCode: 401,\n statusDescription: \"Unauthorized\",\n headers: { \"www-authenticate\": { value: 'Basic realm=\"preview\"' } },\n };\n }\n `),\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"cdk-nextjs"},"field":{"field":"markdown","line":465}},"didCompile":false,"fqnsReferenced":["aws-cdk-lib.aws_cloudfront.FunctionCode","aws-cdk-lib.aws_cloudfront.FunctionCode#fromInline","aws-cdk-lib.aws_cloudfront.KeyValueStore","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { FunctionCode, KeyValueStore } from \"aws-cdk-lib/aws-cloudfront\";\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 credentials = new KeyValueStore(this, \"Credentials\");\nnew NextjsGlobalFunctions(this, \"Nextjs\", {\n buildDirectory: join(import.meta.dirname),\n viewerRequestKeyValueStore: credentials,\n viewerRequestFunctionCode: FunctionCode.fromInline(`\n import cf from \"cloudfront\";\n const kvs = cf.kvs();\n async function viewerRequest(event) {\n const auth = event.request.headers.authorization;\n try {\n if (auth && auth.value === \"Basic \" + (await kvs.get(\"basic-auth\"))) {\n // verified: don't pass the site's credentials on to the origin\n delete event.request.headers.authorization;\n return;\n }\n } catch (e) {\n // no \"basic-auth\" key yet: stay locked\n }\n return {\n statusCode: 401,\n statusDescription: \"Unauthorized\",\n headers: { \"www-authenticate\": { value: 'Basic realm=\"preview\"' } },\n };\n }\n `),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":3,"15":1,"80":14,"110":2,"211":1,"212":2,"214":2,"215":2,"237":1,"244":1,"245":1,"261":1,"262":1,"273":1,"274":1,"276":1,"277":2,"304":3,"308":1},"fqnsFingerprint":"181b6e9167f049fb4bdd98d3f07c05e817ab09bd2ca9b16a46ffdea53615effc"},"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":566}},"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"},"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"},"dae30b62e0775e8f2b2bef7b327b1a796cd98bbdfe61c68dc0dd494fa9227f22":{"translations":{"python":{"source":"\"cdk-nextjs-runtime/server.mjs\"","version":"2"},"csharp":{"source":"\"cdk-nextjs-runtime/server.mjs\";","version":"1"},"java":{"source":"\"cdk-nextjs-runtime/server.mjs\";","version":"1"},"go":{"source":"\"cdk-nextjs-runtime/server.mjs\"","version":"1"},"$":{"source":"\"cdk-nextjs-runtime/server.mjs\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsBuild","memberName":"relativePathToEntrypoint"},"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\"cdk-nextjs-runtime/server.mjs\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":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"},"3dd0c05334d9b64fa88aff18c8531b5f57143eb06669d23e554cbbb9e1e781ec":{"translations":{"python":{"source":"\"/api/health\"","version":"2"},"csharp":{"source":"\"/api/health\";","version":"1"},"java":{"source":"\"/api/health\";","version":"1"},"go":{"source":"\"/api/health\"","version":"1"},"$":{"source":"\"/api/health\"","version":"0"}},"location":{"api":{"api":"member","fqn":"cdk-nextjs.NextjsContainersProps","memberName":"healthCheckPath"},"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\"/api/health\"\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"11":1,"245":1},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"c07df70c698f45013b7c8ca5923eb078e454c795d1d377050206e34ebd15c388":{"translations":{"python":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"2"},"csharp":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"1"},"java":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"1"},"go":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"1"},"$":{"source":"functionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]","version":"0"}},"location":{"api":{"api":"type","fqn":"cdk-nextjs.NextjsFunctionGroup"},"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\nfunctionGroups: [\n { name: \"reports\", routes: [\"/api/reports/**\"] },\n { name: \"admin\", routes: [\"/admin/**\"], overrides: { functionProps: { memorySize: 3008 } } },\n]\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}","syntaxKindCounter":{"9":1,"11":4,"80":8,"210":3,"211":4,"245":1,"257":1,"304":7},"fqnsFingerprint":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"983f1c7187f2dd1a6ec187c3a9b2791ed614c7db4fd74fba31538d2b749daa47":{"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.NextjsGlobalContainersProps","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"},"0d636c16f20e1dd752150dc7cccabfdf142caf0c61aeb5f01fdc863cc022e058":{"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.NextjsRegionalContainersProps","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"},"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"},"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
|
@@ -4432,6 +4432,8 @@ const nextjsDistributionProps: NextjsDistributionProps = { ... }
|
|
|
4432
4432
|
| <code><a href="#cdk-nextjs.NextjsDistributionProps.property.loadBalancer">loadBalancer</a></code> | <code>aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationLoadBalancer</code> | Required if `NextjsType.GLOBAL_CONTAINERS` or `NextjsType.REGIONAL_CONTAINERS`. |
|
|
4433
4433
|
| <code><a href="#cdk-nextjs.NextjsDistributionProps.property.maxCacheBehaviors">maxCacheBehaviors</a></code> | <code>number</code> | The most cache behaviors the distribution may have, the default one included. |
|
|
4434
4434
|
| <code><a href="#cdk-nextjs.NextjsDistributionProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsDistributionOverrides">NextjsDistributionOverrides</a></code> | Override props for every construct. |
|
|
4435
|
+
| <code><a href="#cdk-nextjs.NextjsDistributionProps.property.viewerRequestFunctionCode">viewerRequestFunctionCode</a></code> | <code>aws-cdk-lib.aws_cloudfront.FunctionCode</code> | CloudFront Function code run first on every viewer request, on every behavior cdk-nextjs adds, static assets included — HTTP Basic auth on a pre-launch site, geo-gating. |
|
|
4436
|
+
| <code><a href="#cdk-nextjs.NextjsDistributionProps.property.viewerRequestKeyValueStore">viewerRequestKeyValueStore</a></code> | <code>aws-cdk-lib.aws_cloudfront.IKeyValueStore</code> | A CloudFront KeyValueStore associated with every viewer-request function {@link viewerRequestFunctionCode} is copied into (up to three, one per kind of behavior), so values it reads — Basic auth credentials, an allowlist — live outside the CloudFormation template and change without a deploy. |
|
|
4435
4437
|
|
|
4436
4438
|
---
|
|
4437
4439
|
|
|
@@ -4620,6 +4622,47 @@ Override props for every construct.
|
|
|
4620
4622
|
|
|
4621
4623
|
---
|
|
4622
4624
|
|
|
4625
|
+
##### `viewerRequestFunctionCode`<sup>Optional</sup> <a name="viewerRequestFunctionCode" id="cdk-nextjs.NextjsDistributionProps.property.viewerRequestFunctionCode"></a>
|
|
4626
|
+
|
|
4627
|
+
```typescript
|
|
4628
|
+
public readonly viewerRequestFunctionCode: FunctionCode;
|
|
4629
|
+
```
|
|
4630
|
+
|
|
4631
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.FunctionCode
|
|
4632
|
+
- *Default:* none
|
|
4633
|
+
|
|
4634
|
+
CloudFront Function code run first on every viewer request, on every behavior cdk-nextjs adds, static assets included — HTTP Basic auth on a pre-launch site, geo-gating.
|
|
4635
|
+
|
|
4636
|
+
It must define `viewerRequest(event)` (a function, sync or async, or a
|
|
4637
|
+
`var`/`let`/`const`): return a response to answer the viewer, or the
|
|
4638
|
+
request (or nothing) to carry on. It is spliced into cdk-nextjs's own
|
|
4639
|
+
viewer-request functions, ahead of their logic, so it may not use the
|
|
4640
|
+
name `handler`, and the combined function must fit CloudFront's 10 KB.
|
|
4641
|
+
It runs on `cloudfront-js-2.0`, so it may be async and read
|
|
4642
|
+
{@link viewerRequestKeyValueStore} with `cf.kvs()`. A bring-your-own
|
|
4643
|
+
{@link distribution}'s default behavior isn't covered.
|
|
4644
|
+
|
|
4645
|
+
> [https://github.com/cdklabs/cdk-nextjs#running-code-on-every-viewer-request](https://github.com/cdklabs/cdk-nextjs#running-code-on-every-viewer-request)
|
|
4646
|
+
|
|
4647
|
+
---
|
|
4648
|
+
|
|
4649
|
+
##### `viewerRequestKeyValueStore`<sup>Optional</sup> <a name="viewerRequestKeyValueStore" id="cdk-nextjs.NextjsDistributionProps.property.viewerRequestKeyValueStore"></a>
|
|
4650
|
+
|
|
4651
|
+
```typescript
|
|
4652
|
+
public readonly viewerRequestKeyValueStore: IKeyValueStore;
|
|
4653
|
+
```
|
|
4654
|
+
|
|
4655
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.IKeyValueStore
|
|
4656
|
+
- *Default:* none
|
|
4657
|
+
|
|
4658
|
+
A CloudFront KeyValueStore associated with every viewer-request function {@link viewerRequestFunctionCode} is copied into (up to three, one per kind of behavior), so values it reads — Basic auth credentials, an allowlist — live outside the CloudFormation template and change without a deploy.
|
|
4659
|
+
|
|
4660
|
+
Read it with `cf.kvs()`, no ID needed.
|
|
4661
|
+
|
|
4662
|
+
> [https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-custom-methods.html](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-custom-methods.html)
|
|
4663
|
+
|
|
4664
|
+
---
|
|
4665
|
+
|
|
4623
4666
|
### NextjsFunctionGroup <a name="NextjsFunctionGroup" id="cdk-nextjs.NextjsFunctionGroup"></a>
|
|
4624
4667
|
|
|
4625
4668
|
A set of routes to package into their own Lambda function.
|
|
@@ -5296,6 +5339,8 @@ const nextjsGlobalContainersProps: NextjsGlobalContainersProps = { ... }
|
|
|
5296
5339
|
| <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.Distribution</code> | Bring your own distribution. |
|
|
5297
5340
|
| <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.ecsCluster">ecsCluster</a></code> | <code>aws-cdk-lib.aws_ecs.ICluster</code> | Bring your own ECS cluster. |
|
|
5298
5341
|
| <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalContainersOverrides">NextjsGlobalContainersOverrides</a></code> | Override props of any construct. |
|
|
5342
|
+
| <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.viewerRequestFunctionCode">viewerRequestFunctionCode</a></code> | <code>aws-cdk-lib.aws_cloudfront.FunctionCode</code> | CloudFront Function code run first on every viewer request, static assets included — HTTP Basic auth on a pre-launch site, say. |
|
|
5343
|
+
| <code><a href="#cdk-nextjs.NextjsGlobalContainersProps.property.viewerRequestKeyValueStore">viewerRequestKeyValueStore</a></code> | <code>aws-cdk-lib.aws_cloudfront.IKeyValueStore</code> | A CloudFront KeyValueStore `viewerRequestFunctionCode` can read with `cf.kvs()`, so credentials stay out of the template. |
|
|
5299
5344
|
|
|
5300
5345
|
---
|
|
5301
5346
|
|
|
@@ -5567,6 +5612,39 @@ Override props of any construct.
|
|
|
5567
5612
|
|
|
5568
5613
|
---
|
|
5569
5614
|
|
|
5615
|
+
##### `viewerRequestFunctionCode`<sup>Optional</sup> <a name="viewerRequestFunctionCode" id="cdk-nextjs.NextjsGlobalContainersProps.property.viewerRequestFunctionCode"></a>
|
|
5616
|
+
|
|
5617
|
+
```typescript
|
|
5618
|
+
public readonly viewerRequestFunctionCode: FunctionCode;
|
|
5619
|
+
```
|
|
5620
|
+
|
|
5621
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.FunctionCode
|
|
5622
|
+
- *Default:* none
|
|
5623
|
+
|
|
5624
|
+
CloudFront Function code run first on every viewer request, static assets included — HTTP Basic auth on a pre-launch site, say.
|
|
5625
|
+
|
|
5626
|
+
It must define
|
|
5627
|
+
`viewerRequest(event)`, as a function or a `var`/`let`/`const`.
|
|
5628
|
+
|
|
5629
|
+
> [NextjsDistributionProps.viewerRequestFunctionCode *](NextjsDistributionProps.viewerRequestFunctionCode *)
|
|
5630
|
+
|
|
5631
|
+
---
|
|
5632
|
+
|
|
5633
|
+
##### `viewerRequestKeyValueStore`<sup>Optional</sup> <a name="viewerRequestKeyValueStore" id="cdk-nextjs.NextjsGlobalContainersProps.property.viewerRequestKeyValueStore"></a>
|
|
5634
|
+
|
|
5635
|
+
```typescript
|
|
5636
|
+
public readonly viewerRequestKeyValueStore: IKeyValueStore;
|
|
5637
|
+
```
|
|
5638
|
+
|
|
5639
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.IKeyValueStore
|
|
5640
|
+
- *Default:* none
|
|
5641
|
+
|
|
5642
|
+
A CloudFront KeyValueStore `viewerRequestFunctionCode` can read with `cf.kvs()`, so credentials stay out of the template.
|
|
5643
|
+
|
|
5644
|
+
> [NextjsDistributionProps.viewerRequestKeyValueStore *](NextjsDistributionProps.viewerRequestKeyValueStore *)
|
|
5645
|
+
|
|
5646
|
+
---
|
|
5647
|
+
|
|
5570
5648
|
### NextjsGlobalFunctionsConstructOverrides <a name="NextjsGlobalFunctionsConstructOverrides" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides"></a>
|
|
5571
5649
|
|
|
5572
5650
|
#### Initializer <a name="Initializer" id="cdk-nextjs.NextjsGlobalFunctionsConstructOverrides.Initializer"></a>
|
|
@@ -5753,6 +5831,8 @@ const nextjsGlobalFunctionsProps: NextjsGlobalFunctionsProps = { ... }
|
|
|
5753
5831
|
| <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.Distribution</code> | Bring your own distribution. |
|
|
5754
5832
|
| <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.functionGroups">functionGroups</a></code> | <code><a href="#cdk-nextjs.NextjsFunctionGroup">NextjsFunctionGroup</a>[]</code> | Package sets of routes into separate Lambda functions, each fronted by its own CloudFront behaviors. |
|
|
5755
5833
|
| <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.overrides">overrides</a></code> | <code><a href="#cdk-nextjs.NextjsGlobalFunctionsOverrides">NextjsGlobalFunctionsOverrides</a></code> | Override props of any construct. |
|
|
5834
|
+
| <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.viewerRequestFunctionCode">viewerRequestFunctionCode</a></code> | <code>aws-cdk-lib.aws_cloudfront.FunctionCode</code> | CloudFront Function code run first on every viewer request, static assets included — HTTP Basic auth on a pre-launch site, say. |
|
|
5835
|
+
| <code><a href="#cdk-nextjs.NextjsGlobalFunctionsProps.property.viewerRequestKeyValueStore">viewerRequestKeyValueStore</a></code> | <code>aws-cdk-lib.aws_cloudfront.IKeyValueStore</code> | A CloudFront KeyValueStore `viewerRequestFunctionCode` can read with `cf.kvs()`, so credentials stay out of the template. |
|
|
5756
5836
|
|
|
5757
5837
|
---
|
|
5758
5838
|
|
|
@@ -5982,6 +6062,39 @@ Override props of any construct.
|
|
|
5982
6062
|
|
|
5983
6063
|
---
|
|
5984
6064
|
|
|
6065
|
+
##### `viewerRequestFunctionCode`<sup>Optional</sup> <a name="viewerRequestFunctionCode" id="cdk-nextjs.NextjsGlobalFunctionsProps.property.viewerRequestFunctionCode"></a>
|
|
6066
|
+
|
|
6067
|
+
```typescript
|
|
6068
|
+
public readonly viewerRequestFunctionCode: FunctionCode;
|
|
6069
|
+
```
|
|
6070
|
+
|
|
6071
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.FunctionCode
|
|
6072
|
+
- *Default:* none
|
|
6073
|
+
|
|
6074
|
+
CloudFront Function code run first on every viewer request, static assets included — HTTP Basic auth on a pre-launch site, say.
|
|
6075
|
+
|
|
6076
|
+
It must define
|
|
6077
|
+
`viewerRequest(event)`, as a function or a `var`/`let`/`const`.
|
|
6078
|
+
|
|
6079
|
+
> [NextjsDistributionProps.viewerRequestFunctionCode *](NextjsDistributionProps.viewerRequestFunctionCode *)
|
|
6080
|
+
|
|
6081
|
+
---
|
|
6082
|
+
|
|
6083
|
+
##### `viewerRequestKeyValueStore`<sup>Optional</sup> <a name="viewerRequestKeyValueStore" id="cdk-nextjs.NextjsGlobalFunctionsProps.property.viewerRequestKeyValueStore"></a>
|
|
6084
|
+
|
|
6085
|
+
```typescript
|
|
6086
|
+
public readonly viewerRequestKeyValueStore: IKeyValueStore;
|
|
6087
|
+
```
|
|
6088
|
+
|
|
6089
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.IKeyValueStore
|
|
6090
|
+
- *Default:* none
|
|
6091
|
+
|
|
6092
|
+
A CloudFront KeyValueStore `viewerRequestFunctionCode` can read with `cf.kvs()`, so credentials stay out of the template.
|
|
6093
|
+
|
|
6094
|
+
> [NextjsDistributionProps.viewerRequestKeyValueStore *](NextjsDistributionProps.viewerRequestKeyValueStore *)
|
|
6095
|
+
|
|
6096
|
+
---
|
|
6097
|
+
|
|
5985
6098
|
### NextjsPostDeployOverrides <a name="NextjsPostDeployOverrides" id="cdk-nextjs.NextjsPostDeployOverrides"></a>
|
|
5986
6099
|
|
|
5987
6100
|
#### Initializer <a name="Initializer" id="cdk-nextjs.NextjsPostDeployOverrides.Initializer"></a>
|
|
@@ -10918,6 +11031,8 @@ const optionalNextjsDistributionProps: OptionalNextjsDistributionProps = { ... }
|
|
|
10918
11031
|
| <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.maxCacheBehaviors">maxCacheBehaviors</a></code> | <code>number</code> | The most cache behaviors the distribution may have, the default one included. |
|
|
10919
11032
|
| <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.nextjsType">nextjsType</a></code> | <code><a href="#cdk-nextjs.NextjsType">NextjsType</a></code> | *No description.* |
|
|
10920
11033
|
| <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.publicDirEntries">publicDirEntries</a></code> | <code><a href="#cdk-nextjs.PublicDirEntry">PublicDirEntry</a>[]</code> | Entries (files/directories) within Next.js app's public directory. Used to add static behaviors to distribution. |
|
|
11034
|
+
| <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.viewerRequestFunctionCode">viewerRequestFunctionCode</a></code> | <code>aws-cdk-lib.aws_cloudfront.FunctionCode</code> | CloudFront Function code run first on every viewer request, on every behavior cdk-nextjs adds, static assets included — HTTP Basic auth on a pre-launch site, geo-gating. |
|
|
11035
|
+
| <code><a href="#cdk-nextjs.OptionalNextjsDistributionProps.property.viewerRequestKeyValueStore">viewerRequestKeyValueStore</a></code> | <code>aws-cdk-lib.aws_cloudfront.IKeyValueStore</code> | A CloudFront KeyValueStore associated with every viewer-request function {@link viewerRequestFunctionCode} is copied into (up to three, one per kind of behavior), so values it reads — Basic auth credentials, an allowlist — live outside the CloudFormation template and change without a deploy. |
|
|
10921
11036
|
|
|
10922
11037
|
---
|
|
10923
11038
|
|
|
@@ -11066,6 +11181,43 @@ Entries (files/directories) within Next.js app's public directory. Used to add s
|
|
|
11066
11181
|
|
|
11067
11182
|
---
|
|
11068
11183
|
|
|
11184
|
+
##### `viewerRequestFunctionCode`<sup>Optional</sup> <a name="viewerRequestFunctionCode" id="cdk-nextjs.OptionalNextjsDistributionProps.property.viewerRequestFunctionCode"></a>
|
|
11185
|
+
|
|
11186
|
+
```typescript
|
|
11187
|
+
public readonly viewerRequestFunctionCode: FunctionCode;
|
|
11188
|
+
```
|
|
11189
|
+
|
|
11190
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.FunctionCode
|
|
11191
|
+
- *Default:* none
|
|
11192
|
+
|
|
11193
|
+
CloudFront Function code run first on every viewer request, on every behavior cdk-nextjs adds, static assets included — HTTP Basic auth on a pre-launch site, geo-gating.
|
|
11194
|
+
|
|
11195
|
+
It must define `viewerRequest(event)` (a function, sync or async, or a
|
|
11196
|
+
`var`/`let`/`const`): return a response to answer the viewer, or the
|
|
11197
|
+
request (or nothing) to carry on. It is spliced into cdk-nextjs's own
|
|
11198
|
+
viewer-request functions, ahead of their logic, so it may not use the
|
|
11199
|
+
name `handler`, and the combined function must fit CloudFront's 10 KB.
|
|
11200
|
+
It runs on `cloudfront-js-2.0`, so it may be async and read
|
|
11201
|
+
{@link viewerRequestKeyValueStore} with `cf.kvs()`. A bring-your-own
|
|
11202
|
+
{@link distribution}'s default behavior isn't covered.
|
|
11203
|
+
|
|
11204
|
+
---
|
|
11205
|
+
|
|
11206
|
+
##### `viewerRequestKeyValueStore`<sup>Optional</sup> <a name="viewerRequestKeyValueStore" id="cdk-nextjs.OptionalNextjsDistributionProps.property.viewerRequestKeyValueStore"></a>
|
|
11207
|
+
|
|
11208
|
+
```typescript
|
|
11209
|
+
public readonly viewerRequestKeyValueStore: IKeyValueStore;
|
|
11210
|
+
```
|
|
11211
|
+
|
|
11212
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.IKeyValueStore
|
|
11213
|
+
- *Default:* none
|
|
11214
|
+
|
|
11215
|
+
A CloudFront KeyValueStore associated with every viewer-request function {@link viewerRequestFunctionCode} is copied into (up to three, one per kind of behavior), so values it reads — Basic auth credentials, an allowlist — live outside the CloudFormation template and change without a deploy.
|
|
11216
|
+
|
|
11217
|
+
Read it with `cf.kvs()`, no ID needed.
|
|
11218
|
+
|
|
11219
|
+
---
|
|
11220
|
+
|
|
11069
11221
|
### OptionalNextjsPostDeployProps <a name="OptionalNextjsPostDeployProps" id="cdk-nextjs.OptionalNextjsPostDeployProps"></a>
|
|
11070
11222
|
|
|
11071
11223
|
OptionalNextjsPostDeployProps.
|