aws-cdk 2.31.2 → 2.33.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 +29 -0
- package/README.md +7 -6
- package/THIRD_PARTY_LICENSES +9 -5
- package/build-info.json +2 -2
- package/lib/api/cloudformation-deployments.d.ts +1 -1
- package/lib/api/cloudformation-deployments.js +3 -3
- package/lib/api/nested-stack-helpers.d.ts +13 -13
- package/lib/api/nested-stack-helpers.js +7 -7
- package/lib/api/util/cloudformation.d.ts +3 -2
- package/lib/api/util/cloudformation.js +9 -5
- package/lib/bridge.js +25 -15
- package/lib/cdk-toolkit.d.ts +7 -0
- package/lib/cdk-toolkit.js +2 -2
- package/lib/cli.js +6 -3
- package/lib/commands/context.js +67 -7
- package/lib/index.js +13639 -5366
- package/lib/init-templates/{v1/app → app}/csharp/.template.gitignore +0 -0
- package/lib/init-templates/{v1/app → app}/csharp/README.md +0 -0
- package/lib/init-templates/app/csharp/add-project.hook.d.ts +2 -0
- package/lib/init-templates/{v2/app → app}/csharp/add-project.hook.js +1 -1
- package/lib/init-templates/{v1/app → app}/csharp/cdk.template.json +0 -0
- package/lib/init-templates/{v2/app → app}/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +0 -0
- package/lib/init-templates/{v2/app → app}/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +0 -0
- package/lib/init-templates/{v1/app → app}/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +0 -0
- package/lib/init-templates/{v2/app → app}/csharp/src/%name.PascalCased%/Program.template.cs +0 -0
- package/lib/init-templates/{v1/app → app}/csharp/src/%name.PascalCased%.template.sln +0 -0
- package/lib/init-templates/{v1/app → app}/fsharp/.template.gitignore +0 -0
- package/lib/init-templates/{v1/app → app}/fsharp/README.md +0 -0
- package/lib/init-templates/app/fsharp/add-project.hook.d.ts +2 -0
- package/lib/init-templates/{v1/app → app}/fsharp/add-project.hook.js +1 -1
- package/lib/init-templates/{v1/app → app}/fsharp/cdk.template.json +0 -0
- package/lib/init-templates/{v2/app → app}/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +0 -0
- package/lib/init-templates/{v1/app → app}/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +0 -0
- package/lib/init-templates/{v1/app → app}/fsharp/src/%name.PascalCased%/Program.template.fs +0 -0
- package/lib/init-templates/{v1/app → app}/fsharp/src/%name.PascalCased%.template.sln +0 -0
- package/lib/init-templates/{v2/app → app}/go/%name%.template.go +0 -0
- package/lib/init-templates/{v2/app → app}/go/%name%_test.template.go +0 -0
- package/lib/init-templates/{v1/app → app}/go/.template.gitignore +0 -0
- package/lib/init-templates/{v2/app → app}/go/README.md +1 -3
- package/lib/init-templates/{v1/app → app}/go/cdk.template.json +0 -0
- package/lib/init-templates/{v2/app → app}/go/go.template.mod +0 -0
- package/lib/init-templates/{v1/app → app}/info.json +0 -0
- package/lib/init-templates/{v1/app → app}/java/.template.gitignore +0 -0
- package/lib/init-templates/{v1/app → app}/java/README.md +0 -0
- package/lib/init-templates/{v1/app → app}/java/cdk.json +0 -0
- package/lib/init-templates/{v2/app → app}/java/pom.xml +0 -0
- package/lib/init-templates/{v2/app → app}/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +0 -0
- package/lib/init-templates/{v2/app → app}/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +0 -0
- package/lib/init-templates/{v2/app → app}/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java +0 -0
- package/lib/init-templates/app/java/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/app → app}/java/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v1/app → app}/javascript/.template.gitignore +0 -0
- package/lib/init-templates/{v1/app → app}/javascript/.template.npmignore +0 -0
- package/lib/init-templates/{v1/app → app}/javascript/README.md +0 -0
- package/lib/init-templates/{v2/app → app}/javascript/bin/%name%.template.js +0 -0
- package/lib/init-templates/{v1/app → app}/javascript/cdk.template.json +0 -0
- package/lib/init-templates/{v1/sample-app → app}/javascript/jest.config.js +0 -0
- package/lib/init-templates/{v2/app → app}/javascript/lib/%name%-stack.template.js +0 -0
- package/lib/init-templates/{v2/app → app}/javascript/package.json +0 -0
- package/lib/init-templates/app/javascript/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/sample-app → app}/javascript/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v2/app → app}/javascript/test/%name%.test.template.js +0 -0
- package/lib/init-templates/{v2/app → app}/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +0 -0
- package/lib/init-templates/{v1/app → app}/python/%name.PythonModule%/__init__.py +0 -0
- package/lib/init-templates/{v2/app → app}/python/.template.gitignore +0 -0
- package/lib/init-templates/{v1/app → app}/python/README.template.md +0 -0
- package/lib/init-templates/{v2/app → app}/python/app.template.py +0 -0
- package/lib/init-templates/{v1/app → app}/python/cdk.template.json +0 -0
- package/lib/init-templates/{v1/app → app}/python/requirements-dev.txt +0 -0
- package/lib/init-templates/{v2/app → app}/python/requirements.txt +0 -0
- package/lib/init-templates/{v1/app → app}/python/source.bat +0 -0
- package/lib/init-templates/app/python/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/sample-app → app}/python/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v1/app → app}/python/tests/__init__.py +0 -0
- package/lib/init-templates/{v1/app → app}/python/tests/unit/__init__.py +0 -0
- package/lib/init-templates/{v2/app → app}/python/tests/unit/test_%name.PythonModule%_stack.template.py +0 -0
- package/lib/init-templates/{v1/app → app}/typescript/.template.gitignore +0 -0
- package/lib/init-templates/{v1/app → app}/typescript/.template.npmignore +0 -0
- package/lib/init-templates/{v1/app → app}/typescript/README.md +0 -0
- package/lib/init-templates/{v2/app → app}/typescript/bin/%name%.template.ts +0 -0
- package/lib/init-templates/{v1/app → app}/typescript/cdk.template.json +0 -0
- package/lib/init-templates/{v1/app → app}/typescript/jest.config.js +0 -0
- package/lib/init-templates/{v2/app → app}/typescript/lib/%name%-stack.template.ts +0 -0
- package/lib/init-templates/{v2/app → app}/typescript/package.json +1 -1
- package/lib/init-templates/app/typescript/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/app/javascript → app/typescript}/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v2/app → app}/typescript/test/%name%.test.template.ts +0 -0
- package/lib/init-templates/{v1/app → app}/typescript/tsconfig.json +0 -0
- package/lib/init-templates/{v1/lib → lib}/info.json +0 -0
- package/lib/init-templates/{v1/lib → lib}/typescript/.template.gitignore +0 -0
- package/lib/init-templates/{v1/lib → lib}/typescript/.template.npmignore +0 -0
- package/lib/init-templates/{v2/lib → lib}/typescript/README.template.md +0 -0
- package/lib/init-templates/{v1/lib → lib}/typescript/jest.config.js +0 -0
- package/lib/init-templates/{v2/lib → lib}/typescript/lib/index.template.ts +0 -0
- package/lib/init-templates/{v2/lib → lib}/typescript/package.json +0 -0
- package/lib/init-templates/lib/typescript/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/lib → lib}/typescript/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v2/lib → lib}/typescript/test/%name%.test.template.ts +0 -0
- package/lib/init-templates/{v1/lib → lib}/typescript/tsconfig.json +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/csharp/.template.gitignore +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/csharp/README.template.md +0 -0
- package/lib/init-templates/sample-app/csharp/add-project.hook.d.ts +2 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/csharp/add-project.hook.js +1 -1
- package/lib/init-templates/{v1/sample-app → sample-app}/csharp/cdk.template.json +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/csharp/src/%name.PascalCased%/Program.template.cs +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/csharp/src/%name.PascalCased%.template.sln +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/fsharp/.template.gitignore +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/fsharp/README.template.md +0 -0
- package/lib/init-templates/sample-app/fsharp/add-project.hook.d.ts +2 -0
- package/lib/init-templates/{v2/app → sample-app}/fsharp/add-project.hook.js +1 -1
- package/lib/init-templates/{v1/sample-app → sample-app}/fsharp/cdk.template.json +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +1 -1
- package/lib/init-templates/{v1/sample-app → sample-app}/fsharp/src/%name.PascalCased%/Program.template.fs +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/fsharp/src/%name.PascalCased%.template.sln +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/go/%name%.template.go +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/go/%name%_test.template.go +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/go/.template.gitignore +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/go/README.md +1 -3
- package/lib/init-templates/{v1/sample-app → sample-app}/go/cdk.template.json +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/go/go.template.mod +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/info.json +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/java/.template.gitignore +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/java/README.template.md +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/java/cdk.json +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/java/pom.xml +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java +0 -0
- package/lib/init-templates/sample-app/java/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/java/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v1/sample-app → sample-app}/javascript/.template.gitignore +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/javascript/.template.npmignore +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/javascript/README.template.md +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/javascript/bin/%name%.template.js +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/javascript/cdk.template.json +0 -0
- package/lib/init-templates/{v2/app → sample-app}/javascript/jest.config.js +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/javascript/lib/%name%-stack.template.js +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/javascript/package.json +0 -0
- package/lib/init-templates/sample-app/javascript/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v1/app/typescript → sample-app/javascript}/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v2/sample-app → sample-app}/javascript/test/%name%.test.template.js +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/javascript/tsconfig.json +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/python/%name.PythonModule%/__init__.py +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/python/.template.gitignore +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/python/README.template.md +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/python/app.template.py +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/python/cdk.template.json +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/python/requirements-dev.txt +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/python/requirements.txt +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/python/source.bat +0 -0
- package/lib/init-templates/sample-app/python/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/{v2/app → sample-app}/python/sub-placeholders.hook.js +1 -1
- package/lib/init-templates/{v1/sample-app → sample-app}/python/tests/__init__.py +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/python/tests/unit/__init__.py +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/python/tests/unit/test_%name.PythonModule%_stack.template.py +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/typescript/.template.gitignore +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/typescript/.template.npmignore +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/typescript/README.template.md +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/typescript/bin/%name%.template.ts +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/typescript/cdk.template.json +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/typescript/jest.config.js +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/typescript/lib/%name%-stack.template.ts +0 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/typescript/package.json +1 -1
- package/lib/init-templates/sample-app/typescript/sub-placeholders.hook.d.ts +2 -0
- package/lib/init-templates/sample-app/typescript/sub-placeholders.hook.js +9 -0
- package/lib/init-templates/{v2/sample-app → sample-app}/typescript/test/%name%.test.template.ts +0 -0
- package/lib/init-templates/{v1/sample-app → sample-app}/typescript/tsconfig.json +0 -0
- package/lib/init.js +3 -16
- package/lib/notices.js +9 -15
- package/lib/setup-sandbox.js +6 -3
- package/lib/util/directories.d.ts +11 -0
- package/lib/util/directories.js +19 -2
- package/package.json +14 -13
- package/test/api/deploy-stack.test.js +2 -2
- package/test/commands/context-command.test.js +186 -47
- package/test/init.test.js +50 -56
- package/test/integ/cli/cli.integtest.js +30 -1
- package/test/integ/cli/sam_cdk_integ_app/src/python/Function/requirements.txt +1 -1
- package/test/integ/cli/sam_cdk_integ_app/src/python/Layer/requirements.txt +1 -1
- package/test/util/cloudformation.test.js +31 -4
- package/lib/init-templates/v1/app/csharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v1/app/csharp/add-project.hook.js +0 -31
- package/lib/init-templates/v1/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +0 -19
- package/lib/init-templates/v1/app/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +0 -12
- package/lib/init-templates/v1/app/csharp/src/%name.PascalCased%/Program.template.cs +0 -45
- package/lib/init-templates/v1/app/fsharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v1/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +0 -24
- package/lib/init-templates/v1/app/go/%name%.template.go +0 -68
- package/lib/init-templates/v1/app/go/%name%_test.template.go +0 -26
- package/lib/init-templates/v1/app/go/README.md +0 -14
- package/lib/init-templates/v1/app/go/go.template.mod +0 -9
- package/lib/init-templates/v1/app/java/pom.xml +0 -60
- package/lib/init-templates/v1/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +0 -41
- package/lib/init-templates/v1/app/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +0 -24
- package/lib/init-templates/v1/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java +0 -26
- package/lib/init-templates/v1/app/java/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/app/javascript/bin/%name%.template.js +0 -21
- package/lib/init-templates/v1/app/javascript/jest.config.js +0 -3
- package/lib/init-templates/v1/app/javascript/lib/%name%-stack.template.js +0 -23
- package/lib/init-templates/v1/app/javascript/package.json +0 -20
- package/lib/init-templates/v1/app/javascript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/app/javascript/test/%name%.test.template.js +0 -18
- package/lib/init-templates/v1/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +0 -24
- package/lib/init-templates/v1/app/python/.template.gitignore +0 -11
- package/lib/init-templates/v1/app/python/app.template.py +0 -34
- package/lib/init-templates/v1/app/python/requirements.txt +0 -2
- package/lib/init-templates/v1/app/python/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/app/python/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v1/app/python/tests/unit/test_%name.PythonModule%_stack.template.py +0 -19
- package/lib/init-templates/v1/app/typescript/bin/%name%.template.ts +0 -21
- package/lib/init-templates/v1/app/typescript/lib/%name%-stack.template.ts +0 -15
- package/lib/init-templates/v1/app/typescript/package.json +0 -28
- package/lib/init-templates/v1/app/typescript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/app/typescript/test/%name%.test.template.ts +0 -17
- package/lib/init-templates/v1/lib/typescript/README.template.md +0 -12
- package/lib/init-templates/v1/lib/typescript/lib/index.template.ts +0 -20
- package/lib/init-templates/v1/lib/typescript/package.json +0 -26
- package/lib/init-templates/v1/lib/typescript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/lib/typescript/test/%name%.test.template.ts +0 -18
- package/lib/init-templates/v1/sample-app/csharp/README.template.md +0 -22
- package/lib/init-templates/v1/sample-app/csharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v1/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +0 -23
- package/lib/init-templates/v1/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +0 -23
- package/lib/init-templates/v1/sample-app/fsharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v1/sample-app/fsharp/add-project.hook.js +0 -31
- package/lib/init-templates/v1/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +0 -27
- package/lib/init-templates/v1/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +0 -14
- package/lib/init-templates/v1/sample-app/go/%name%.template.go +0 -71
- package/lib/init-templates/v1/sample-app/go/%name%_test.template.go +0 -25
- package/lib/init-templates/v1/sample-app/go/README.md +0 -14
- package/lib/init-templates/v1/sample-app/go/go.template.mod +0 -9
- package/lib/init-templates/v1/sample-app/java/README.template.md +0 -23
- package/lib/init-templates/v1/sample-app/java/pom.xml +0 -72
- package/lib/init-templates/v1/sample-app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +0 -13
- package/lib/init-templates/v1/sample-app/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +0 -29
- package/lib/init-templates/v1/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java +0 -26
- package/lib/init-templates/v1/sample-app/java/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/sample-app/javascript/README.template.md +0 -17
- package/lib/init-templates/v1/sample-app/javascript/bin/%name%.template.js +0 -6
- package/lib/init-templates/v1/sample-app/javascript/lib/%name%-stack.template.js +0 -25
- package/lib/init-templates/v1/sample-app/javascript/package.json +0 -23
- package/lib/init-templates/v1/sample-app/javascript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/sample-app/javascript/test/%name%.test.template.js +0 -25
- package/lib/init-templates/v1/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +0 -24
- package/lib/init-templates/v1/sample-app/python/README.template.md +0 -68
- package/lib/init-templates/v1/sample-app/python/app.template.py +0 -11
- package/lib/init-templates/v1/sample-app/python/requirements.txt +0 -7
- package/lib/init-templates/v1/sample-app/python/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py +0 -24
- package/lib/init-templates/v1/sample-app/typescript/README.template.md +0 -19
- package/lib/init-templates/v1/sample-app/typescript/bin/%name%.template.ts +0 -6
- package/lib/init-templates/v1/sample-app/typescript/lib/%name%-stack.template.ts +0 -18
- package/lib/init-templates/v1/sample-app/typescript/package.json +0 -30
- package/lib/init-templates/v1/sample-app/typescript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v1/sample-app/typescript/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v1/sample-app/typescript/test/%name%.test.template.ts +0 -25
- package/lib/init-templates/v2/app/csharp/.template.gitignore +0 -342
- package/lib/init-templates/v2/app/csharp/README.md +0 -14
- package/lib/init-templates/v2/app/csharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v2/app/csharp/cdk.template.json +0 -15
- package/lib/init-templates/v2/app/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +0 -1
- package/lib/init-templates/v2/app/csharp/src/%name.PascalCased%.template.sln +0 -18
- package/lib/init-templates/v2/app/fsharp/.template.gitignore +0 -342
- package/lib/init-templates/v2/app/fsharp/README.md +0 -18
- package/lib/init-templates/v2/app/fsharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v2/app/fsharp/cdk.template.json +0 -14
- package/lib/init-templates/v2/app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +0 -8
- package/lib/init-templates/v2/app/fsharp/src/%name.PascalCased%/Program.template.fs +0 -11
- package/lib/init-templates/v2/app/fsharp/src/%name.PascalCased%.template.sln +0 -18
- package/lib/init-templates/v2/app/go/.template.gitignore +0 -19
- package/lib/init-templates/v2/app/go/cdk.template.json +0 -13
- package/lib/init-templates/v2/app/info.json +0 -4
- package/lib/init-templates/v2/app/java/.template.gitignore +0 -13
- package/lib/init-templates/v2/app/java/README.md +0 -18
- package/lib/init-templates/v2/app/java/cdk.json +0 -13
- package/lib/init-templates/v2/app/java/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/app/java/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/app/javascript/.template.gitignore +0 -5
- package/lib/init-templates/v2/app/javascript/.template.npmignore +0 -3
- package/lib/init-templates/v2/app/javascript/README.md +0 -12
- package/lib/init-templates/v2/app/javascript/cdk.template.json +0 -15
- package/lib/init-templates/v2/app/javascript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/app/javascript/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/app/python/%name.PythonModule%/__init__.py +0 -0
- package/lib/init-templates/v2/app/python/README.template.md +0 -58
- package/lib/init-templates/v2/app/python/cdk.template.json +0 -15
- package/lib/init-templates/v2/app/python/requirements-dev.txt +0 -1
- package/lib/init-templates/v2/app/python/source.bat +0 -13
- package/lib/init-templates/v2/app/python/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/app/python/tests/__init__.py +0 -0
- package/lib/init-templates/v2/app/python/tests/unit/__init__.py +0 -0
- package/lib/init-templates/v2/app/typescript/.template.gitignore +0 -8
- package/lib/init-templates/v2/app/typescript/.template.npmignore +0 -6
- package/lib/init-templates/v2/app/typescript/README.md +0 -14
- package/lib/init-templates/v2/app/typescript/cdk.template.json +0 -17
- package/lib/init-templates/v2/app/typescript/jest.config.js +0 -8
- package/lib/init-templates/v2/app/typescript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/app/typescript/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/app/typescript/tsconfig.json +0 -30
- package/lib/init-templates/v2/lib/info.json +0 -4
- package/lib/init-templates/v2/lib/typescript/.template.gitignore +0 -8
- package/lib/init-templates/v2/lib/typescript/.template.npmignore +0 -6
- package/lib/init-templates/v2/lib/typescript/jest.config.js +0 -8
- package/lib/init-templates/v2/lib/typescript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/lib/typescript/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/lib/typescript/tsconfig.json +0 -30
- package/lib/init-templates/v2/sample-app/csharp/.template.gitignore +0 -342
- package/lib/init-templates/v2/sample-app/csharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v2/sample-app/csharp/add-project.hook.js +0 -31
- package/lib/init-templates/v2/sample-app/csharp/cdk.template.json +0 -15
- package/lib/init-templates/v2/sample-app/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +0 -1
- package/lib/init-templates/v2/sample-app/csharp/src/%name.PascalCased%/Program.template.cs +0 -15
- package/lib/init-templates/v2/sample-app/csharp/src/%name.PascalCased%.template.sln +0 -18
- package/lib/init-templates/v2/sample-app/fsharp/.template.gitignore +0 -342
- package/lib/init-templates/v2/sample-app/fsharp/README.template.md +0 -20
- package/lib/init-templates/v2/sample-app/fsharp/add-project.hook.d.ts +0 -2
- package/lib/init-templates/v2/sample-app/fsharp/add-project.hook.js +0 -31
- package/lib/init-templates/v2/sample-app/fsharp/cdk.template.json +0 -14
- package/lib/init-templates/v2/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs +0 -11
- package/lib/init-templates/v2/sample-app/fsharp/src/%name.PascalCased%.template.sln +0 -18
- package/lib/init-templates/v2/sample-app/go/.template.gitignore +0 -19
- package/lib/init-templates/v2/sample-app/go/cdk.template.json +0 -13
- package/lib/init-templates/v2/sample-app/info.json +0 -4
- package/lib/init-templates/v2/sample-app/java/.template.gitignore +0 -13
- package/lib/init-templates/v2/sample-app/java/cdk.json +0 -13
- package/lib/init-templates/v2/sample-app/java/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/sample-app/java/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/sample-app/javascript/.template.gitignore +0 -5
- package/lib/init-templates/v2/sample-app/javascript/.template.npmignore +0 -3
- package/lib/init-templates/v2/sample-app/javascript/cdk.template.json +0 -15
- package/lib/init-templates/v2/sample-app/javascript/jest.config.js +0 -3
- package/lib/init-templates/v2/sample-app/javascript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/sample-app/javascript/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/sample-app/javascript/tsconfig.json +0 -35
- package/lib/init-templates/v2/sample-app/python/%name.PythonModule%/__init__.py +0 -0
- package/lib/init-templates/v2/sample-app/python/.template.gitignore +0 -22
- package/lib/init-templates/v2/sample-app/python/cdk.template.json +0 -15
- package/lib/init-templates/v2/sample-app/python/requirements-dev.txt +0 -1
- package/lib/init-templates/v2/sample-app/python/source.bat +0 -13
- package/lib/init-templates/v2/sample-app/python/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/sample-app/python/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/sample-app/python/tests/__init__.py +0 -0
- package/lib/init-templates/v2/sample-app/python/tests/unit/__init__.py +0 -0
- package/lib/init-templates/v2/sample-app/typescript/.template.gitignore +0 -8
- package/lib/init-templates/v2/sample-app/typescript/.template.npmignore +0 -6
- package/lib/init-templates/v2/sample-app/typescript/cdk.template.json +0 -17
- package/lib/init-templates/v2/sample-app/typescript/jest.config.js +0 -8
- package/lib/init-templates/v2/sample-app/typescript/sub-placeholders.hook.d.ts +0 -2
- package/lib/init-templates/v2/sample-app/typescript/sub-placeholders.hook.js +0 -9
- package/lib/init-templates/v2/sample-app/typescript/tsconfig.json +0 -30
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
|
3
|
-
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
4
|
-
<modelVersion>4.0.0</modelVersion>
|
|
5
|
-
<groupId>com.myorg</groupId>
|
|
6
|
-
<artifactId>%name%</artifactId>
|
|
7
|
-
<version>0.1</version>
|
|
8
|
-
<properties>
|
|
9
|
-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
10
|
-
<cdk.version>%cdk-version%</cdk.version>
|
|
11
|
-
<junit.version>5.7.1</junit.version>
|
|
12
|
-
</properties>
|
|
13
|
-
<build>
|
|
14
|
-
<plugins>
|
|
15
|
-
<plugin>
|
|
16
|
-
<groupId>org.apache.maven.plugins</groupId>
|
|
17
|
-
<artifactId>maven-compiler-plugin</artifactId>
|
|
18
|
-
<version>3.8.1</version>
|
|
19
|
-
<configuration>
|
|
20
|
-
<source>1.8</source>
|
|
21
|
-
<target>1.8</target>
|
|
22
|
-
</configuration>
|
|
23
|
-
</plugin>
|
|
24
|
-
<plugin>
|
|
25
|
-
<groupId>org.codehaus.mojo</groupId>
|
|
26
|
-
<artifactId>exec-maven-plugin</artifactId>
|
|
27
|
-
<version>3.0.0</version>
|
|
28
|
-
<configuration>
|
|
29
|
-
<mainClass>com.myorg.%name.PascalCased%App</mainClass>
|
|
30
|
-
</configuration>
|
|
31
|
-
</plugin>
|
|
32
|
-
</plugins>
|
|
33
|
-
</build>
|
|
34
|
-
<dependencies>
|
|
35
|
-
<!-- AWS Cloud Development Kit -->
|
|
36
|
-
<dependency>
|
|
37
|
-
<groupId>software.amazon.awscdk</groupId>
|
|
38
|
-
<artifactId>core</artifactId>
|
|
39
|
-
<version>${cdk.version}</version>
|
|
40
|
-
</dependency>
|
|
41
|
-
|
|
42
|
-
<!-- Respective AWS Construct Libraries -->
|
|
43
|
-
<dependency>
|
|
44
|
-
<groupId>software.amazon.awscdk</groupId>
|
|
45
|
-
<artifactId>sns</artifactId>
|
|
46
|
-
<version>${cdk.version}</version>
|
|
47
|
-
</dependency>
|
|
48
|
-
<dependency>
|
|
49
|
-
<groupId>software.amazon.awscdk</groupId>
|
|
50
|
-
<artifactId>sns-subscriptions</artifactId>
|
|
51
|
-
<version>${cdk.version}</version>
|
|
52
|
-
</dependency>
|
|
53
|
-
<dependency>
|
|
54
|
-
<groupId>software.amazon.awscdk</groupId>
|
|
55
|
-
<artifactId>sqs</artifactId>
|
|
56
|
-
<version>${cdk.version}</version>
|
|
57
|
-
</dependency>
|
|
58
|
-
<dependency>
|
|
59
|
-
<groupId>software.amazon.awscdk</groupId>
|
|
60
|
-
<artifactId>assertions</artifactId>
|
|
61
|
-
<version>${cdk.version}</version>
|
|
62
|
-
<scope>test</scope>
|
|
63
|
-
</dependency>
|
|
64
|
-
|
|
65
|
-
<dependency>
|
|
66
|
-
<groupId>org.junit.jupiter</groupId>
|
|
67
|
-
<artifactId>junit-jupiter</artifactId>
|
|
68
|
-
<version>${junit.version}</version>
|
|
69
|
-
<scope>test</scope>
|
|
70
|
-
</dependency>
|
|
71
|
-
</dependencies>
|
|
72
|
-
</project>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
package com.myorg;
|
|
2
|
-
|
|
3
|
-
import software.amazon.awscdk.core.App;
|
|
4
|
-
|
|
5
|
-
public final class %name.PascalCased%App {
|
|
6
|
-
public static void main(final String[] args) {
|
|
7
|
-
App app = new App();
|
|
8
|
-
|
|
9
|
-
new %name.PascalCased%Stack(app, "%name.PascalCased%Stack");
|
|
10
|
-
|
|
11
|
-
app.synth();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
package com.myorg;
|
|
2
|
-
|
|
3
|
-
import software.amazon.awscdk.core.Construct;
|
|
4
|
-
import software.amazon.awscdk.core.Duration;
|
|
5
|
-
import software.amazon.awscdk.core.Stack;
|
|
6
|
-
import software.amazon.awscdk.core.StackProps;
|
|
7
|
-
import software.amazon.awscdk.services.sns.Topic;
|
|
8
|
-
import software.amazon.awscdk.services.sns.subscriptions.SqsSubscription;
|
|
9
|
-
import software.amazon.awscdk.services.sqs.Queue;
|
|
10
|
-
|
|
11
|
-
public class %name.PascalCased%Stack extends Stack {
|
|
12
|
-
public %name.PascalCased%Stack(final Construct parent, final String id) {
|
|
13
|
-
this(parent, id, null);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public %name.PascalCased%Stack(final Construct parent, final String id, final StackProps props) {
|
|
17
|
-
super(parent, id, props);
|
|
18
|
-
|
|
19
|
-
final Queue queue = Queue.Builder.create(this, "%name.PascalCased%Queue")
|
|
20
|
-
.visibilityTimeout(Duration.seconds(300))
|
|
21
|
-
.build();
|
|
22
|
-
|
|
23
|
-
final Topic topic = Topic.Builder.create(this, "%name.PascalCased%Topic")
|
|
24
|
-
.displayName("My First Topic Yeah")
|
|
25
|
-
.build();
|
|
26
|
-
|
|
27
|
-
topic.addSubscription(new SqsSubscription(queue));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
package com.myorg;
|
|
2
|
-
|
|
3
|
-
import software.amazon.awscdk.core.App;
|
|
4
|
-
import software.amazon.awscdk.assertions.Template;
|
|
5
|
-
import software.amazon.awscdk.assertions.Match;
|
|
6
|
-
import java.io.IOException;
|
|
7
|
-
|
|
8
|
-
import java.util.HashMap;
|
|
9
|
-
|
|
10
|
-
import org.junit.jupiter.api.Test;
|
|
11
|
-
|
|
12
|
-
public class %name.PascalCased%StackTest {
|
|
13
|
-
|
|
14
|
-
@Test
|
|
15
|
-
public void testStack() throws IOException {
|
|
16
|
-
App app = new App();
|
|
17
|
-
%name.PascalCased%Stack stack = new %name.PascalCased%Stack(app, "test");
|
|
18
|
-
|
|
19
|
-
Template template = Template.fromStack(stack);
|
|
20
|
-
|
|
21
|
-
template.hasResourceProperties("AWS::SQS::Queue", new HashMap<String, Number>() {{
|
|
22
|
-
put("VisibilityTimeout", 300);
|
|
23
|
-
}});
|
|
24
|
-
template.resourceCountIs("AWS::SNS::Topic", 1);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Welcome to your CDK JavaScript project
|
|
2
|
-
|
|
3
|
-
You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PascalCased%Stack`)
|
|
4
|
-
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
|
|
5
|
-
|
|
6
|
-
The `cdk.json` file tells the CDK Toolkit how to execute your app. The build step is not required when using JavaScript.
|
|
7
|
-
|
|
8
|
-
## Tutorial
|
|
9
|
-
|
|
10
|
-
See [this useful workshop](https://cdkworkshop.com/20-typescript.html) on working with the AWS CDK for Typescript projects.
|
|
11
|
-
|
|
12
|
-
## Useful commands
|
|
13
|
-
|
|
14
|
-
* `npm run test` perform the jest unit tests
|
|
15
|
-
* `cdk deploy` deploy this stack to your default AWS account/region
|
|
16
|
-
* `cdk diff` compare deployed stack with current state
|
|
17
|
-
* `cdk synth` emits the synthesized CloudFormation template
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const sns = require('@aws-cdk/aws-sns');
|
|
2
|
-
const subs = require('@aws-cdk/aws-sns-subscriptions');
|
|
3
|
-
const sqs = require('@aws-cdk/aws-sqs');
|
|
4
|
-
const cdk = require('@aws-cdk/core');
|
|
5
|
-
|
|
6
|
-
class %name.PascalCased%Stack extends cdk.Stack {
|
|
7
|
-
/**
|
|
8
|
-
* @param {cdk.App} scope
|
|
9
|
-
* @param {string} id
|
|
10
|
-
* @param {cdk.StackProps=} props
|
|
11
|
-
*/
|
|
12
|
-
constructor(scope, id, props) {
|
|
13
|
-
super(scope, id, props);
|
|
14
|
-
|
|
15
|
-
const queue = new sqs.Queue(this, '%name.PascalCased%Queue', {
|
|
16
|
-
visibilityTimeout: cdk.Duration.seconds(300)
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const topic = new sns.Topic(this, '%name.PascalCased%Topic');
|
|
20
|
-
|
|
21
|
-
topic.addSubscription(new subs.SqsSubscription(queue));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = { %name.PascalCased%Stack }
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "%name%",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"bin": {
|
|
5
|
-
"%name%": "bin/%name%.js"
|
|
6
|
-
},
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "echo \"The build step is not required when using JavaScript!\" && exit 0",
|
|
9
|
-
"cdk": "cdk",
|
|
10
|
-
"test": "jest"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@aws-cdk/assertions": "%cdk-version%",
|
|
14
|
-
"aws-cdk": "%cdk-version%",
|
|
15
|
-
"jest": "^27.5.1"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@aws-cdk/aws-sns": "%cdk-version%",
|
|
19
|
-
"@aws-cdk/aws-sns-subscriptions": "%cdk-version%",
|
|
20
|
-
"@aws-cdk/aws-sqs": "%cdk-version%",
|
|
21
|
-
"@aws-cdk/core": "%cdk-version%"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const { Template, Match } = require('@aws-cdk/assertions');
|
|
2
|
-
const cdk = require('@aws-cdk/core');
|
|
3
|
-
const %name.PascalCased% = require('../lib/%name%-stack');
|
|
4
|
-
|
|
5
|
-
test('SQS Queue Created', () => {
|
|
6
|
-
const app = new cdk.App();
|
|
7
|
-
// WHEN
|
|
8
|
-
const stack = new %name.PascalCased%.%name.PascalCased%Stack(app, 'MyTestStack');
|
|
9
|
-
// THEN
|
|
10
|
-
const template = Template.fromStack(stack);
|
|
11
|
-
|
|
12
|
-
template.hasResourceProperties('AWS::SQS::Queue', {
|
|
13
|
-
VisibilityTimeout: 300
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test('SNS Topic Created', () => {
|
|
18
|
-
const app = new cdk.App();
|
|
19
|
-
// WHEN
|
|
20
|
-
const stack = new %name.PascalCased%.%name.PascalCased%Stack(app, 'MyTestStack');
|
|
21
|
-
// THEN
|
|
22
|
-
const template = Template.fromStack(stack);
|
|
23
|
-
|
|
24
|
-
template.resourceCountIs('AWS::SNS::Topic', 1);
|
|
25
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from aws_cdk import (
|
|
2
|
-
aws_iam as iam,
|
|
3
|
-
aws_sqs as sqs,
|
|
4
|
-
aws_sns as sns,
|
|
5
|
-
aws_sns_subscriptions as subs,
|
|
6
|
-
core
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class %name.PascalCased%Stack(core.Stack):
|
|
11
|
-
|
|
12
|
-
def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:
|
|
13
|
-
super().__init__(scope, construct_id, **kwargs)
|
|
14
|
-
|
|
15
|
-
queue = sqs.Queue(
|
|
16
|
-
self, "%name.PascalCased%Queue",
|
|
17
|
-
visibility_timeout=core.Duration.seconds(300),
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
topic = sns.Topic(
|
|
21
|
-
self, "%name.PascalCased%Topic"
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
topic.add_subscription(subs.SqsSubscription(queue))
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Welcome to your CDK Python project!
|
|
3
|
-
|
|
4
|
-
You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PythonModule%_stack`)
|
|
5
|
-
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
|
|
6
|
-
|
|
7
|
-
The `cdk.json` file tells the CDK Toolkit how to execute your app.
|
|
8
|
-
|
|
9
|
-
This project is set up like a standard Python project. The initialization process also creates
|
|
10
|
-
a virtualenv within this project, stored under the .venv directory. To create the virtualenv
|
|
11
|
-
it assumes that there is a `python3` executable in your path with access to the `venv` package.
|
|
12
|
-
If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv
|
|
13
|
-
manually once the init process completes.
|
|
14
|
-
|
|
15
|
-
To manually create a virtualenv on MacOS and Linux:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
$ %python-executable% -m venv .venv
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After the init process completes and the virtualenv is created, you can use the following
|
|
22
|
-
step to activate your virtualenv.
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
$ source .venv/bin/activate
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
If you are a Windows platform, you would activate the virtualenv like this:
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
% .venv\Scripts\activate.bat
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Once the virtualenv is activated, you can install the required dependencies.
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
$ pip install -r requirements.txt
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
At this point you can now synthesize the CloudFormation template for this code.
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
$ cdk synth
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can now begin exploring the source code, contained in the hello directory.
|
|
47
|
-
There is also a very trivial test included that can be run like this:
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
$ pytest
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
To add additional dependencies, for example other CDK libraries, just add to
|
|
54
|
-
your requirements.txt file and rerun the `pip install -r requirements.txt`
|
|
55
|
-
command.
|
|
56
|
-
|
|
57
|
-
## Tutorial
|
|
58
|
-
See [this useful workshop](https://cdkworkshop.com/30-python.html) on working with the AWS CDK for Python projects.
|
|
59
|
-
|
|
60
|
-
## Useful commands
|
|
61
|
-
|
|
62
|
-
* `cdk ls` list all stacks in the app
|
|
63
|
-
* `cdk synth` emits the synthesized CloudFormation template
|
|
64
|
-
* `cdk deploy` deploy this stack to your default AWS account/region
|
|
65
|
-
* `cdk diff` compare deployed stack with current state
|
|
66
|
-
* `cdk docs` open CDK documentation
|
|
67
|
-
|
|
68
|
-
Enjoy!
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from aws_cdk import (
|
|
2
|
-
core,
|
|
3
|
-
assertions
|
|
4
|
-
)
|
|
5
|
-
|
|
6
|
-
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def test_sqs_queue_created():
|
|
10
|
-
app = core.App()
|
|
11
|
-
stack = %name.PascalCased%Stack(app, "%name.StackName%")
|
|
12
|
-
template = assertions.Template.from_stack(stack)
|
|
13
|
-
|
|
14
|
-
template.has_resource_properties("AWS::SQS::Queue", {
|
|
15
|
-
"VisibilityTimeout": 300
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def test_sns_topic_created():
|
|
20
|
-
app = core.App()
|
|
21
|
-
stack = %name.PascalCased%Stack(app, "%name.StackName%")
|
|
22
|
-
template = assertions.Template.from_stack(stack)
|
|
23
|
-
|
|
24
|
-
template.resource_count_is("AWS::SNS::Topic", 1)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Welcome to your CDK TypeScript project
|
|
2
|
-
|
|
3
|
-
You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PascalCased%Stack`)
|
|
4
|
-
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
|
|
5
|
-
|
|
6
|
-
The `cdk.json` file tells the CDK Toolkit how to execute your app.
|
|
7
|
-
|
|
8
|
-
## Tutorial
|
|
9
|
-
|
|
10
|
-
See [this useful workshop](https://cdkworkshop.com/20-typescript.html) on working with the AWS CDK for Typescript projects.
|
|
11
|
-
|
|
12
|
-
## Useful commands
|
|
13
|
-
|
|
14
|
-
* `npm run build` compile typescript to js
|
|
15
|
-
* `npm run watch` watch for changes and compile
|
|
16
|
-
* `npm run test` perform the jest unit tests
|
|
17
|
-
* `cdk deploy` deploy this stack to your default AWS account/region
|
|
18
|
-
* `cdk diff` compare deployed stack with current state
|
|
19
|
-
* `cdk synth` emits the synthesized CloudFormation template
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as sns from '@aws-cdk/aws-sns';
|
|
2
|
-
import * as subs from '@aws-cdk/aws-sns-subscriptions';
|
|
3
|
-
import * as sqs from '@aws-cdk/aws-sqs';
|
|
4
|
-
import * as cdk from '@aws-cdk/core';
|
|
5
|
-
|
|
6
|
-
export class %name.PascalCased%Stack extends cdk.Stack {
|
|
7
|
-
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
|
|
8
|
-
super(scope, id, props);
|
|
9
|
-
|
|
10
|
-
const queue = new sqs.Queue(this, '%name.PascalCased%Queue', {
|
|
11
|
-
visibilityTimeout: cdk.Duration.seconds(300)
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const topic = new sns.Topic(this, '%name.PascalCased%Topic');
|
|
15
|
-
|
|
16
|
-
topic.addSubscription(new subs.SqsSubscription(queue));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "%name%",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"bin": {
|
|
5
|
-
"%name%": "bin/%name%.js"
|
|
6
|
-
},
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"watch": "tsc -w",
|
|
10
|
-
"test": "jest",
|
|
11
|
-
"cdk": "cdk"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"aws-cdk": "%cdk-version%",
|
|
15
|
-
"@aws-cdk/assertions": "%cdk-version%",
|
|
16
|
-
"@types/jest": "^27.5.2",
|
|
17
|
-
"@types/node": "10.17.27",
|
|
18
|
-
"@types/prettier": "2.6.0",
|
|
19
|
-
"jest": "^27.5.1",
|
|
20
|
-
"ts-jest": "^27.1.4",
|
|
21
|
-
"ts-node": "^10.8.1",
|
|
22
|
-
"typescript": "~3.9.7"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@aws-cdk/aws-sns": "%cdk-version%",
|
|
26
|
-
"@aws-cdk/aws-sns-subscriptions": "%cdk-version%",
|
|
27
|
-
"@aws-cdk/aws-sqs": "%cdk-version%",
|
|
28
|
-
"@aws-cdk/core": "%cdk-version%"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invoke = void 0;
|
|
4
|
-
exports.invoke = async (_, context) => {
|
|
5
|
-
// File cannot be named like regular template because it needs to be
|
|
6
|
-
// processed by dependency updaters.
|
|
7
|
-
await context.substitutePlaceholdersIn('package.json');
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ViLXBsYWNlaG9sZGVycy5ob29rLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic3ViLXBsYWNlaG9sZGVycy5ob29rLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVhLFFBQUEsTUFBTSxHQUFlLEtBQUssRUFBRSxDQUFDLEVBQUUsT0FBTyxFQUFFLEVBQUU7SUFDckQsb0VBQW9FO0lBQ3BFLG9DQUFvQztJQUNwQyxNQUFNLE9BQU8sQ0FBQyx3QkFBd0IsQ0FBQyxjQUFjLENBQUMsQ0FBQztBQUN6RCxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbnZva2VIb29rIH0gZnJvbSAnLi4vLi4vLi4vLi4vaW5pdCc7XG5cbmV4cG9ydCBjb25zdCBpbnZva2U6IEludm9rZUhvb2sgPSBhc3luYyAoXywgY29udGV4dCkgPT4ge1xuICAvLyBGaWxlIGNhbm5vdCBiZSBuYW1lZCBsaWtlIHJlZ3VsYXIgdGVtcGxhdGUgYmVjYXVzZSBpdCBuZWVkcyB0byBiZVxuICAvLyBwcm9jZXNzZWQgYnkgZGVwZW5kZW5jeSB1cGRhdGVycy5cbiAgYXdhaXQgY29udGV4dC5zdWJzdGl0dXRlUGxhY2Vob2xkZXJzSW4oJ3BhY2thZ2UuanNvbicpO1xufTtcbiJdfQ==
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Template, Match } from '@aws-cdk/assertions';
|
|
2
|
-
import * as cdk from '@aws-cdk/core';
|
|
3
|
-
import * as %name.PascalCased% from '../lib/%name%-stack';
|
|
4
|
-
|
|
5
|
-
test('SQS Queue Created', () => {
|
|
6
|
-
const app = new cdk.App();
|
|
7
|
-
// WHEN
|
|
8
|
-
const stack = new %name.PascalCased%.%name.PascalCased%Stack(app, 'MyTestStack');
|
|
9
|
-
// THEN
|
|
10
|
-
const template = Template.fromStack(stack);
|
|
11
|
-
|
|
12
|
-
template.hasResourceProperties('AWS::SQS::Queue', {
|
|
13
|
-
VisibilityTimeout: 300
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test('SNS Topic Created', () => {
|
|
18
|
-
const app = new cdk.App();
|
|
19
|
-
// WHEN
|
|
20
|
-
const stack = new %name.PascalCased%.%name.PascalCased%Stack(app, 'MyTestStack');
|
|
21
|
-
// THEN
|
|
22
|
-
const template = Template.fromStack(stack);
|
|
23
|
-
|
|
24
|
-
template.resourceCountIs('AWS::SNS::Topic', 1);
|
|
25
|
-
});
|