aws-cdk 0.0.0
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/CONTRIBUTING.md +276 -0
- package/LICENSE +202 -0
- package/NOTICE +16 -0
- package/README.md +1274 -0
- package/THIRD_PARTY_LICENSES +26821 -0
- package/bin/cdk +6 -0
- package/build-info.json +4 -0
- package/db.json.gz +0 -0
- package/generate.sh +25 -0
- package/images/garbage-collection.png +0 -0
- package/lib/api/aws-auth/account-cache.d.ts +39 -0
- package/lib/api/aws-auth/account-cache.js +102 -0
- package/lib/api/aws-auth/awscli-compatible.d.ts +42 -0
- package/lib/api/aws-auth/awscli-compatible.js +264 -0
- package/lib/api/aws-auth/cached.d.ts +11 -0
- package/lib/api/aws-auth/cached.js +26 -0
- package/lib/api/aws-auth/credential-plugins.d.ts +36 -0
- package/lib/api/aws-auth/credential-plugins.js +153 -0
- package/lib/api/aws-auth/index.d.ts +3 -0
- package/lib/api/aws-auth/index.js +20 -0
- package/lib/api/aws-auth/provider-caching.d.ts +13 -0
- package/lib/api/aws-auth/provider-caching.js +24 -0
- package/lib/api/aws-auth/sdk-logger.d.ts +69 -0
- package/lib/api/aws-auth/sdk-logger.js +130 -0
- package/lib/api/aws-auth/sdk-provider.d.ts +207 -0
- package/lib/api/aws-auth/sdk-provider.js +359 -0
- package/lib/api/aws-auth/sdk.d.ts +223 -0
- package/lib/api/aws-auth/sdk.js +366 -0
- package/lib/api/aws-auth/tracing.d.ts +11 -0
- package/lib/api/aws-auth/tracing.js +61 -0
- package/lib/api/aws-auth/user-agent.d.ts +7 -0
- package/lib/api/aws-auth/user-agent.js +21 -0
- package/lib/api/aws-auth/util.d.ts +6 -0
- package/lib/api/aws-auth/util.js +23 -0
- package/lib/api/bootstrap/bootstrap-environment.d.ts +33 -0
- package/lib/api/bootstrap/bootstrap-environment.js +322 -0
- package/lib/api/bootstrap/bootstrap-props.d.ts +130 -0
- package/lib/api/bootstrap/bootstrap-props.js +14 -0
- package/lib/api/bootstrap/bootstrap-template.yaml +692 -0
- package/lib/api/bootstrap/deploy-bootstrap.d.ts +37 -0
- package/lib/api/bootstrap/deploy-bootstrap.js +143 -0
- package/lib/api/bootstrap/index.d.ts +2 -0
- package/lib/api/bootstrap/index.js +19 -0
- package/lib/api/bootstrap/legacy-template.d.ts +2 -0
- package/lib/api/bootstrap/legacy-template.js +82 -0
- package/lib/api/context.d.ts +40 -0
- package/lib/api/context.js +82 -0
- package/lib/api/cxapp/cloud-assembly.d.ts +150 -0
- package/lib/api/cxapp/cloud-assembly.js +305 -0
- package/lib/api/cxapp/cloud-executable.d.ts +44 -0
- package/lib/api/cxapp/cloud-executable.js +90 -0
- package/lib/api/cxapp/environments.d.ts +9 -0
- package/lib/api/cxapp/environments.js +66 -0
- package/lib/api/cxapp/exec.d.ts +56 -0
- package/lib/api/cxapp/exec.js +275 -0
- package/lib/api/deployments/asset-manifest-builder.d.ts +8 -0
- package/lib/api/deployments/asset-manifest-builder.js +35 -0
- package/lib/api/deployments/asset-publishing.d.ts +77 -0
- package/lib/api/deployments/asset-publishing.js +163 -0
- package/lib/api/deployments/assets.d.ts +10 -0
- package/lib/api/deployments/assets.js +111 -0
- package/lib/api/deployments/checks.d.ts +8 -0
- package/lib/api/deployments/checks.js +73 -0
- package/lib/api/deployments/cloudformation.d.ts +235 -0
- package/lib/api/deployments/cloudformation.js +598 -0
- package/lib/api/deployments/deploy-stack.d.ts +177 -0
- package/lib/api/deployments/deploy-stack.js +484 -0
- package/lib/api/deployments/deployment-method.d.ts +24 -0
- package/lib/api/deployments/deployment-method.js +3 -0
- package/lib/api/deployments/deployment-result.d.ts +21 -0
- package/lib/api/deployments/deployment-result.js +10 -0
- package/lib/api/deployments/deployments.d.ts +340 -0
- package/lib/api/deployments/deployments.js +369 -0
- package/lib/api/deployments/hotswap-deployments.d.ts +14 -0
- package/lib/api/deployments/hotswap-deployments.js +357 -0
- package/lib/api/deployments/index.d.ts +6 -0
- package/lib/api/deployments/index.js +23 -0
- package/lib/api/deployments/nested-stack-helpers.d.ts +25 -0
- package/lib/api/deployments/nested-stack-helpers.js +88 -0
- package/lib/api/environment-access.d.ts +138 -0
- package/lib/api/environment-access.js +203 -0
- package/lib/api/environment-resources.d.ts +73 -0
- package/lib/api/environment-resources.js +208 -0
- package/lib/api/evaluate-cloudformation-template.d.ts +84 -0
- package/lib/api/evaluate-cloudformation-template.js +443 -0
- package/lib/api/garbage-collection/garbage-collector.d.ts +152 -0
- package/lib/api/garbage-collection/garbage-collector.js +607 -0
- package/lib/api/garbage-collection/progress-printer.d.ts +21 -0
- package/lib/api/garbage-collection/progress-printer.js +69 -0
- package/lib/api/garbage-collection/stack-refresh.d.ts +44 -0
- package/lib/api/garbage-collection/stack-refresh.js +154 -0
- package/lib/api/hotswap/appsync-mapping-templates.d.ts +3 -0
- package/lib/api/hotswap/appsync-mapping-templates.js +157 -0
- package/lib/api/hotswap/code-build-projects.d.ts +3 -0
- package/lib/api/hotswap/code-build-projects.js +55 -0
- package/lib/api/hotswap/common.d.ts +126 -0
- package/lib/api/hotswap/common.js +170 -0
- package/lib/api/hotswap/ecs-services.d.ts +3 -0
- package/lib/api/hotswap/ecs-services.js +140 -0
- package/lib/api/hotswap/lambda-functions.d.ts +3 -0
- package/lib/api/hotswap/lambda-functions.js +309 -0
- package/lib/api/hotswap/s3-bucket-deployments.d.ts +9 -0
- package/lib/api/hotswap/s3-bucket-deployments.js +112 -0
- package/lib/api/hotswap/stepfunctions-state-machines.d.ts +3 -0
- package/lib/api/hotswap/stepfunctions-state-machines.js +42 -0
- package/lib/api/index.d.ts +5 -0
- package/lib/api/index.js +22 -0
- package/lib/api/logs/find-cloudwatch-logs.d.ts +24 -0
- package/lib/api/logs/find-cloudwatch-logs.js +97 -0
- package/lib/api/logs/logs-monitor.d.ts +53 -0
- package/lib/api/logs/logs-monitor.js +169 -0
- package/lib/api/plugin/context-provider-plugin.d.ts +6 -0
- package/lib/api/plugin/context-provider-plugin.js +7 -0
- package/lib/api/plugin/index.d.ts +3 -0
- package/lib/api/plugin/index.js +20 -0
- package/lib/api/plugin/mode.d.ts +4 -0
- package/lib/api/plugin/mode.js +9 -0
- package/lib/api/plugin/plugin.d.ts +63 -0
- package/lib/api/plugin/plugin.js +106 -0
- package/lib/api/settings.d.ts +29 -0
- package/lib/api/settings.js +141 -0
- package/lib/api/tags.d.ts +9 -0
- package/lib/api/tags.js +10 -0
- package/lib/api/toolkit-info.d.ts +51 -0
- package/lib/api/toolkit-info.js +156 -0
- package/lib/api/util/cloudformation/stack-activity-monitor.d.ts +237 -0
- package/lib/api/util/cloudformation/stack-activity-monitor.js +550 -0
- package/lib/api/util/cloudformation/stack-event-poller.d.ts +63 -0
- package/lib/api/util/cloudformation/stack-event-poller.js +129 -0
- package/lib/api/util/cloudformation/stack-status.d.ts +42 -0
- package/lib/api/util/cloudformation/stack-status.js +88 -0
- package/lib/api/util/display.d.ts +13 -0
- package/lib/api/util/display.js +80 -0
- package/lib/api/util/placeholders.d.ts +10 -0
- package/lib/api/util/placeholders.js +24 -0
- package/lib/api/util/rwlock.d.ts +65 -0
- package/lib/api/util/rwlock.js +179 -0
- package/lib/api/util/string-manipulation.d.ts +10 -0
- package/lib/api/util/string-manipulation.js +33 -0
- package/lib/api/util/template-body-parameter.d.ts +21 -0
- package/lib/api/util/template-body-parameter.js +104 -0
- package/lib/cli/cdk-toolkit.d.ts +594 -0
- package/lib/cli/cdk-toolkit.js +1019 -0
- package/lib/cli/cli-config.d.ts +10 -0
- package/lib/cli/cli-config.js +406 -0
- package/lib/cli/cli.d.ts +4 -0
- package/lib/cli/cli.js +538 -0
- package/lib/cli/convert-to-user-input.d.ts +3 -0
- package/lib/cli/convert-to-user-input.js +434 -0
- package/lib/cli/parse-command-line-arguments.d.ts +1 -0
- package/lib/cli/parse-command-line-arguments.js +806 -0
- package/lib/cli/platform-warnings.d.ts +2 -0
- package/lib/cli/platform-warnings.js +45 -0
- package/lib/cli/user-configuration.d.ts +90 -0
- package/lib/cli/user-configuration.js +272 -0
- package/lib/cli/user-input.d.ts +1163 -0
- package/lib/cli/user-input.js +3 -0
- package/lib/cli/util/console-formatters.d.ts +18 -0
- package/lib/cli/util/console-formatters.js +42 -0
- package/lib/cli/util/npm.d.ts +1 -0
- package/lib/cli/util/npm.js +22 -0
- package/lib/cli/util/yargs-helpers.d.ts +22 -0
- package/lib/cli/util/yargs-helpers.js +49 -0
- package/lib/cli/version.d.ts +13 -0
- package/lib/cli/version.js +120 -0
- package/lib/commands/context.d.ts +35 -0
- package/lib/commands/context.js +156 -0
- package/lib/commands/docs.d.ts +13 -0
- package/lib/commands/docs.js +32 -0
- package/lib/commands/doctor.d.ts +1 -0
- package/lib/commands/doctor.js +69 -0
- package/lib/commands/migrate.d.ts +327 -0
- package/lib/commands/migrate.js +804 -0
- package/lib/context-providers/ami.d.ts +11 -0
- package/lib/context-providers/ami.js +50 -0
- package/lib/context-providers/availability-zones.d.ts +11 -0
- package/lib/context-providers/availability-zones.js +27 -0
- package/lib/context-providers/endpoint-service-availability-zones.d.ts +11 -0
- package/lib/context-providers/endpoint-service-availability-zones.js +33 -0
- package/lib/context-providers/hosted-zones.d.ts +10 -0
- package/lib/context-providers/hosted-zones.js +67 -0
- package/lib/context-providers/index.d.ts +30 -0
- package/lib/context-providers/index.js +109 -0
- package/lib/context-providers/keys.d.ts +11 -0
- package/lib/context-providers/keys.js +52 -0
- package/lib/context-providers/load-balancers.d.ts +20 -0
- package/lib/context-providers/load-balancers.js +159 -0
- package/lib/context-providers/security-groups.d.ts +9 -0
- package/lib/context-providers/security-groups.js +70 -0
- package/lib/context-providers/ssm-parameters.d.ts +23 -0
- package/lib/context-providers/ssm-parameters.js +59 -0
- package/lib/context-providers/vpcs.d.ts +11 -0
- package/lib/context-providers/vpcs.js +288 -0
- package/lib/diff.d.ts +28 -0
- package/lib/diff.js +165 -0
- package/lib/import.d.ts +182 -0
- package/lib/import.js +335 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +348304 -0
- package/lib/index_bg.wasm +0 -0
- package/lib/init-hooks.d.ts +40 -0
- package/lib/init-hooks.js +64 -0
- package/lib/init-templates/.init-version.json +1 -0
- package/lib/init-templates/.no-packagejson-validator +0 -0
- package/lib/init-templates/.recommended-feature-flags.json +68 -0
- package/lib/init-templates/LICENSE +16 -0
- package/lib/init-templates/app/csharp/.template.gitignore +342 -0
- package/lib/init-templates/app/csharp/README.md +14 -0
- package/lib/init-templates/app/csharp/cdk.template.json +15 -0
- package/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +20 -0
- package/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +13 -0
- package/lib/init-templates/app/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +1 -0
- package/lib/init-templates/app/csharp/src/%name.PascalCased%/Program.template.cs +44 -0
- package/lib/init-templates/app/csharp/src/%name.PascalCased%.template.sln +18 -0
- package/lib/init-templates/app/fsharp/.template.gitignore +342 -0
- package/lib/init-templates/app/fsharp/README.md +18 -0
- package/lib/init-templates/app/fsharp/cdk.template.json +14 -0
- package/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +25 -0
- package/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +8 -0
- package/lib/init-templates/app/fsharp/src/%name.PascalCased%/Program.template.fs +11 -0
- package/lib/init-templates/app/fsharp/src/%name.PascalCased%.template.sln +18 -0
- package/lib/init-templates/app/go/%name%.template.go +70 -0
- package/lib/init-templates/app/go/%name%_test.template.go +26 -0
- package/lib/init-templates/app/go/.template.gitignore +19 -0
- package/lib/init-templates/app/go/README.md +12 -0
- package/lib/init-templates/app/go/cdk.template.json +13 -0
- package/lib/init-templates/app/go/go.template.mod +9 -0
- package/lib/init-templates/app/info.json +4 -0
- package/lib/init-templates/app/java/.template.gitignore +13 -0
- package/lib/init-templates/app/java/README.md +18 -0
- package/lib/init-templates/app/java/cdk.json +13 -0
- package/lib/init-templates/app/java/pom.xml +60 -0
- package/lib/init-templates/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +42 -0
- package/lib/init-templates/app/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +24 -0
- package/lib/init-templates/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java +26 -0
- package/lib/init-templates/app/javascript/.template.gitignore +5 -0
- package/lib/init-templates/app/javascript/.template.npmignore +3 -0
- package/lib/init-templates/app/javascript/README.md +12 -0
- package/lib/init-templates/app/javascript/bin/%name%.template.js +21 -0
- package/lib/init-templates/app/javascript/cdk.template.json +15 -0
- package/lib/init-templates/app/javascript/jest.config.js +3 -0
- package/lib/init-templates/app/javascript/lib/%name%-stack.template.js +23 -0
- package/lib/init-templates/app/javascript/package.json +20 -0
- package/lib/init-templates/app/javascript/test/%name%.test.template.js +17 -0
- package/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +19 -0
- package/lib/init-templates/app/python/%name.PythonModule%/__init__.py +0 -0
- package/lib/init-templates/app/python/.template.gitignore +10 -0
- package/lib/init-templates/app/python/README.template.md +58 -0
- package/lib/init-templates/app/python/app.template.py +28 -0
- package/lib/init-templates/app/python/cdk.template.json +15 -0
- package/lib/init-templates/app/python/requirements-dev.txt +1 -0
- package/lib/init-templates/app/python/requirements.txt +2 -0
- package/lib/init-templates/app/python/source.bat +13 -0
- package/lib/init-templates/app/python/tests/__init__.py +0 -0
- package/lib/init-templates/app/python/tests/unit/__init__.py +0 -0
- package/lib/init-templates/app/python/tests/unit/test_%name.PythonModule%_stack.template.py +15 -0
- package/lib/init-templates/app/typescript/.template.gitignore +8 -0
- package/lib/init-templates/app/typescript/.template.npmignore +6 -0
- package/lib/init-templates/app/typescript/README.md +14 -0
- package/lib/init-templates/app/typescript/bin/%name%.template.ts +20 -0
- package/lib/init-templates/app/typescript/cdk.template.json +17 -0
- package/lib/init-templates/app/typescript/jest.config.js +8 -0
- package/lib/init-templates/app/typescript/lib/%name%-stack.template.ts +16 -0
- package/lib/init-templates/app/typescript/package.json +26 -0
- package/lib/init-templates/app/typescript/test/%name%.test.template.ts +17 -0
- package/lib/init-templates/app/typescript/tsconfig.json +31 -0
- package/lib/init-templates/lib/info.json +4 -0
- package/lib/init-templates/lib/typescript/.template.gitignore +8 -0
- package/lib/init-templates/lib/typescript/.template.npmignore +6 -0
- package/lib/init-templates/lib/typescript/README.template.md +12 -0
- package/lib/init-templates/lib/typescript/jest.config.js +8 -0
- package/lib/init-templates/lib/typescript/lib/index.template.ts +21 -0
- package/lib/init-templates/lib/typescript/package.json +24 -0
- package/lib/init-templates/lib/typescript/test/%name%.test.template.ts +18 -0
- package/lib/init-templates/lib/typescript/tsconfig.json +31 -0
- package/lib/init-templates/sample-app/csharp/.template.gitignore +342 -0
- package/lib/init-templates/sample-app/csharp/README.template.md +19 -0
- package/lib/init-templates/sample-app/csharp/cdk.template.json +15 -0
- package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +20 -0
- package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +24 -0
- package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +1 -0
- package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/Program.template.cs +15 -0
- package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%.template.sln +18 -0
- package/lib/init-templates/sample-app/fsharp/.template.gitignore +342 -0
- package/lib/init-templates/sample-app/fsharp/README.template.md +20 -0
- package/lib/init-templates/sample-app/fsharp/cdk.template.json +14 -0
- package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +25 -0
- package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +14 -0
- package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs +11 -0
- package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%.template.sln +18 -0
- package/lib/init-templates/sample-app/go/%name%.template.go +73 -0
- package/lib/init-templates/sample-app/go/%name%_test.template.go +25 -0
- package/lib/init-templates/sample-app/go/.template.gitignore +19 -0
- package/lib/init-templates/sample-app/go/README.md +12 -0
- package/lib/init-templates/sample-app/go/cdk.template.json +13 -0
- package/lib/init-templates/sample-app/go/go.template.mod +9 -0
- package/lib/init-templates/sample-app/info.json +4 -0
- package/lib/init-templates/sample-app/java/.template.gitignore +13 -0
- package/lib/init-templates/sample-app/java/README.template.md +19 -0
- package/lib/init-templates/sample-app/java/cdk.json +13 -0
- package/lib/init-templates/sample-app/java/pom.xml +55 -0
- package/lib/init-templates/sample-app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +13 -0
- package/lib/init-templates/sample-app/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +29 -0
- package/lib/init-templates/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java +27 -0
- package/lib/init-templates/sample-app/javascript/.template.gitignore +5 -0
- package/lib/init-templates/sample-app/javascript/.template.npmignore +3 -0
- package/lib/init-templates/sample-app/javascript/README.template.md +13 -0
- package/lib/init-templates/sample-app/javascript/bin/%name%.template.js +6 -0
- package/lib/init-templates/sample-app/javascript/cdk.template.json +15 -0
- package/lib/init-templates/sample-app/javascript/jest.config.js +3 -0
- package/lib/init-templates/sample-app/javascript/lib/%name%-stack.template.js +25 -0
- package/lib/init-templates/sample-app/javascript/package.json +20 -0
- package/lib/init-templates/sample-app/javascript/test/%name%.test.template.js +16 -0
- package/lib/init-templates/sample-app/javascript/tsconfig.json +34 -0
- package/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +26 -0
- package/lib/init-templates/sample-app/python/%name.PythonModule%/__init__.py +0 -0
- package/lib/init-templates/sample-app/python/.template.gitignore +22 -0
- package/lib/init-templates/sample-app/python/README.template.md +65 -0
- package/lib/init-templates/sample-app/python/app.template.py +11 -0
- package/lib/init-templates/sample-app/python/cdk.template.json +15 -0
- package/lib/init-templates/sample-app/python/requirements-dev.txt +1 -0
- package/lib/init-templates/sample-app/python/requirements.txt +2 -0
- package/lib/init-templates/sample-app/python/source.bat +13 -0
- package/lib/init-templates/sample-app/python/tests/__init__.py +0 -0
- package/lib/init-templates/sample-app/python/tests/unit/__init__.py +0 -0
- package/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py +21 -0
- package/lib/init-templates/sample-app/typescript/.template.gitignore +8 -0
- package/lib/init-templates/sample-app/typescript/.template.npmignore +6 -0
- package/lib/init-templates/sample-app/typescript/README.template.md +15 -0
- package/lib/init-templates/sample-app/typescript/bin/%name%.template.ts +6 -0
- package/lib/init-templates/sample-app/typescript/cdk.template.json +17 -0
- package/lib/init-templates/sample-app/typescript/jest.config.js +8 -0
- package/lib/init-templates/sample-app/typescript/lib/%name%-stack.template.ts +19 -0
- package/lib/init-templates/sample-app/typescript/package.json +26 -0
- package/lib/init-templates/sample-app/typescript/test/%name%.test.template.ts +17 -0
- package/lib/init-templates/sample-app/typescript/tsconfig.json +31 -0
- package/lib/init.d.ts +52 -0
- package/lib/init.js +430 -0
- package/lib/legacy-exports-source.d.ts +27 -0
- package/lib/legacy-exports-source.js +88 -0
- package/lib/legacy-exports.d.ts +10 -0
- package/lib/legacy-exports.js +28 -0
- package/lib/legacy-logging-source.d.ts +32 -0
- package/lib/legacy-logging-source.js +107 -0
- package/lib/list-stacks.d.ts +22 -0
- package/lib/list-stacks.js +23 -0
- package/lib/logging.d.ts +109 -0
- package/lib/logging.js +159 -0
- package/lib/migrator.d.ts +25 -0
- package/lib/migrator.js +67 -0
- package/lib/notices.d.ts +156 -0
- package/lib/notices.js +373 -0
- package/lib/os.d.ts +7 -0
- package/lib/os.js +92 -0
- package/lib/serialize.d.ts +27 -0
- package/lib/serialize.js +86 -0
- package/lib/toolkit/cli-io-host.d.ts +208 -0
- package/lib/toolkit/cli-io-host.js +282 -0
- package/lib/toolkit/error.d.ts +44 -0
- package/lib/toolkit/error.js +78 -0
- package/lib/tree.d.ts +31 -0
- package/lib/tree.js +40 -0
- package/lib/util/archive.d.ts +1 -0
- package/lib/util/archive.js +86 -0
- package/lib/util/arrays.d.ts +14 -0
- package/lib/util/arrays.js +36 -0
- package/lib/util/bool.d.ts +7 -0
- package/lib/util/bool.js +13 -0
- package/lib/util/bytes.d.ts +8 -0
- package/lib/util/bytes.js +21 -0
- package/lib/util/content-hash.d.ts +5 -0
- package/lib/util/content-hash.js +43 -0
- package/lib/util/directories.d.ts +23 -0
- package/lib/util/directories.js +57 -0
- package/lib/util/error.d.ts +9 -0
- package/lib/util/error.js +22 -0
- package/lib/util/index.d.ts +5 -0
- package/lib/util/index.js +22 -0
- package/lib/util/objects.d.ts +52 -0
- package/lib/util/objects.js +183 -0
- package/lib/util/parallel.d.ts +6 -0
- package/lib/util/parallel.js +44 -0
- package/lib/util/tables.d.ts +1 -0
- package/lib/util/tables.js +10 -0
- package/lib/util/type-brands.d.ts +39 -0
- package/lib/util/type-brands.js +38 -0
- package/lib/util/types.d.ts +27 -0
- package/lib/util/types.js +25 -0
- package/lib/util/validate-notification-arn.d.ts +4 -0
- package/lib/util/validate-notification-arn.js +10 -0
- package/lib/util/version-range.d.ts +2 -0
- package/lib/util/version-range.js +36 -0
- package/lib/util/work-graph-builder.d.ts +32 -0
- package/lib/util/work-graph-builder.js +167 -0
- package/lib/util/work-graph-types.d.ts +50 -0
- package/lib/util/work-graph-types.js +14 -0
- package/lib/util/work-graph.d.ts +70 -0
- package/lib/util/work-graph.js +344 -0
- package/lib/util/yaml-cfn.d.ts +15 -0
- package/lib/util/yaml-cfn.js +56 -0
- package/package.json +197 -0
- package/scripts/user-input-gen +2 -0
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
Description: This stack includes resources needed to deploy AWS CDK apps into this
|
|
2
|
+
environment
|
|
3
|
+
Parameters:
|
|
4
|
+
TrustedAccounts:
|
|
5
|
+
Description: List of AWS accounts that are trusted to publish assets and deploy
|
|
6
|
+
stacks to this environment
|
|
7
|
+
Default: ''
|
|
8
|
+
Type: CommaDelimitedList
|
|
9
|
+
TrustedAccountsForLookup:
|
|
10
|
+
Description: List of AWS accounts that are trusted to look up values in this
|
|
11
|
+
environment
|
|
12
|
+
Default: ''
|
|
13
|
+
Type: CommaDelimitedList
|
|
14
|
+
CloudFormationExecutionPolicies:
|
|
15
|
+
Description: List of the ManagedPolicy ARN(s) to attach to the CloudFormation
|
|
16
|
+
deployment role
|
|
17
|
+
Default: ''
|
|
18
|
+
Type: CommaDelimitedList
|
|
19
|
+
FileAssetsBucketName:
|
|
20
|
+
Description: The name of the S3 bucket used for file assets
|
|
21
|
+
Default: ''
|
|
22
|
+
Type: String
|
|
23
|
+
FileAssetsBucketKmsKeyId:
|
|
24
|
+
Description: Empty to create a new key (default), 'AWS_MANAGED_KEY' to use a managed
|
|
25
|
+
S3 key, or the ID/ARN of an existing key.
|
|
26
|
+
Default: ''
|
|
27
|
+
Type: String
|
|
28
|
+
ContainerAssetsRepositoryName:
|
|
29
|
+
Description: A user-provided custom name to use for the container assets ECR repository
|
|
30
|
+
Default: ''
|
|
31
|
+
Type: String
|
|
32
|
+
Qualifier:
|
|
33
|
+
Description: An identifier to distinguish multiple bootstrap stacks in the same environment
|
|
34
|
+
Default: hnb659fds
|
|
35
|
+
Type: String
|
|
36
|
+
# "cdk-(qualifier)-image-publishing-role-(account)-(region)" needs to be <= 64 chars
|
|
37
|
+
# account = 12, region <= 14, 10 chars for qualifier and 28 for rest of role name
|
|
38
|
+
AllowedPattern: "[A-Za-z0-9_-]{1,10}"
|
|
39
|
+
ConstraintDescription: Qualifier must be an alphanumeric identifier of at most 10 characters
|
|
40
|
+
PublicAccessBlockConfiguration:
|
|
41
|
+
Description: Whether or not to enable S3 Staging Bucket Public Access Block Configuration
|
|
42
|
+
Default: 'true'
|
|
43
|
+
Type: 'String'
|
|
44
|
+
AllowedValues: ['true', 'false']
|
|
45
|
+
InputPermissionsBoundary:
|
|
46
|
+
Description: Whether or not to use either the CDK supplied or custom permissions boundary
|
|
47
|
+
Default: ''
|
|
48
|
+
Type: 'String'
|
|
49
|
+
UseExamplePermissionsBoundary:
|
|
50
|
+
Default: 'false'
|
|
51
|
+
AllowedValues: [ 'true', 'false' ]
|
|
52
|
+
Type: String
|
|
53
|
+
BootstrapVariant:
|
|
54
|
+
Type: String
|
|
55
|
+
Default: 'AWS CDK: Default Resources'
|
|
56
|
+
Description: Describe the provenance of the resources in this bootstrap
|
|
57
|
+
stack. Change this when you customize the template. To prevent accidents,
|
|
58
|
+
the CDK CLI will not overwrite bootstrap stacks with a different variant.
|
|
59
|
+
Conditions:
|
|
60
|
+
HasTrustedAccounts:
|
|
61
|
+
Fn::Not:
|
|
62
|
+
- Fn::Equals:
|
|
63
|
+
- ''
|
|
64
|
+
- Fn::Join:
|
|
65
|
+
- ''
|
|
66
|
+
- Ref: TrustedAccounts
|
|
67
|
+
HasTrustedAccountsForLookup:
|
|
68
|
+
Fn::Not:
|
|
69
|
+
- Fn::Equals:
|
|
70
|
+
- ''
|
|
71
|
+
- Fn::Join:
|
|
72
|
+
- ''
|
|
73
|
+
- Ref: TrustedAccountsForLookup
|
|
74
|
+
HasCloudFormationExecutionPolicies:
|
|
75
|
+
Fn::Not:
|
|
76
|
+
- Fn::Equals:
|
|
77
|
+
- ''
|
|
78
|
+
- Fn::Join:
|
|
79
|
+
- ''
|
|
80
|
+
- Ref: CloudFormationExecutionPolicies
|
|
81
|
+
HasCustomFileAssetsBucketName:
|
|
82
|
+
Fn::Not:
|
|
83
|
+
- Fn::Equals:
|
|
84
|
+
- ''
|
|
85
|
+
- Ref: FileAssetsBucketName
|
|
86
|
+
CreateNewKey:
|
|
87
|
+
Fn::Equals:
|
|
88
|
+
- ''
|
|
89
|
+
- Ref: FileAssetsBucketKmsKeyId
|
|
90
|
+
UseAwsManagedKey:
|
|
91
|
+
Fn::Equals:
|
|
92
|
+
- 'AWS_MANAGED_KEY'
|
|
93
|
+
- Ref: FileAssetsBucketKmsKeyId
|
|
94
|
+
ShouldCreatePermissionsBoundary:
|
|
95
|
+
Fn::Equals:
|
|
96
|
+
- 'true'
|
|
97
|
+
- Ref: UseExamplePermissionsBoundary
|
|
98
|
+
PermissionsBoundarySet:
|
|
99
|
+
Fn::Not:
|
|
100
|
+
- Fn::Equals:
|
|
101
|
+
- ''
|
|
102
|
+
- Ref: InputPermissionsBoundary
|
|
103
|
+
HasCustomContainerAssetsRepositoryName:
|
|
104
|
+
Fn::Not:
|
|
105
|
+
- Fn::Equals:
|
|
106
|
+
- ''
|
|
107
|
+
- Ref: ContainerAssetsRepositoryName
|
|
108
|
+
UsePublicAccessBlockConfiguration:
|
|
109
|
+
Fn::Equals:
|
|
110
|
+
- 'true'
|
|
111
|
+
- Ref: PublicAccessBlockConfiguration
|
|
112
|
+
Resources:
|
|
113
|
+
FileAssetsBucketEncryptionKey:
|
|
114
|
+
Type: AWS::KMS::Key
|
|
115
|
+
Properties:
|
|
116
|
+
KeyPolicy:
|
|
117
|
+
Statement:
|
|
118
|
+
- Action:
|
|
119
|
+
- kms:Create*
|
|
120
|
+
- kms:Describe*
|
|
121
|
+
- kms:Enable*
|
|
122
|
+
- kms:List*
|
|
123
|
+
- kms:Put*
|
|
124
|
+
- kms:Update*
|
|
125
|
+
- kms:Revoke*
|
|
126
|
+
- kms:Disable*
|
|
127
|
+
- kms:Get*
|
|
128
|
+
- kms:Delete*
|
|
129
|
+
- kms:ScheduleKeyDeletion
|
|
130
|
+
- kms:CancelKeyDeletion
|
|
131
|
+
- kms:GenerateDataKey
|
|
132
|
+
- kms:TagResource
|
|
133
|
+
- kms:UntagResource
|
|
134
|
+
Effect: Allow
|
|
135
|
+
Principal:
|
|
136
|
+
AWS:
|
|
137
|
+
Ref: AWS::AccountId
|
|
138
|
+
Resource: "*"
|
|
139
|
+
- Action:
|
|
140
|
+
- kms:Decrypt
|
|
141
|
+
- kms:DescribeKey
|
|
142
|
+
- kms:Encrypt
|
|
143
|
+
- kms:ReEncrypt*
|
|
144
|
+
- kms:GenerateDataKey*
|
|
145
|
+
Effect: Allow
|
|
146
|
+
Principal:
|
|
147
|
+
# Not actually everyone -- see below for Conditions
|
|
148
|
+
AWS: "*"
|
|
149
|
+
Resource: "*"
|
|
150
|
+
Condition:
|
|
151
|
+
StringEquals:
|
|
152
|
+
# See https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-caller-account
|
|
153
|
+
kms:CallerAccount:
|
|
154
|
+
Ref: AWS::AccountId
|
|
155
|
+
kms:ViaService:
|
|
156
|
+
- Fn::Sub: s3.${AWS::Region}.amazonaws.com
|
|
157
|
+
- Action:
|
|
158
|
+
- kms:Decrypt
|
|
159
|
+
- kms:DescribeKey
|
|
160
|
+
- kms:Encrypt
|
|
161
|
+
- kms:ReEncrypt*
|
|
162
|
+
- kms:GenerateDataKey*
|
|
163
|
+
Effect: Allow
|
|
164
|
+
Principal:
|
|
165
|
+
AWS:
|
|
166
|
+
Fn::Sub: "${FilePublishingRole.Arn}"
|
|
167
|
+
Resource: "*"
|
|
168
|
+
Condition: CreateNewKey
|
|
169
|
+
FileAssetsBucketEncryptionKeyAlias:
|
|
170
|
+
Condition: CreateNewKey
|
|
171
|
+
Type: AWS::KMS::Alias
|
|
172
|
+
Properties:
|
|
173
|
+
AliasName:
|
|
174
|
+
Fn::Sub: "alias/cdk-${Qualifier}-assets-key"
|
|
175
|
+
TargetKeyId:
|
|
176
|
+
Ref: FileAssetsBucketEncryptionKey
|
|
177
|
+
StagingBucket:
|
|
178
|
+
Type: AWS::S3::Bucket
|
|
179
|
+
Properties:
|
|
180
|
+
BucketName:
|
|
181
|
+
Fn::If:
|
|
182
|
+
- HasCustomFileAssetsBucketName
|
|
183
|
+
- Fn::Sub: "${FileAssetsBucketName}"
|
|
184
|
+
- Fn::Sub: cdk-${Qualifier}-assets-${AWS::AccountId}-${AWS::Region}
|
|
185
|
+
AccessControl: Private
|
|
186
|
+
BucketEncryption:
|
|
187
|
+
ServerSideEncryptionConfiguration:
|
|
188
|
+
- ServerSideEncryptionByDefault:
|
|
189
|
+
SSEAlgorithm: aws:kms
|
|
190
|
+
KMSMasterKeyID:
|
|
191
|
+
Fn::If:
|
|
192
|
+
- CreateNewKey
|
|
193
|
+
- Fn::Sub: "${FileAssetsBucketEncryptionKey.Arn}"
|
|
194
|
+
- Fn::If:
|
|
195
|
+
- UseAwsManagedKey
|
|
196
|
+
- Ref: AWS::NoValue
|
|
197
|
+
- Fn::Sub: "${FileAssetsBucketKmsKeyId}"
|
|
198
|
+
PublicAccessBlockConfiguration:
|
|
199
|
+
Fn::If:
|
|
200
|
+
- UsePublicAccessBlockConfiguration
|
|
201
|
+
- BlockPublicAcls: true
|
|
202
|
+
BlockPublicPolicy: true
|
|
203
|
+
IgnorePublicAcls: true
|
|
204
|
+
RestrictPublicBuckets: true
|
|
205
|
+
- Ref: AWS::NoValue
|
|
206
|
+
VersioningConfiguration:
|
|
207
|
+
Status: Enabled
|
|
208
|
+
LifecycleConfiguration:
|
|
209
|
+
Rules:
|
|
210
|
+
# Objects will only be noncurrent if they are deleted via garbage collection.
|
|
211
|
+
- Id: CleanupOldVersions
|
|
212
|
+
Status: Enabled
|
|
213
|
+
NoncurrentVersionExpiration:
|
|
214
|
+
NoncurrentDays: 30
|
|
215
|
+
- Id: AbortIncompleteMultipartUploads
|
|
216
|
+
Status: Enabled
|
|
217
|
+
AbortIncompleteMultipartUpload:
|
|
218
|
+
DaysAfterInitiation: 1
|
|
219
|
+
UpdateReplacePolicy: Retain
|
|
220
|
+
DeletionPolicy: Retain
|
|
221
|
+
StagingBucketPolicy:
|
|
222
|
+
Type: 'AWS::S3::BucketPolicy'
|
|
223
|
+
Properties:
|
|
224
|
+
Bucket: { Ref: 'StagingBucket' }
|
|
225
|
+
PolicyDocument:
|
|
226
|
+
Id: 'AccessControl'
|
|
227
|
+
Version: '2012-10-17'
|
|
228
|
+
Statement:
|
|
229
|
+
- Sid: 'AllowSSLRequestsOnly'
|
|
230
|
+
Action: 's3:*'
|
|
231
|
+
Effect: 'Deny'
|
|
232
|
+
Resource:
|
|
233
|
+
- { 'Fn::Sub': '${StagingBucket.Arn}' }
|
|
234
|
+
- { 'Fn::Sub': '${StagingBucket.Arn}/*' }
|
|
235
|
+
Condition:
|
|
236
|
+
Bool: { 'aws:SecureTransport': 'false' }
|
|
237
|
+
Principal: '*'
|
|
238
|
+
ContainerAssetsRepository:
|
|
239
|
+
Type: AWS::ECR::Repository
|
|
240
|
+
Properties:
|
|
241
|
+
ImageTagMutability: IMMUTABLE
|
|
242
|
+
# Untagged images should never exist but Security Hub wants this rule to exist
|
|
243
|
+
LifecyclePolicy:
|
|
244
|
+
LifecyclePolicyText: |
|
|
245
|
+
{
|
|
246
|
+
"rules": [
|
|
247
|
+
{
|
|
248
|
+
"rulePriority": 1,
|
|
249
|
+
"description": "Untagged images should not exist, but expire any older than one year",
|
|
250
|
+
"selection": {
|
|
251
|
+
"tagStatus": "untagged",
|
|
252
|
+
"countType": "sinceImagePushed",
|
|
253
|
+
"countUnit": "days",
|
|
254
|
+
"countNumber": 365
|
|
255
|
+
},
|
|
256
|
+
"action": { "type": "expire" }
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
RepositoryName:
|
|
261
|
+
Fn::If:
|
|
262
|
+
- HasCustomContainerAssetsRepositoryName
|
|
263
|
+
- Fn::Sub: "${ContainerAssetsRepositoryName}"
|
|
264
|
+
- Fn::Sub: cdk-${Qualifier}-container-assets-${AWS::AccountId}-${AWS::Region}
|
|
265
|
+
RepositoryPolicyText:
|
|
266
|
+
Version: "2012-10-17"
|
|
267
|
+
Statement:
|
|
268
|
+
# Necessary for Lambda container images
|
|
269
|
+
# https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-permissions
|
|
270
|
+
- Sid: LambdaECRImageRetrievalPolicy
|
|
271
|
+
Effect: Allow
|
|
272
|
+
Principal: { Service: "lambda.amazonaws.com" }
|
|
273
|
+
Action:
|
|
274
|
+
- ecr:BatchGetImage
|
|
275
|
+
- ecr:GetDownloadUrlForLayer
|
|
276
|
+
Condition:
|
|
277
|
+
StringLike:
|
|
278
|
+
"aws:sourceArn": { "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*" }
|
|
279
|
+
FilePublishingRole:
|
|
280
|
+
Type: AWS::IAM::Role
|
|
281
|
+
Properties:
|
|
282
|
+
AssumeRolePolicyDocument:
|
|
283
|
+
Statement:
|
|
284
|
+
# allows this role to be assumed with session tags.
|
|
285
|
+
# see https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_permissions-required
|
|
286
|
+
- Action: sts:TagSession
|
|
287
|
+
Effect: Allow
|
|
288
|
+
Principal:
|
|
289
|
+
AWS:
|
|
290
|
+
Ref: AWS::AccountId
|
|
291
|
+
- Action: sts:AssumeRole
|
|
292
|
+
Effect: Allow
|
|
293
|
+
Principal:
|
|
294
|
+
AWS:
|
|
295
|
+
Ref: AWS::AccountId
|
|
296
|
+
- Fn::If:
|
|
297
|
+
- HasTrustedAccounts
|
|
298
|
+
- Action: sts:AssumeRole
|
|
299
|
+
Effect: Allow
|
|
300
|
+
Principal:
|
|
301
|
+
AWS:
|
|
302
|
+
Ref: TrustedAccounts
|
|
303
|
+
- Ref: AWS::NoValue
|
|
304
|
+
RoleName:
|
|
305
|
+
Fn::Sub: cdk-${Qualifier}-file-publishing-role-${AWS::AccountId}-${AWS::Region}
|
|
306
|
+
Tags:
|
|
307
|
+
- Key: aws-cdk:bootstrap-role
|
|
308
|
+
Value: file-publishing
|
|
309
|
+
ImagePublishingRole:
|
|
310
|
+
Type: AWS::IAM::Role
|
|
311
|
+
Properties:
|
|
312
|
+
AssumeRolePolicyDocument:
|
|
313
|
+
Statement:
|
|
314
|
+
# allows this role to be assumed with session tags.
|
|
315
|
+
# see https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_permissions-required
|
|
316
|
+
- Action: sts:TagSession
|
|
317
|
+
Effect: Allow
|
|
318
|
+
Principal:
|
|
319
|
+
AWS:
|
|
320
|
+
Ref: AWS::AccountId
|
|
321
|
+
- Action: sts:AssumeRole
|
|
322
|
+
Effect: Allow
|
|
323
|
+
Principal:
|
|
324
|
+
AWS:
|
|
325
|
+
Ref: AWS::AccountId
|
|
326
|
+
- Fn::If:
|
|
327
|
+
- HasTrustedAccounts
|
|
328
|
+
- Action: sts:AssumeRole
|
|
329
|
+
Effect: Allow
|
|
330
|
+
Principal:
|
|
331
|
+
AWS:
|
|
332
|
+
Ref: TrustedAccounts
|
|
333
|
+
- Ref: AWS::NoValue
|
|
334
|
+
RoleName:
|
|
335
|
+
Fn::Sub: cdk-${Qualifier}-image-publishing-role-${AWS::AccountId}-${AWS::Region}
|
|
336
|
+
Tags:
|
|
337
|
+
- Key: aws-cdk:bootstrap-role
|
|
338
|
+
Value: image-publishing
|
|
339
|
+
LookupRole:
|
|
340
|
+
Type: AWS::IAM::Role
|
|
341
|
+
Properties:
|
|
342
|
+
AssumeRolePolicyDocument:
|
|
343
|
+
Statement:
|
|
344
|
+
# allows this role to be assumed with session tags.
|
|
345
|
+
# see https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_permissions-required
|
|
346
|
+
- Action: sts:TagSession
|
|
347
|
+
Effect: Allow
|
|
348
|
+
Principal:
|
|
349
|
+
AWS:
|
|
350
|
+
Ref: AWS::AccountId
|
|
351
|
+
- Action: sts:AssumeRole
|
|
352
|
+
Effect: Allow
|
|
353
|
+
Principal:
|
|
354
|
+
AWS:
|
|
355
|
+
Ref: AWS::AccountId
|
|
356
|
+
- Fn::If:
|
|
357
|
+
- HasTrustedAccountsForLookup
|
|
358
|
+
- Action: sts:AssumeRole
|
|
359
|
+
Effect: Allow
|
|
360
|
+
Principal:
|
|
361
|
+
AWS:
|
|
362
|
+
Ref: TrustedAccountsForLookup
|
|
363
|
+
- Ref: AWS::NoValue
|
|
364
|
+
- Fn::If:
|
|
365
|
+
- HasTrustedAccounts
|
|
366
|
+
- Action: sts:AssumeRole
|
|
367
|
+
Effect: Allow
|
|
368
|
+
Principal:
|
|
369
|
+
AWS:
|
|
370
|
+
Ref: TrustedAccounts
|
|
371
|
+
- Ref: AWS::NoValue
|
|
372
|
+
RoleName:
|
|
373
|
+
Fn::Sub: cdk-${Qualifier}-lookup-role-${AWS::AccountId}-${AWS::Region}
|
|
374
|
+
ManagedPolicyArns:
|
|
375
|
+
- Fn::Sub: "arn:${AWS::Partition}:iam::aws:policy/ReadOnlyAccess"
|
|
376
|
+
Policies:
|
|
377
|
+
- PolicyDocument:
|
|
378
|
+
Statement:
|
|
379
|
+
- Sid: DontReadSecrets
|
|
380
|
+
Effect: Deny
|
|
381
|
+
Action:
|
|
382
|
+
- kms:Decrypt
|
|
383
|
+
Resource: "*"
|
|
384
|
+
Version: '2012-10-17'
|
|
385
|
+
PolicyName: LookupRolePolicy
|
|
386
|
+
Tags:
|
|
387
|
+
- Key: aws-cdk:bootstrap-role
|
|
388
|
+
Value: lookup
|
|
389
|
+
FilePublishingRoleDefaultPolicy:
|
|
390
|
+
Type: AWS::IAM::Policy
|
|
391
|
+
Properties:
|
|
392
|
+
PolicyDocument:
|
|
393
|
+
Statement:
|
|
394
|
+
- Action:
|
|
395
|
+
- s3:GetObject*
|
|
396
|
+
- s3:GetBucket*
|
|
397
|
+
- s3:GetEncryptionConfiguration
|
|
398
|
+
- s3:List*
|
|
399
|
+
- s3:DeleteObject*
|
|
400
|
+
- s3:PutObject*
|
|
401
|
+
- s3:Abort*
|
|
402
|
+
Resource:
|
|
403
|
+
- Fn::Sub: "${StagingBucket.Arn}"
|
|
404
|
+
- Fn::Sub: "${StagingBucket.Arn}/*"
|
|
405
|
+
Condition:
|
|
406
|
+
StringEquals:
|
|
407
|
+
aws:ResourceAccount:
|
|
408
|
+
- Fn::Sub: ${AWS::AccountId}
|
|
409
|
+
Effect: Allow
|
|
410
|
+
- Action:
|
|
411
|
+
- kms:Decrypt
|
|
412
|
+
- kms:DescribeKey
|
|
413
|
+
- kms:Encrypt
|
|
414
|
+
- kms:ReEncrypt*
|
|
415
|
+
- kms:GenerateDataKey*
|
|
416
|
+
Effect: Allow
|
|
417
|
+
Resource:
|
|
418
|
+
Fn::If:
|
|
419
|
+
- CreateNewKey
|
|
420
|
+
- Fn::Sub: "${FileAssetsBucketEncryptionKey.Arn}"
|
|
421
|
+
- Fn::Sub: arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${FileAssetsBucketKmsKeyId}
|
|
422
|
+
Version: '2012-10-17'
|
|
423
|
+
Roles:
|
|
424
|
+
- Ref: FilePublishingRole
|
|
425
|
+
PolicyName:
|
|
426
|
+
Fn::Sub: cdk-${Qualifier}-file-publishing-role-default-policy-${AWS::AccountId}-${AWS::Region}
|
|
427
|
+
ImagePublishingRoleDefaultPolicy:
|
|
428
|
+
Type: AWS::IAM::Policy
|
|
429
|
+
Properties:
|
|
430
|
+
PolicyDocument:
|
|
431
|
+
Statement:
|
|
432
|
+
- Action:
|
|
433
|
+
- ecr:PutImage
|
|
434
|
+
- ecr:InitiateLayerUpload
|
|
435
|
+
- ecr:UploadLayerPart
|
|
436
|
+
- ecr:CompleteLayerUpload
|
|
437
|
+
- ecr:BatchCheckLayerAvailability
|
|
438
|
+
- ecr:DescribeRepositories
|
|
439
|
+
- ecr:DescribeImages
|
|
440
|
+
- ecr:BatchGetImage
|
|
441
|
+
- ecr:GetDownloadUrlForLayer
|
|
442
|
+
Resource:
|
|
443
|
+
Fn::Sub: "${ContainerAssetsRepository.Arn}"
|
|
444
|
+
Effect: Allow
|
|
445
|
+
- Action:
|
|
446
|
+
- ecr:GetAuthorizationToken
|
|
447
|
+
Resource: "*"
|
|
448
|
+
Effect: Allow
|
|
449
|
+
Version: '2012-10-17'
|
|
450
|
+
Roles:
|
|
451
|
+
- Ref: ImagePublishingRole
|
|
452
|
+
PolicyName:
|
|
453
|
+
Fn::Sub: cdk-${Qualifier}-image-publishing-role-default-policy-${AWS::AccountId}-${AWS::Region}
|
|
454
|
+
DeploymentActionRole:
|
|
455
|
+
Type: AWS::IAM::Role
|
|
456
|
+
Properties:
|
|
457
|
+
AssumeRolePolicyDocument:
|
|
458
|
+
Statement:
|
|
459
|
+
# allows this role to be assumed with session tags.
|
|
460
|
+
# see https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_permissions-required
|
|
461
|
+
- Action: sts:TagSession
|
|
462
|
+
Effect: Allow
|
|
463
|
+
Principal:
|
|
464
|
+
AWS:
|
|
465
|
+
Ref: AWS::AccountId
|
|
466
|
+
- Action: sts:AssumeRole
|
|
467
|
+
Effect: Allow
|
|
468
|
+
Principal:
|
|
469
|
+
AWS:
|
|
470
|
+
Ref: AWS::AccountId
|
|
471
|
+
- Fn::If:
|
|
472
|
+
- HasTrustedAccounts
|
|
473
|
+
- Action: sts:AssumeRole
|
|
474
|
+
Effect: Allow
|
|
475
|
+
Principal:
|
|
476
|
+
AWS:
|
|
477
|
+
Ref: TrustedAccounts
|
|
478
|
+
- Ref: AWS::NoValue
|
|
479
|
+
Policies:
|
|
480
|
+
- PolicyDocument:
|
|
481
|
+
Statement:
|
|
482
|
+
- Sid: CloudFormationPermissions
|
|
483
|
+
Effect: Allow
|
|
484
|
+
Action:
|
|
485
|
+
- cloudformation:CreateChangeSet
|
|
486
|
+
- cloudformation:DeleteChangeSet
|
|
487
|
+
- cloudformation:DescribeChangeSet
|
|
488
|
+
- cloudformation:DescribeStacks
|
|
489
|
+
- cloudformation:ExecuteChangeSet
|
|
490
|
+
- cloudformation:CreateStack
|
|
491
|
+
- cloudformation:UpdateStack
|
|
492
|
+
- cloudformation:RollbackStack
|
|
493
|
+
- cloudformation:ContinueUpdateRollback
|
|
494
|
+
Resource: "*"
|
|
495
|
+
- Sid: PipelineCrossAccountArtifactsBucket
|
|
496
|
+
# Read/write buckets in different accounts. Permissions to buckets in
|
|
497
|
+
# same account are granted by bucket policies.
|
|
498
|
+
#
|
|
499
|
+
# Write permissions necessary to write outputs to the cross-region artifact replication bucket
|
|
500
|
+
# https://aws.amazon.com/premiumsupport/knowledge-center/codepipeline-deploy-cloudformation/.
|
|
501
|
+
Effect: Allow
|
|
502
|
+
Action:
|
|
503
|
+
- s3:GetObject*
|
|
504
|
+
- s3:GetBucket*
|
|
505
|
+
- s3:List*
|
|
506
|
+
- s3:Abort*
|
|
507
|
+
- s3:DeleteObject*
|
|
508
|
+
- s3:PutObject*
|
|
509
|
+
Resource: "*"
|
|
510
|
+
Condition:
|
|
511
|
+
StringNotEquals:
|
|
512
|
+
s3:ResourceAccount:
|
|
513
|
+
Ref: 'AWS::AccountId'
|
|
514
|
+
- Sid: PipelineCrossAccountArtifactsKey
|
|
515
|
+
# Use keys only for the purposes of reading encrypted files from S3.
|
|
516
|
+
Effect: Allow
|
|
517
|
+
Action:
|
|
518
|
+
- kms:Decrypt
|
|
519
|
+
- kms:DescribeKey
|
|
520
|
+
- kms:Encrypt
|
|
521
|
+
- kms:ReEncrypt*
|
|
522
|
+
- kms:GenerateDataKey*
|
|
523
|
+
Resource: "*"
|
|
524
|
+
Condition:
|
|
525
|
+
StringEquals:
|
|
526
|
+
kms:ViaService:
|
|
527
|
+
Fn::Sub: s3.${AWS::Region}.amazonaws.com
|
|
528
|
+
- Action: iam:PassRole
|
|
529
|
+
Resource:
|
|
530
|
+
Fn::Sub: "${CloudFormationExecutionRole.Arn}"
|
|
531
|
+
Effect: Allow
|
|
532
|
+
- Sid: CliPermissions
|
|
533
|
+
Action:
|
|
534
|
+
# Permissions needed by the CLI when doing `cdk deploy`.
|
|
535
|
+
# Our CI/CD does not need DeleteStack,
|
|
536
|
+
# but we also want to use this role from the CLI,
|
|
537
|
+
# and there you can call `cdk destroy`
|
|
538
|
+
- cloudformation:DescribeStackEvents
|
|
539
|
+
- cloudformation:GetTemplate
|
|
540
|
+
- cloudformation:DeleteStack
|
|
541
|
+
- cloudformation:UpdateTerminationProtection
|
|
542
|
+
- sts:GetCallerIdentity
|
|
543
|
+
# `cdk import`
|
|
544
|
+
- cloudformation:GetTemplateSummary
|
|
545
|
+
Resource: "*"
|
|
546
|
+
Effect: Allow
|
|
547
|
+
- Sid: CliStagingBucket
|
|
548
|
+
Effect: Allow
|
|
549
|
+
Action:
|
|
550
|
+
- s3:GetObject*
|
|
551
|
+
- s3:GetBucket*
|
|
552
|
+
- s3:List*
|
|
553
|
+
Resource:
|
|
554
|
+
- Fn::Sub: ${StagingBucket.Arn}
|
|
555
|
+
- Fn::Sub: ${StagingBucket.Arn}/*
|
|
556
|
+
- Sid: ReadVersion
|
|
557
|
+
Effect: Allow
|
|
558
|
+
Action:
|
|
559
|
+
- ssm:GetParameter
|
|
560
|
+
- ssm:GetParameters # CreateChangeSet uses this to evaluate any SSM parameters (like `CdkBootstrapVersion`)
|
|
561
|
+
Resource:
|
|
562
|
+
- Fn::Sub: "arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter${CdkBootstrapVersion}"
|
|
563
|
+
Version: '2012-10-17'
|
|
564
|
+
PolicyName: default
|
|
565
|
+
RoleName:
|
|
566
|
+
Fn::Sub: cdk-${Qualifier}-deploy-role-${AWS::AccountId}-${AWS::Region}
|
|
567
|
+
Tags:
|
|
568
|
+
- Key: aws-cdk:bootstrap-role
|
|
569
|
+
Value: deploy
|
|
570
|
+
CloudFormationExecutionRole:
|
|
571
|
+
Type: AWS::IAM::Role
|
|
572
|
+
Properties:
|
|
573
|
+
AssumeRolePolicyDocument:
|
|
574
|
+
Statement:
|
|
575
|
+
- Action: sts:AssumeRole
|
|
576
|
+
Effect: Allow
|
|
577
|
+
Principal:
|
|
578
|
+
Service: cloudformation.amazonaws.com
|
|
579
|
+
Version: '2012-10-17'
|
|
580
|
+
ManagedPolicyArns:
|
|
581
|
+
Fn::If:
|
|
582
|
+
- HasCloudFormationExecutionPolicies
|
|
583
|
+
- Ref: CloudFormationExecutionPolicies
|
|
584
|
+
- Fn::If:
|
|
585
|
+
- HasTrustedAccounts
|
|
586
|
+
# The CLI will prevent this case from occurring
|
|
587
|
+
- Ref: AWS::NoValue
|
|
588
|
+
# The CLI will advertise that we picked this implicitly
|
|
589
|
+
- - Fn::Sub: "arn:${AWS::Partition}:iam::aws:policy/AdministratorAccess"
|
|
590
|
+
RoleName:
|
|
591
|
+
Fn::Sub: cdk-${Qualifier}-cfn-exec-role-${AWS::AccountId}-${AWS::Region}
|
|
592
|
+
PermissionsBoundary:
|
|
593
|
+
Fn::If:
|
|
594
|
+
- PermissionsBoundarySet
|
|
595
|
+
- Fn::Sub: 'arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${InputPermissionsBoundary}'
|
|
596
|
+
- Ref: AWS::NoValue
|
|
597
|
+
CdkBoostrapPermissionsBoundaryPolicy:
|
|
598
|
+
# Edit the template prior to boostrap in order to have this example policy created
|
|
599
|
+
Condition: ShouldCreatePermissionsBoundary
|
|
600
|
+
Type: AWS::IAM::ManagedPolicy
|
|
601
|
+
Properties:
|
|
602
|
+
PolicyDocument:
|
|
603
|
+
Statement:
|
|
604
|
+
# If permission boundaries do not have an explicit `allow`, then the effect is `deny`
|
|
605
|
+
- Sid: ExplicitAllowAll
|
|
606
|
+
Action:
|
|
607
|
+
- "*"
|
|
608
|
+
Effect: Allow
|
|
609
|
+
Resource: "*"
|
|
610
|
+
# Default permissions to prevent privilege escalation
|
|
611
|
+
- Sid: DenyAccessIfRequiredPermBoundaryIsNotBeingApplied
|
|
612
|
+
Action:
|
|
613
|
+
- iam:CreateUser
|
|
614
|
+
- iam:CreateRole
|
|
615
|
+
- iam:PutRolePermissionsBoundary
|
|
616
|
+
- iam:PutUserPermissionsBoundary
|
|
617
|
+
Condition:
|
|
618
|
+
StringNotEquals:
|
|
619
|
+
iam:PermissionsBoundary:
|
|
620
|
+
Fn::Sub: arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/cdk-${Qualifier}-permissions-boundary-${AWS::AccountId}-${AWS::Region}
|
|
621
|
+
Effect: Deny
|
|
622
|
+
Resource: "*"
|
|
623
|
+
# Forbid the policy itself being edited
|
|
624
|
+
- Sid: DenyPermBoundaryIAMPolicyAlteration
|
|
625
|
+
Action:
|
|
626
|
+
- iam:CreatePolicyVersion
|
|
627
|
+
- iam:DeletePolicy
|
|
628
|
+
- iam:DeletePolicyVersion
|
|
629
|
+
- iam:SetDefaultPolicyVersion
|
|
630
|
+
Effect: Deny
|
|
631
|
+
Resource:
|
|
632
|
+
Fn::Sub: arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/cdk-${Qualifier}-permissions-boundary-${AWS::AccountId}-${AWS::Region}
|
|
633
|
+
# Forbid removing the permissions boundary from any user or role that has it associated
|
|
634
|
+
- Sid: DenyRemovalOfPermBoundaryFromAnyUserOrRole
|
|
635
|
+
Action:
|
|
636
|
+
- iam:DeleteUserPermissionsBoundary
|
|
637
|
+
- iam:DeleteRolePermissionsBoundary
|
|
638
|
+
Effect: Deny
|
|
639
|
+
Resource: "*"
|
|
640
|
+
# Add your specific organizational security policy here
|
|
641
|
+
# Uncomment the example to deny access to AWS Config
|
|
642
|
+
#- Sid: OrganizationalSecurityPolicy
|
|
643
|
+
# Action:
|
|
644
|
+
# - "config:*"
|
|
645
|
+
# Effect: Deny
|
|
646
|
+
# Resource: "*"
|
|
647
|
+
Version: "2012-10-17"
|
|
648
|
+
Description: "Bootstrap Permission Boundary"
|
|
649
|
+
ManagedPolicyName:
|
|
650
|
+
Fn::Sub: cdk-${Qualifier}-permissions-boundary-${AWS::AccountId}-${AWS::Region}
|
|
651
|
+
Path: /
|
|
652
|
+
# The SSM parameter is used in pipeline-deployed templates to verify the version
|
|
653
|
+
# of the bootstrap resources.
|
|
654
|
+
CdkBootstrapVersion:
|
|
655
|
+
Type: AWS::SSM::Parameter
|
|
656
|
+
Properties:
|
|
657
|
+
Type: String
|
|
658
|
+
Name:
|
|
659
|
+
Fn::Sub: '/cdk-bootstrap/${Qualifier}/version'
|
|
660
|
+
Value: '25'
|
|
661
|
+
Outputs:
|
|
662
|
+
BucketName:
|
|
663
|
+
Description: The name of the S3 bucket owned by the CDK toolkit stack
|
|
664
|
+
Value:
|
|
665
|
+
Fn::Sub: "${StagingBucket}"
|
|
666
|
+
BucketDomainName:
|
|
667
|
+
Description: The domain name of the S3 bucket owned by the CDK toolkit stack
|
|
668
|
+
Value:
|
|
669
|
+
Fn::Sub: "${StagingBucket.RegionalDomainName}"
|
|
670
|
+
# @deprecated - This Export can be removed at some future point in time.
|
|
671
|
+
# We can't do it today because if there are stacks that use it, the bootstrap
|
|
672
|
+
# stack cannot be updated. Not used anymore by apps >= 1.60.0
|
|
673
|
+
FileAssetKeyArn:
|
|
674
|
+
Description: The ARN of the KMS key used to encrypt the asset bucket (deprecated)
|
|
675
|
+
Value:
|
|
676
|
+
Fn::If:
|
|
677
|
+
- CreateNewKey
|
|
678
|
+
- Fn::Sub: "${FileAssetsBucketEncryptionKey.Arn}"
|
|
679
|
+
- Fn::Sub: "${FileAssetsBucketKmsKeyId}"
|
|
680
|
+
Export:
|
|
681
|
+
Name:
|
|
682
|
+
Fn::Sub: CdkBootstrap-${Qualifier}-FileAssetKeyArn
|
|
683
|
+
ImageRepositoryName:
|
|
684
|
+
Description: The name of the ECR repository which hosts docker image assets
|
|
685
|
+
Value:
|
|
686
|
+
Fn::Sub: "${ContainerAssetsRepository}"
|
|
687
|
+
# The Output is used by the CLI to verify the version of the bootstrap resources.
|
|
688
|
+
BootstrapVersion:
|
|
689
|
+
Description: The version of the bootstrap resources that are currently mastered
|
|
690
|
+
in this stack
|
|
691
|
+
Value:
|
|
692
|
+
Fn::GetAtt: [CdkBootstrapVersion, Value]
|