diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index 54f23d32744a4..d56d6cda5c487 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.131.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.130.0-alpha.0...v2.131.0-alpha.0) (2024-03-01) + ## [2.130.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.129.0-alpha.0...v2.130.0-alpha.0) (2024-02-23) ## [2.129.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.128.0-alpha.0...v2.129.0-alpha.0) (2024-02-21) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index 41ba07d810f0b..d5426dd9bd7b8 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,37 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.131.0](https://github.com/aws/aws-cdk/compare/v2.130.0...v2.131.0) (2024-03-01) + + +### Features + +* **apigatewayv2-integrations:** stepfunctions integration ([#28982](https://github.com/aws/aws-cdk/issues/28982)) ([19d75d6](https://github.com/aws/aws-cdk/commit/19d75d6c0ca7355be8a2375a60f3a228e4758e23)), closes [#28904](https://github.com/aws/aws-cdk/issues/28904) +* **applicationautoscaling:** add missing PredefinedMetricType enum values ([#29066](https://github.com/aws/aws-cdk/issues/29066)) ([63390e1](https://github.com/aws/aws-cdk/commit/63390e1bdd9f515eb1b9afcaf106985eb83fdc05)), closes [#29065](https://github.com/aws/aws-cdk/issues/29065) +* **appsync:** `environmentVariables` property for GraphqlApi ([#29064](https://github.com/aws/aws-cdk/issues/29064)) ([f0af5b1](https://github.com/aws/aws-cdk/commit/f0af5b1b1551e03198098610f0377af11447e098)) +* **appsync:** add the `grant` method to the imported `GraphqlApi` ([#29086](https://github.com/aws/aws-cdk/issues/29086)) ([7e8239b](https://github.com/aws/aws-cdk/commit/7e8239b2b85d0becb3c7fdcf5a2f4afbaf84f8b4)), closes [#23031](https://github.com/aws/aws-cdk/issues/23031) +* **core:** add `description` to `exportValue` and `exportStringListValue` methods ([#29150](https://github.com/aws/aws-cdk/issues/29150)) ([2e080fe](https://github.com/aws/aws-cdk/commit/2e080feb9d9e74323a47fb979d4b40a80179f93a)), closes [#29092](https://github.com/aws/aws-cdk/issues/29092) +* **docdb:** support snapshot removal policy ([#28798](https://github.com/aws/aws-cdk/issues/28798)) ([05b1bb0](https://github.com/aws/aws-cdk/commit/05b1bb069fd74fae86a31f3da09b3b93104ab753)), closes [#28773](https://github.com/aws/aws-cdk/issues/28773) +* **ec2:** support for the credit configuration mode for burstable instances ([#28728](https://github.com/aws/aws-cdk/issues/28728)) ([3cbad4a](https://github.com/aws/aws-cdk/commit/3cbad4a2164a41f5529e04aba4d15085c71b7849)), closes [#19166](https://github.com/aws/aws-cdk/issues/19166) +* **ecs-patterns:** allow custom ephemeral storage for ECS Fargate services ([#29275](https://github.com/aws/aws-cdk/issues/29275)) ([9156b13](https://github.com/aws/aws-cdk/commit/9156b133f7bb4db12b85954ca62a596b1c41366b)), closes [#18105](https://github.com/aws/aws-cdk/issues/18105) +* update L1 CloudFormation resource definitions ([#29257](https://github.com/aws/aws-cdk/issues/29257)) ([f3d74bb](https://github.com/aws/aws-cdk/commit/f3d74bb78189ec6b76cfa85c97d993c1b26c1cac)) + + +### Bug Fixes + +* **autoscaling:** step scaling without adjustment type fails ([#29158](https://github.com/aws/aws-cdk/issues/29158)) ([a7de7fe](https://github.com/aws/aws-cdk/commit/a7de7feb6a14658ec25f4cfda434d5e1d69157d2)) +* **cli:** add skip-tests.txt file for v2.130.0 ([#29320](https://github.com/aws/aws-cdk/issues/29320)) ([fdacbe0](https://github.com/aws/aws-cdk/commit/fdacbe06ff55832f285bfb1adb37245b47aef771)), closes [#29313](https://github.com/aws/aws-cdk/issues/29313) +* **CLI:** sam resources hidden in changeset diffs ([#29223](https://github.com/aws/aws-cdk/issues/29223)) ([aa186ac](https://github.com/aws/aws-cdk/commit/aa186ac3e44d6217e7f472d6cbd546789abae58a)), closes [#29185](https://github.com/aws/aws-cdk/issues/29185) +* **cli-integ:** add regression patch for cli integ fix ([#29313](https://github.com/aws/aws-cdk/issues/29313)) ([f803cf6](https://github.com/aws/aws-cdk/commit/f803cf620df28df111aa370e0f69439a1d1f87ff)), closes [#29305](https://github.com/aws/aws-cdk/issues/29305) +* **cli-integ:** use `Python_3_12` instead of `Python_3_7` lambda runtime ([#29305](https://github.com/aws/aws-cdk/issues/29305)) ([8d07b85](https://github.com/aws/aws-cdk/commit/8d07b857aec64211054e409a098a841ac57d9e09)) +* **cloudtrail:** isOrganizationTrail attaches insufficient permissions to bucket ([#29242](https://github.com/aws/aws-cdk/issues/29242)) ([457afa9](https://github.com/aws/aws-cdk/commit/457afa9d01fca8c9b91648175d6aa3183611e504)) +* **core:** a number of resources are not taggable with `Tags.of()` ([#28989](https://github.com/aws/aws-cdk/issues/28989)) ([7a4c189](https://github.com/aws/aws-cdk/commit/7a4c189d382e74235ab85375eb44b1a5a28eeb4c)) +* **custom-resources:** custom resource response may silently get dropped ([#28826](https://github.com/aws/aws-cdk/issues/28826)) ([c52ff08](https://github.com/aws/aws-cdk/commit/c52ff08cfd1515d35feb93bcba34a3231a94985c)) +* **ec2:** internet gateway is created even if public subnets are reserved ([#28607](https://github.com/aws/aws-cdk/issues/28607)) ([985c7e4](https://github.com/aws/aws-cdk/commit/985c7e4d9da583cb43479db3258723ba93faca3c)), closes [#28593](https://github.com/aws/aws-cdk/issues/28593) +* **ecs:** `autoscalingGroup` attribute does not exist on `ImportedCluster` ([#29244](https://github.com/aws/aws-cdk/issues/29244)) ([98b9bf2](https://github.com/aws/aws-cdk/commit/98b9bf28c95f87a3c2954bd73fc1a72c567d1e40)), closes [#29241](https://github.com/aws/aws-cdk/issues/29241) +* **ecs:** stack name can result in noncompliant capacity provider name ([#29235](https://github.com/aws/aws-cdk/issues/29235)) ([aca68ba](https://github.com/aws/aws-cdk/commit/aca68ba1cb1768c5bfd09db7dd83d83295ff5b96)), closes [#29151](https://github.com/aws/aws-cdk/issues/29151) +* **stepfunctions:** escaped curly braces result in error during state machine execution ([#29267](https://github.com/aws/aws-cdk/issues/29267)) ([a21e429](https://github.com/aws/aws-cdk/commit/a21e4298e5304c5d418fc7701c4457f720cef48b)), closes [#29261](https://github.com/aws/aws-cdk/issues/29261) + ## [2.130.0](https://github.com/aws/aws-cdk/compare/v2.129.0...v2.130.0) (2024-02-23) diff --git a/packages/@aws-cdk-testing/cli-integ/bin/apply-patches b/packages/@aws-cdk-testing/cli-integ/bin/apply-patches index b27d0c93dc9e7..30229625387a9 100755 --- a/packages/@aws-cdk-testing/cli-integ/bin/apply-patches +++ b/packages/@aws-cdk-testing/cli-integ/bin/apply-patches @@ -14,6 +14,9 @@ fi candidate_dir="${scriptdir}/../resources/cli-regression-patches/v${version}" -if [[ -f "$candidate_dir" ]]; then - cp -R "${candidate_dir}/"* "$2" -fi \ No newline at end of file +if [[ -d "$candidate_dir" ]]; then + echo "Found patch directory: ${candidate_dir}" + cp -vR "${candidate_dir}/"* "$2" +else + echo "No patch directory named: ${candidate_dir}" +fi diff --git a/packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts b/packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts index 5ad6596cf1b77..b4655461b5f57 100644 --- a/packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts @@ -2,7 +2,14 @@ import * as fs from 'fs'; import * as path from 'path'; import { MemoryStream } from './corking'; -const SKIP_TESTS = fs.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' }).split('\n'); +const SKIP_TESTS = fs.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' }) + .split('\n') + .map(x => x.trim()) + .filter(x => x && !x.startsWith('#')); + +if (SKIP_TESTS) { + process.stderr.write(`ℹ️ Skipping tests: ${JSON.stringify(SKIP_TESTS)}\n`); +} export interface TestContext { readonly randomString: string; @@ -11,7 +18,7 @@ export interface TestContext { }; if (process.env.JEST_TEST_CONCURRENT === 'true') { - process.stderr.write('ℹ️ JEST_TEST_CONCURRENT is true: tests will run concurrently and filters have no effect!'); + process.stderr.write('ℹ️ JEST_TEST_CONCURRENT is true: tests will run concurrently and filters have no effect!\n0'); } /** diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/manifest.json index d4e5db68eb0de..4b40b7a3b001e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/manifest.json @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/80ca79d29007dc0a645c6568c47e0730a748e22b27eaba47a7336b97d459edcc.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9b59badf02feb83b2f2747da9bbab479669d1efa47acadf76785d017660f7d03.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -247,10 +247,7 @@ "/stack/ECSFargateJobDefn/Resource": [ { "type": "aws:cdk:logicalId", - "data": "ECSFargateJobDefn327BE725", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "ECSFargateJobDefn327BE725" } ], "/stack/EcsDockerContainer/ExecutionRole/Resource": [ @@ -271,6 +268,24 @@ "data": "ECSDockerJobDefnF388CFCF" } ], + "/stack/WindowsFargateContainer/ExecutionRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "WindowsFargateContainerExecutionRoleAE15A6C1" + } + ], + "/stack/WindowsFargateContainer/ExecutionRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "WindowsFargateContainerExecutionRoleDefaultPolicyA16F3283" + } + ], + "/stack/WindowsJobDefinitio/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "WindowsJobDefinitio0652E08A" + } + ], "/stack/BootstrapVersion": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.assets.json index be9330c4ed096..5af4252f1a2d2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.assets.json @@ -1,7 +1,7 @@ { "version": "36.0.0", "files": { - "80ca79d29007dc0a645c6568c47e0730a748e22b27eaba47a7336b97d459edcc": { + "9b59badf02feb83b2f2747da9bbab479669d1efa47acadf76785d017660f7d03": { "source": { "path": "stack.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "80ca79d29007dc0a645c6568c47e0730a748e22b27eaba47a7336b97d459edcc.json", + "objectKey": "9b59badf02feb83b2f2747da9bbab479669d1efa47acadf76785d017660f7d03.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.template.json index 07857e0e45000..4f3da7e9b5dcc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/stack.template.json @@ -997,6 +997,106 @@ "Timeout": {}, "Type": "container" } + }, + "WindowsFargateContainerExecutionRoleAE15A6C1": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "WindowsFargateContainerExecutionRoleDefaultPolicyA16F3283": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/batch/job:*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "WindowsFargateContainerExecutionRoleDefaultPolicyA16F3283", + "Roles": [ + { + "Ref": "WindowsFargateContainerExecutionRoleAE15A6C1" + } + ] + } + }, + "WindowsJobDefinitio0652E08A": { + "Type": "AWS::Batch::JobDefinition", + "Properties": { + "ContainerProperties": { + "Environment": [], + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "WindowsFargateContainerExecutionRoleAE15A6C1", + "Arn" + ] + }, + "FargatePlatformConfiguration": {}, + "Image": "mcr.microsoft.com/dotnet/framework/runtime:4.7.2", + "NetworkConfiguration": { + "AssignPublicIp": "DISABLED" + }, + "ResourceRequirements": [ + { + "Type": "MEMORY", + "Value": "8192" + }, + { + "Type": "VCPU", + "Value": "2" + } + ], + "RuntimePlatform": { + "CpuArchitecture": "X86_64", + "OperatingSystemFamily": "WINDOWS_SERVER_2019_FULL" + } + }, + "JobDefinitionName": "windows-job-definition", + "PlatformCapabilities": [ + "FARGATE" + ], + "RetryStrategy": {}, + "Timeout": {}, + "Type": "container" + } } }, "Parameters": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/tree.json index a6452a3856934..6d0429bfdff10 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.js.snapshot/tree.json @@ -31,8 +31,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet1": { @@ -75,16 +75,16 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", "path": "stack/vpc/PublicSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { @@ -105,8 +105,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { @@ -124,8 +124,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { @@ -144,8 +144,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { @@ -164,8 +164,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { @@ -192,14 +192,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PublicSubnet2": { @@ -242,16 +242,16 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", "path": "stack/vpc/PublicSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { @@ -272,8 +272,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { @@ -291,8 +291,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { @@ -311,8 +311,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EIP": { @@ -331,8 +331,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "NATGateway": { @@ -359,14 +359,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet1": { @@ -409,16 +409,16 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", "path": "stack/vpc/PrivateSubnet1/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { @@ -439,8 +439,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { @@ -458,8 +458,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { @@ -478,14 +478,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "PrivateSubnet2": { @@ -528,16 +528,16 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Acl": { "id": "Acl", "path": "stack/vpc/PrivateSubnet2/Acl", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTable": { @@ -558,8 +558,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "RouteTableAssociation": { @@ -577,8 +577,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultRoute": { @@ -597,14 +597,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "IGW": { @@ -622,8 +622,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "VPCGW": { @@ -641,14 +641,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.Vpc", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "myFileSystem": { @@ -691,8 +691,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_efs.CfnFileSystem", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EfsSecurityGroup": { @@ -725,14 +725,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EfsMountTarget-PrivateSubnet1": { @@ -758,8 +758,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_efs.CfnMountTarget", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EfsMountTarget-PrivateSubnet2": { @@ -785,14 +785,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_efs.CfnMountTarget", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_efs.FileSystem", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "mySecret": { @@ -809,14 +809,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.Secret", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "anotherSecret": { @@ -833,14 +833,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecret", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.Secret", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ssm": { @@ -858,14 +858,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ssm.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ssm.StringParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "myContainer": { @@ -880,8 +880,8 @@ "id": "ImportExecutionRole", "path": "stack/myContainer/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { @@ -905,8 +905,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { @@ -1007,34 +1007,34 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "batchDefaultLogGroup": { "id": "batchDefaultLogGroup", "path": "stack/myContainer/batchDefaultLogGroup", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.EcsEc2ContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ECSJobDefn": { @@ -1167,14 +1167,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.CfnJobDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.EcsJobDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "myFargateContainer": { @@ -1189,8 +1189,8 @@ "id": "ImportExecutionRole", "path": "stack/myFargateContainer/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { @@ -1214,8 +1214,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { @@ -1269,34 +1269,34 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "batchDefaultLogGroup": { "id": "batchDefaultLogGroup", "path": "stack/myFargateContainer/batchDefaultLogGroup", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.EcsFargateContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ECSFargateJobDefn": { @@ -1378,14 +1378,14 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.CfnJobDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.EcsJobDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "dockerImageAsset": { @@ -1396,22 +1396,22 @@ "id": "Staging", "path": "stack/dockerImageAsset/Staging", "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Repository": { "id": "Repository", "path": "stack/dockerImageAsset/Repository", "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr.RepositoryBase", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecr_assets.DockerImageAsset", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "EcsDockerContainer": { @@ -1426,8 +1426,8 @@ "id": "ImportExecutionRole", "path": "stack/EcsDockerContainer/ExecutionRole/ImportExecutionRole", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "Resource": { @@ -1451,8 +1451,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "DefaultPolicy": { @@ -1542,34 +1542,34 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "batchDefaultLogGroup": { "id": "batchDefaultLogGroup", "path": "stack/EcsDockerContainer/batchDefaultLogGroup", "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.EcsEc2ContainerDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "ECSDockerJobDefn": { @@ -1614,36 +1614,216 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.CfnJobDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.aws_batch.EcsJobDefinition", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "WindowsFargateContainer": { + "id": "WindowsFargateContainer", + "path": "stack/WindowsFargateContainer", + "children": { + "ExecutionRole": { + "id": "ExecutionRole", + "path": "stack/WindowsFargateContainer/ExecutionRole", + "children": { + "ImportExecutionRole": { + "id": "ImportExecutionRole", + "path": "stack/WindowsFargateContainer/ExecutionRole/ImportExecutionRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "stack/WindowsFargateContainer/ExecutionRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "stack/WindowsFargateContainer/ExecutionRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "stack/WindowsFargateContainer/ExecutionRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/batch/job:*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "WindowsFargateContainerExecutionRoleDefaultPolicyA16F3283", + "roles": [ + { + "Ref": "WindowsFargateContainerExecutionRoleAE15A6C1" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "batchDefaultLogGroup": { + "id": "batchDefaultLogGroup", + "path": "stack/WindowsFargateContainer/batchDefaultLogGroup", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "WindowsJobDefinitio": { + "id": "WindowsJobDefinitio", + "path": "stack/WindowsJobDefinitio", + "children": { + "Resource": { + "id": "Resource", + "path": "stack/WindowsJobDefinitio/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Batch::JobDefinition", + "aws:cdk:cloudformation:props": { + "containerProperties": { + "image": "mcr.microsoft.com/dotnet/framework/runtime:4.7.2", + "environment": [], + "executionRoleArn": { + "Fn::GetAtt": [ + "WindowsFargateContainerExecutionRoleAE15A6C1", + "Arn" + ] + }, + "resourceRequirements": [ + { + "type": "MEMORY", + "value": "8192" + }, + { + "type": "VCPU", + "value": "2" + } + ], + "fargatePlatformConfiguration": {}, + "networkConfiguration": { + "assignPublicIp": "DISABLED" + }, + "runtimePlatform": { + "cpuArchitecture": "X86_64", + "operatingSystemFamily": "WINDOWS_SERVER_2019_FULL" + } + }, + "jobDefinitionName": "windows-job-definition", + "platformCapabilities": [ + "FARGATE" + ], + "retryStrategy": {}, + "timeout": {}, + "type": "container" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "stack/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "stack/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "BatchEcsJobDefinitionTest": { @@ -1670,22 +1850,22 @@ "id": "BootstrapVersion", "path": "BatchEcsJobDefinitionTest/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", "path": "BatchEcsJobDefinitionTest/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, @@ -1710,8 +1890,8 @@ } }, "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.ts index ec2ac7fdeaec8..42bd10cb5ebfc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-batch/test/integ.ecs-job-definition.ts @@ -92,6 +92,18 @@ new batch.EcsJobDefinition(stack, 'ECSDockerJobDefn', { }), }); +// can successfully launch a Windows container +new batch.EcsJobDefinition(stack, 'WindowsJobDefinitio', { + jobDefinitionName: 'windows-job-definition', + container: new batch.EcsFargateContainerDefinition(stack, 'WindowsFargateContainer', { + image: ecs.ContainerImage.fromRegistry('mcr.microsoft.com/dotnet/framework/runtime:4.7.2'), + memory: Size.gibibytes(8), + cpu: 2, + fargateCpuArchitecture: ecs.CpuArchitecture.X86_64, + fargateOperatingSystemFamily: ecs.OperatingSystemFamily.WINDOWS_SERVER_2019_FULL, + }), +}); + new integ.IntegTest(app, 'BatchEcsJobDefinitionTest', { testCases: [stack], }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.assets.json new file mode 100644 index 0000000000000..16284e1e5e694 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "5b7b9376300e8d5da09834e7dfc97bf825e9354f770b53e1bc3e3d0a9de8f10c": { + "source": { + "path": "aws-cdk-cloudwatch-metric-dimensions.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5b7b9376300e8d5da09834e7dfc97bf825e9354f770b53e1bc3e3d0a9de8f10c.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.template.json new file mode 100644 index 0000000000000..54d0bd59f3349 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.template.json @@ -0,0 +1,105 @@ +{ + "Resources": { + "queue": { + "Type": "AWS::SQS::Queue" + }, + "Alarm7103F465": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "DatapointsToAlarm": 2, + "Dimensions": [ + { + "Name": "BlankD1", + "Value": "value1" + }, + { + "Name": "BlankD10", + "Value": "value10" + }, + { + "Name": "BlankD2", + "Value": "value2" + }, + { + "Name": "BlankD3", + "Value": "value3" + }, + { + "Name": "BlankD4", + "Value": "value4" + }, + { + "Name": "BlankD5", + "Value": "value5" + }, + { + "Name": "BlankD6", + "Value": "value6" + }, + { + "Name": "BlankD7", + "Value": "value7" + }, + { + "Name": "BlankD8", + "Value": "value8" + }, + { + "Name": "BlankD9", + "Value": "value9" + }, + { + "Name": "QueueName", + "Value": { + "Fn::GetAtt": [ + "queue", + "QueueName" + ] + } + } + ], + "EvaluationPeriods": 3, + "MetricName": "ApproximateNumberOfMessagesVisible", + "Namespace": "AWS/SQS", + "Period": 300, + "Statistic": "Average", + "Threshold": 100 + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/integ.json new file mode 100644 index 0000000000000..b3f4a8a62b0cf --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "metric-with-dimensions-test/DefaultTest": { + "stacks": [ + "aws-cdk-cloudwatch-metric-dimensions" + ], + "assertionStack": "metric-with-dimensions-test/DefaultTest/DeployAssert", + "assertionStackName": "metricwithdimensionstestDefaultTestDeployAssert1196DF0F" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/manifest.json new file mode 100644 index 0000000000000..31a9dc49d6c44 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/manifest.json @@ -0,0 +1,119 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-cdk-cloudwatch-metric-dimensions.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-cloudwatch-metric-dimensions.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-cloudwatch-metric-dimensions": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-cloudwatch-metric-dimensions.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5b7b9376300e8d5da09834e7dfc97bf825e9354f770b53e1bc3e3d0a9de8f10c.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-cloudwatch-metric-dimensions.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-cloudwatch-metric-dimensions.assets" + ], + "metadata": { + "/aws-cdk-cloudwatch-metric-dimensions/queue": [ + { + "type": "aws:cdk:logicalId", + "data": "queue" + } + ], + "/aws-cdk-cloudwatch-metric-dimensions/Alarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Alarm7103F465" + } + ], + "/aws-cdk-cloudwatch-metric-dimensions/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-cloudwatch-metric-dimensions/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-cloudwatch-metric-dimensions" + }, + "metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "metricwithdimensionstestDefaultTestDeployAssert1196DF0F": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "metricwithdimensionstestDefaultTestDeployAssert1196DF0F.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets" + ], + "metadata": { + "/metric-with-dimensions-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/metric-with-dimensions-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "metric-with-dimensions-test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets.json new file mode 100644 index 0000000000000..c673635d60504 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "metricwithdimensionstestDefaultTestDeployAssert1196DF0F.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/tree.json new file mode 100644 index 0000000000000..f48626e919d06 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/tree.json @@ -0,0 +1,191 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-cloudwatch-metric-dimensions": { + "id": "aws-cdk-cloudwatch-metric-dimensions", + "path": "aws-cdk-cloudwatch-metric-dimensions", + "children": { + "queue": { + "id": "queue", + "path": "aws-cdk-cloudwatch-metric-dimensions/queue", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Alarm": { + "id": "Alarm", + "path": "aws-cdk-cloudwatch-metric-dimensions/Alarm", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-cloudwatch-metric-dimensions/Alarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "datapointsToAlarm": 2, + "dimensions": [ + { + "name": "BlankD1", + "value": "value1" + }, + { + "name": "BlankD10", + "value": "value10" + }, + { + "name": "BlankD2", + "value": "value2" + }, + { + "name": "BlankD3", + "value": "value3" + }, + { + "name": "BlankD4", + "value": "value4" + }, + { + "name": "BlankD5", + "value": "value5" + }, + { + "name": "BlankD6", + "value": "value6" + }, + { + "name": "BlankD7", + "value": "value7" + }, + { + "name": "BlankD8", + "value": "value8" + }, + { + "name": "BlankD9", + "value": "value9" + }, + { + "name": "QueueName", + "value": { + "Fn::GetAtt": [ + "queue", + "QueueName" + ] + } + } + ], + "evaluationPeriods": 3, + "metricName": "ApproximateNumberOfMessagesVisible", + "namespace": "AWS/SQS", + "period": 300, + "statistic": "Average", + "threshold": 100 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-cloudwatch-metric-dimensions/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-cloudwatch-metric-dimensions/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "metric-with-dimensions-test": { + "id": "metric-with-dimensions-test", + "path": "metric-with-dimensions-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "metric-with-dimensions-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "metric-with-dimensions-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "metric-with-dimensions-test/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "metric-with-dimensions-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "metric-with-dimensions-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.ts new file mode 100644 index 0000000000000..204d876e989b7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.ts @@ -0,0 +1,39 @@ +// Creates an Alarm with a Metric that contains 11 dimensions +// 1 valid dimension used, with 10 blank ones since it's hard to find a resource with more than 5 dimensions that is feasable to run tests with +import * as cdk from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'aws-cdk-cloudwatch-metric-dimensions'); + +const queue = new cdk.CfnResource(stack, 'queue', { type: 'AWS::SQS::Queue' }); + +const numberOfMessagesVisibleMetric = new cloudwatch.Metric({ + namespace: 'AWS/SQS', + metricName: 'ApproximateNumberOfMessagesVisible', + dimensionsMap: { + QueueName: queue.getAtt('QueueName').toString(), + BlankD1: 'value1', + BlankD2: 'value2', + BlankD3: 'value3', + BlankD4: 'value4', + BlankD5: 'value5', + BlankD6: 'value6', + BlankD7: 'value7', + BlankD8: 'value8', + BlankD9: 'value9', + BlankD10: 'value10', + }, +}); + +numberOfMessagesVisibleMetric.createAlarm(stack, 'Alarm', { + threshold: 100, + evaluationPeriods: 3, + datapointsToAlarm: 2, +}); + +new IntegTest(app, 'metric-with-dimensions-test', { + testCases: [stack], +}); \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/aws-cdk-vpc-nat-instances-v2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/aws-cdk-vpc-nat-instances-v2.assets.json new file mode 100644 index 0000000000000..8f3b0364817c7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/aws-cdk-vpc-nat-instances-v2.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "48ef9ffa2dccd900a9cc067bf63064119b67fe363f5ad1257d4261278bcba220": { + "source": { + "path": "aws-cdk-vpc-nat-instances-v2.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "48ef9ffa2dccd900a9cc067bf63064119b67fe363f5ad1257d4261278bcba220.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/aws-cdk-vpc-nat-instances-v2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/aws-cdk-vpc-nat-instances-v2.template.json new file mode 100644 index 0000000000000..1e751a92cac60 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/aws-cdk-vpc-nat-instances-v2.template.json @@ -0,0 +1,544 @@ +{ + "Resources": { + "MyVpcF9F0CA6F": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc" + } + ] + } + }, + "MyVpcPublicSubnet1SubnetF6608456": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPublicSubnet1RouteTableC46AB2F4": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + } + } + }, + "MyVpcPublicSubnet1DefaultRoute95FDF9EB": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + }, + "RouteTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet1NatInstanceInstanceRole394B648D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance" + } + ] + } + }, + "MyVpcPublicSubnet1NatInstanceInstanceProfile2FD934CB": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "MyVpcPublicSubnet1NatInstanceInstanceRole394B648D" + } + ] + } + }, + "MyVpcPublicSubnet1NatInstance8E94E5F7": { + "Type": "AWS::EC2::Instance", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "IamInstanceProfile": { + "Ref": "MyVpcPublicSubnet1NatInstanceInstanceProfile2FD934CB" + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t3.small", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "MyVpcNatSecurityGroupAA76397E", + "GroupId" + ] + } + ], + "SourceDestCheck": false, + "SubnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance" + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash\nyum install iptables-services -y\nsystemctl enable iptables\nsystemctl start iptables\necho \"net.ipv4.ip_forward=1\" > /etc/sysctl.d/custom-ip-forwarding.conf\nsudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf\nsudo /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nsudo /sbin/iptables -F FORWARD\nsudo service iptables save" + } + }, + "DependsOn": [ + "MyVpcPublicSubnet1NatInstanceInstanceRole394B648D" + ] + }, + "MyVpcPublicSubnet2Subnet492B6BFB": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPublicSubnet2RouteTable1DF17386": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPublicSubnet2RouteTableAssociation227DE78D": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + } + } + }, + "MyVpcPublicSubnet2DefaultRoute052936F6": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + }, + "RouteTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet2NatInstanceInstanceRoleFD8EE84D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance" + } + ] + } + }, + "MyVpcPublicSubnet2NatInstanceInstanceProfile5AB09EF6": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "MyVpcPublicSubnet2NatInstanceInstanceRoleFD8EE84D" + } + ] + } + }, + "MyVpcPublicSubnet2NatInstance04BCE4E3": { + "Type": "AWS::EC2::Instance", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "IamInstanceProfile": { + "Ref": "MyVpcPublicSubnet2NatInstanceInstanceProfile5AB09EF6" + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t3.small", + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "MyVpcNatSecurityGroupAA76397E", + "GroupId" + ] + } + ], + "SourceDestCheck": false, + "SubnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance" + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash\nyum install iptables-services -y\nsystemctl enable iptables\nsystemctl start iptables\necho \"net.ipv4.ip_forward=1\" > /etc/sysctl.d/custom-ip-forwarding.conf\nsudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf\nsudo /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nsudo /sbin/iptables -F FORWARD\nsudo service iptables save" + } + }, + "DependsOn": [ + "MyVpcPublicSubnet2NatInstanceInstanceRoleFD8EE84D" + ] + }, + "MyVpcPrivateSubnet1Subnet5057CF7E": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPrivateSubnet1RouteTable8819E6E2": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + } + }, + "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "InstanceId": { + "Ref": "MyVpcPublicSubnet1NatInstance8E94E5F7" + }, + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + } + } + }, + "MyVpcPrivateSubnet2Subnet0040C983": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPrivateSubnet2RouteTableCEDCEECE": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcPrivateSubnet2RouteTableAssociation86A610DA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet2Subnet0040C983" + } + } + }, + "MyVpcPrivateSubnet2DefaultRoute9CE96294": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "InstanceId": { + "Ref": "MyVpcPublicSubnet2NatInstance04BCE4E3" + }, + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + } + } + }, + "MyVpcIGW5C4A4F63": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc" + } + ] + } + }, + "MyVpcVPCGW488ACE0D": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + }, + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "MyVpcNatSecurityGroupAA76397E": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Security Group for NAT instances", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "SecurityGroupIngress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "from 0.0.0.0/0:ALL TRAFFIC", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-vpc-nat-instances-v2/MyVpc" + } + ], + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + } + }, + "Parameters": { + "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64" + }, + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/integ.json new file mode 100644 index 0000000000000..b042e68b55a72 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "nat-instance-v2-integ-test/DefaultTest": { + "stacks": [ + "aws-cdk-vpc-nat-instances-v2" + ], + "assertionStack": "nat-instance-v2-integ-test/DefaultTest/DeployAssert", + "assertionStackName": "natinstancev2integtestDefaultTestDeployAssertD7458A47" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/manifest.json new file mode 100644 index 0000000000000..d297b349779d2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/manifest.json @@ -0,0 +1,275 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-cdk-vpc-nat-instances-v2.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-vpc-nat-instances-v2.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-vpc-nat-instances-v2": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-vpc-nat-instances-v2.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/48ef9ffa2dccd900a9cc067bf63064119b67fe363f5ad1257d4261278bcba220.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-vpc-nat-instances-v2.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-vpc-nat-instances-v2.assets" + ], + "metadata": { + "/aws-cdk-vpc-nat-instances-v2/MyVpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcF9F0CA6F" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1SubnetF6608456" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1RouteTableC46AB2F4" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1DefaultRoute95FDF9EB" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1NatInstanceInstanceRole394B648D" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1NatInstanceInstanceProfile2FD934CB" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1NatInstance8E94E5F7", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2Subnet492B6BFB" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2RouteTable1DF17386" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2RouteTableAssociation227DE78D" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2DefaultRoute052936F6" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2NatInstanceInstanceRoleFD8EE84D" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2NatInstanceInstanceProfile5AB09EF6" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2NatInstance04BCE4E3", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" + ] + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1RouteTable8819E6E2" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2Subnet0040C983" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2RouteTableAssociation86A610DA" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2DefaultRoute9CE96294" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcIGW5C4A4F63" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcVPCGW488ACE0D" + } + ], + "/aws-cdk-vpc-nat-instances-v2/MyVpc/NatSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcNatSecurityGroupAA76397E" + } + ], + "/aws-cdk-vpc-nat-instances-v2/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/aws-cdk-vpc-nat-instances-v2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-vpc-nat-instances-v2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-vpc-nat-instances-v2" + }, + "natinstancev2integtestDefaultTestDeployAssertD7458A47.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "natinstancev2integtestDefaultTestDeployAssertD7458A47.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "natinstancev2integtestDefaultTestDeployAssertD7458A47": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "natinstancev2integtestDefaultTestDeployAssertD7458A47.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "natinstancev2integtestDefaultTestDeployAssertD7458A47.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "natinstancev2integtestDefaultTestDeployAssertD7458A47.assets" + ], + "metadata": { + "/nat-instance-v2-integ-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/nat-instance-v2-integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "nat-instance-v2-integ-test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/natinstancev2integtestDefaultTestDeployAssertD7458A47.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/natinstancev2integtestDefaultTestDeployAssertD7458A47.assets.json new file mode 100644 index 0000000000000..7be1e1506e14a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/natinstancev2integtestDefaultTestDeployAssertD7458A47.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "natinstancev2integtestDefaultTestDeployAssertD7458A47.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/natinstancev2integtestDefaultTestDeployAssertD7458A47.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/natinstancev2integtestDefaultTestDeployAssertD7458A47.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/natinstancev2integtestDefaultTestDeployAssertD7458A47.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/tree.json new file mode 100644 index 0000000000000..784f2d49842f1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.js.snapshot/tree.json @@ -0,0 +1,963 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-vpc-nat-instances-v2": { + "id": "aws-cdk-vpc-nat-instances-v2", + "path": "aws-cdk-vpc-nat-instances-v2", + "children": { + "MyVpc": { + "id": "MyVpc", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "subnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + }, + "routeTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "NatInstance": { + "id": "NatInstance", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance", + "children": { + "InstanceRole": { + "id": "InstanceRole", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "MyVpcPublicSubnet1NatInstanceInstanceRole394B648D" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Instance", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "iamInstanceProfile": { + "Ref": "MyVpcPublicSubnet1NatInstanceInstanceProfile2FD934CB" + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t3.small", + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "MyVpcNatSecurityGroupAA76397E", + "GroupId" + ] + } + ], + "sourceDestCheck": false, + "subnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet1/NatInstance" + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash\nyum install iptables-services -y\nsystemctl enable iptables\nsystemctl start iptables\necho \"net.ipv4.ip_forward=1\" > /etc/sysctl.d/custom-ip-forwarding.conf\nsudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf\nsudo /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nsudo /sbin/iptables -F FORWARD\nsudo service iptables save" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Instance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "subnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + }, + "routeTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "NatInstance": { + "id": "NatInstance", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance", + "children": { + "InstanceRole": { + "id": "InstanceRole", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "MyVpcPublicSubnet2NatInstanceInstanceRoleFD8EE84D" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Instance", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "iamInstanceProfile": { + "Ref": "MyVpcPublicSubnet2NatInstanceInstanceProfile5AB09EF6" + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestal2023amikernel61x8664C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t3.small", + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "MyVpcNatSecurityGroupAA76397E", + "GroupId" + ] + } + ], + "sourceDestCheck": false, + "subnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PublicSubnet2/NatInstance" + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash\nyum install iptables-services -y\nsystemctl enable iptables\nsystemctl start iptables\necho \"net.ipv4.ip_forward=1\" > /etc/sysctl.d/custom-ip-forwarding.conf\nsudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf\nsudo /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nsudo /sbin/iptables -F FORWARD\nsudo service iptables save" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInstance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Instance", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "subnetId": { + "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "instanceId": { + "Ref": "MyVpcPublicSubnet1NatInstance8E94E5F7" + }, + "routeTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "subnetId": { + "Ref": "MyVpcPrivateSubnet2Subnet0040C983" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "instanceId": { + "Ref": "MyVpcPublicSubnet2NatInstance04BCE4E3" + }, + "routeTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + }, + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + }, + "NatSecurityGroup": { + "id": "NatSecurityGroup", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/NatSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-vpc-nat-instances-v2/MyVpc/NatSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Security Group for NAT instances", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "securityGroupIngress": [ + { + "cidrIp": "0.0.0.0/0", + "ipProtocol": "-1", + "description": "from 0.0.0.0/0:ALL TRAFFIC" + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-cdk-vpc-nat-instances-v2/MyVpc" + } + ], + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-cdk-vpc-nat-instances-v2/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-cdk-vpc-nat-instances-v2/SsmParameterValue:--aws--service--ami-amazon-linux-latest--al2023-ami-kernel-6.1-x86_64:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-vpc-nat-instances-v2/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-vpc-nat-instances-v2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "nat-instance-v2-integ-test": { + "id": "nat-instance-v2-integ-test", + "path": "nat-instance-v2-integ-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "nat-instance-v2-integ-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "nat-instance-v2-integ-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "nat-instance-v2-integ-test/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "nat-instance-v2-integ-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "nat-instance-v2-integ-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.ts new file mode 100644 index 0000000000000..50e7bcdfb28d5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances-v2.ts @@ -0,0 +1,33 @@ +import * as cdk from 'aws-cdk-lib'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api'; + +class NatInstanceStack extends cdk.Stack { + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props); + this.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false); + + // Configure the `natGatewayProvider` when defining a Vpc + const natGatewayProvider = ec2.NatProvider.instanceV2({ + instanceType: new ec2.InstanceType('t3.small'), + }); + + const vpc = new ec2.Vpc(this, 'MyVpc', { + natGatewayProvider, + + // The 'natGateways' parameter now controls the number of NAT instances + natGateways: 2, + }); + + Array.isArray(vpc); + Array.isArray(natGatewayProvider.configuredGateways); + } +} + +const app = new cdk.App(); +const stack = new NatInstanceStack(app, 'aws-cdk-vpc-nat-instances-v2'); + +new IntegTest(app, 'nat-instance-v2-integ-test', { + testCases: [stack], +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets.json new file mode 100644 index 0000000000000..36288598dbe40 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/aws-ecs-patterns-alb-with-custom-storage.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/aws-ecs-patterns-alb-with-custom-storage.assets.json new file mode 100644 index 0000000000000..d33c5f89ba261 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/aws-ecs-patterns-alb-with-custom-storage.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "4aeda6cd27be6d2d51086f4b349b34a0c0384a09e5ba307373053e07a1e7c01b": { + "source": { + "path": "aws-ecs-patterns-alb-with-custom-storage.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "4aeda6cd27be6d2d51086f4b349b34a0c0384a09e5ba307373053e07a1e7c01b.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/aws-ecs-patterns-alb-with-custom-storage.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/aws-ecs-patterns-alb-with-custom-storage.template.json new file mode 100644 index 0000000000000..08ec2270724b4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/aws-ecs-patterns-alb-with-custom-storage.template.json @@ -0,0 +1,797 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-patterns-alb-with-custom-storage/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "ALBServiceWithCustomStorageLB2944BA62": { + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "Properties": { + "LoadBalancerAttributes": [ + { + "Key": "deletion_protection.enabled", + "Value": "false" + } + ], + "Scheme": "internet-facing", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ], + "Type": "application" + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC", + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] + }, + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Automatically created Security Group for ELB awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLB0BB3EC80", + "SecurityGroupIngress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow from anyone on port 80", + "FromPort": 80, + "IpProtocol": "tcp", + "ToPort": 80 + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "ALBServiceWithCustomStorageLBSecurityGrouptoawsecspatternsalbwithcustomstorageALBServiceWithCustomStorageServiceSecurityGroup5EBDD71280CAF68E39": { + "Type": "AWS::EC2::SecurityGroupEgress", + "Properties": { + "Description": "Load balancer to target", + "DestinationSecurityGroupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1", + "GroupId" + ] + }, + "FromPort": 80, + "GroupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01", + "GroupId" + ] + }, + "IpProtocol": "tcp", + "ToPort": 80 + } + }, + "ALBServiceWithCustomStorageLBPublicListener89E8575A": { + "Type": "AWS::ElasticLoadBalancingV2::Listener", + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "ALBServiceWithCustomStorageLB2944BA62" + }, + "Port": 80, + "Protocol": "HTTP" + } + }, + "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "Port": 80, + "Protocol": "HTTP", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "false" + } + ], + "TargetType": "ip", + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "ALBServiceWithCustomStorageTaskDef874CA24B": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Essential": true, + "HealthCheck": { + "Command": [ + "CMD-SHELL", + "curl -f http://localhost/ || exit 1" + ], + "Interval": 10, + "Retries": 10, + "Timeout": 5 + }, + "Image": "amazon/amazon-ecs-sample", + "LogConfiguration": { + "LogDriver": "awslogs", + "Options": { + "awslogs-group": { + "Ref": "ALBServiceWithCustomStorageTaskDefwebLogGroup99D5D241" + }, + "awslogs-stream-prefix": "ALBServiceWithCustomStorage", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "Name": "web", + "PortMappings": [ + { + "ContainerPort": 80, + "Protocol": "tcp" + } + ] + } + ], + "Cpu": "256", + "EphemeralStorage": { + "SizeInGiB": 35 + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageTaskDefExecutionRole4C674E37", + "Arn" + ] + }, + "Family": "awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageTaskDefC0C6519F", + "Memory": "512", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": [ + "FARGATE" + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36", + "Arn" + ] + } + } + }, + "ALBServiceWithCustomStorageTaskDefwebLogGroup99D5D241": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "ALBServiceWithCustomStorageTaskDefExecutionRole4C674E37": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "ALBServiceWithCustomStorageTaskDefExecutionRoleDefaultPolicy39D49813": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageTaskDefwebLogGroup99D5D241", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ALBServiceWithCustomStorageTaskDefExecutionRoleDefaultPolicy39D49813", + "Roles": [ + { + "Ref": "ALBServiceWithCustomStorageTaskDefExecutionRole4C674E37" + } + ] + } + }, + "ALBServiceWithCustomStorageServiceBC418171": { + "Type": "AWS::ECS::Service", + "Properties": { + "Cluster": { + "Ref": "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3" + }, + "DeploymentConfiguration": { + "Alarms": { + "AlarmNames": [], + "Enable": false, + "Rollback": false + }, + "MaximumPercent": 200, + "MinimumHealthyPercent": 50 + }, + "EnableECSManagedTags": false, + "HealthCheckGracePeriodSeconds": 60, + "LaunchType": "FARGATE", + "LoadBalancers": [ + { + "ContainerName": "web", + "ContainerPort": 80, + "TargetGroupArn": { + "Ref": "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E" + } + } + ], + "NetworkConfiguration": { + "AwsvpcConfiguration": { + "AssignPublicIp": "ENABLED", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ] + } + }, + "TaskDefinition": { + "Ref": "ALBServiceWithCustomStorageTaskDef874CA24B" + } + }, + "DependsOn": [ + "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E", + "ALBServiceWithCustomStorageLBPublicListener89E8575A", + "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36" + ] + }, + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + }, + "DependsOn": [ + "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36" + ] + }, + "ALBServiceWithCustomStorageServiceSecurityGroupfromawsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLBSecurityGroup415BB80D808B830EAA": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "Description": "Load balancer to target", + "FromPort": 80, + "GroupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1", + "GroupId" + ] + }, + "IpProtocol": "tcp", + "SourceSecurityGroupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01", + "GroupId" + ] + }, + "ToPort": 80 + }, + "DependsOn": [ + "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36" + ] + }, + "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3": { + "Type": "AWS::ECS::Cluster" + } + }, + "Outputs": { + "ALBServiceWithCustomStorageLoadBalancerDNS5A824F2E": { + "Value": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLB2944BA62", + "DNSName" + ] + } + }, + "ALBServiceWithCustomStorageServiceURL30743F97": { + "Value": { + "Fn::Join": [ + "", + [ + "http://", + { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLB2944BA62", + "DNSName" + ] + } + ] + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/integ.json new file mode 100644 index 0000000000000..51ff298ac9572 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest": { + "stacks": [ + "aws-ecs-patterns-alb-with-custom-storage" + ], + "assertionStack": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert", + "assertionStackName": "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/manifest.json new file mode 100644 index 0000000000000..ffbaa238de8c6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/manifest.json @@ -0,0 +1,341 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-ecs-patterns-alb-with-custom-storage.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-ecs-patterns-alb-with-custom-storage.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-ecs-patterns-alb-with-custom-storage": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-ecs-patterns-alb-with-custom-storage.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4aeda6cd27be6d2d51086f4b349b34a0c0384a09e5ba307373053e07a1e7c01b.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-ecs-patterns-alb-with-custom-storage.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-ecs-patterns-alb-with-custom-storage.assets" + ], + "metadata": { + "/aws-ecs-patterns-alb-with-custom-storage/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageLB2944BA62" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/SecurityGroup/to awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageServiceSecurityGroup5EBDD712:80": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageLBSecurityGrouptoawsecspatternsalbwithcustomstorageALBServiceWithCustomStorageServiceSecurityGroup5EBDD71280CAF68E39" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/PublicListener/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageLBPublicListener89E8575A" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/PublicListener/ECSGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LoadBalancerDNS": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageLoadBalancerDNS5A824F2E" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/ServiceURL": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageServiceURL30743F97" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/TaskRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageTaskDef874CA24B" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/web/LogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageTaskDefwebLogGroup99D5D241" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageTaskDefExecutionRole4C674E37" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageTaskDefExecutionRoleDefaultPolicy39D49813" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/Service": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageServiceBC418171" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup/from awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLBSecurityGroup415BB80D:80": [ + { + "type": "aws:cdk:logicalId", + "data": "ALBServiceWithCustomStorageServiceSecurityGroupfromawsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLBSecurityGroup415BB80D808B830EAA" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/EcsDefaultClusterMnL3mNNYNVPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-patterns-alb-with-custom-storage/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-patterns-alb-with-custom-storage" + }, + "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "ApplicationLoadBalancedFargateServiceCustomStorageTestDefaultTestDeployAssertD8C2EA6F.assets" + ], + "metadata": { + "/ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/tree.json new file mode 100644 index 0000000000000..2dc5c38f4f7c6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.js.snapshot/tree.json @@ -0,0 +1,1353 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-ecs-patterns-alb-with-custom-storage": { + "id": "aws-ecs-patterns-alb-with-custom-storage", + "path": "aws-ecs-patterns-alb-with-custom-storage", + "children": { + "VPC": { + "id": "VPC", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-patterns-alb-with-custom-storage/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "aws-ecs-patterns-alb-with-custom-storage/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "ALBServiceWithCustomStorage": { + "id": "ALBServiceWithCustomStorage", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage", + "children": { + "LB": { + "id": "LB", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "aws:cdk:cloudformation:props": { + "loadBalancerAttributes": [ + { + "key": "deletion_protection.enabled", + "value": "false" + } + ], + "scheme": "internet-facing", + "securityGroups": [ + { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01", + "GroupId" + ] + } + ], + "subnets": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ], + "type": "application" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Automatically created Security Group for ELB awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLB0BB3EC80", + "securityGroupIngress": [ + { + "cidrIp": "0.0.0.0/0", + "ipProtocol": "tcp", + "fromPort": 80, + "toPort": 80, + "description": "Allow from anyone on port 80" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + }, + "to awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageServiceSecurityGroup5EBDD712:80": { + "id": "to awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageServiceSecurityGroup5EBDD712:80", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/SecurityGroup/to awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageServiceSecurityGroup5EBDD712:80", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupEgress", + "aws:cdk:cloudformation:props": { + "description": "Load balancer to target", + "destinationSecurityGroupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1", + "GroupId" + ] + }, + "fromPort": 80, + "groupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01", + "GroupId" + ] + }, + "ipProtocol": "tcp", + "toPort": 80 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroupEgress", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "PublicListener": { + "id": "PublicListener", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/PublicListener", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/PublicListener/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", + "aws:cdk:cloudformation:props": { + "defaultActions": [ + { + "type": "forward", + "targetGroupArn": { + "Ref": "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E" + } + } + ], + "loadBalancerArn": { + "Ref": "ALBServiceWithCustomStorageLB2944BA62" + }, + "port": 80, + "protocol": "HTTP" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener", + "version": "0.0.0" + } + }, + "ECSGroup": { + "id": "ECSGroup", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/PublicListener/ECSGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LB/PublicListener/ECSGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "port": 80, + "protocol": "HTTP", + "targetGroupAttributes": [ + { + "key": "stickiness.enabled", + "value": "false" + } + ], + "targetType": "ip", + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer", + "version": "0.0.0" + } + }, + "LoadBalancerDNS": { + "id": "LoadBalancerDNS", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/LoadBalancerDNS", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "ServiceURL": { + "id": "ServiceURL", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/ServiceURL", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "TaskDef": { + "id": "TaskDef", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef", + "children": { + "TaskRole": { + "id": "TaskRole", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/TaskRole", + "children": { + "ImportTaskRole": { + "id": "ImportTaskRole", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/TaskRole/ImportTaskRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/TaskRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::TaskDefinition", + "aws:cdk:cloudformation:props": { + "containerDefinitions": [ + { + "essential": true, + "image": "amazon/amazon-ecs-sample", + "name": "web", + "portMappings": [ + { + "containerPort": 80, + "protocol": "tcp" + } + ], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-group": { + "Ref": "ALBServiceWithCustomStorageTaskDefwebLogGroup99D5D241" + }, + "awslogs-stream-prefix": "ALBServiceWithCustomStorage", + "awslogs-region": { + "Ref": "AWS::Region" + } + } + }, + "healthCheck": { + "command": [ + "CMD-SHELL", + "curl -f http://localhost/ || exit 1" + ], + "interval": 10, + "retries": 10, + "timeout": 5 + } + } + ], + "cpu": "256", + "ephemeralStorage": { + "sizeInGiB": 35 + }, + "executionRoleArn": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageTaskDefExecutionRole4C674E37", + "Arn" + ] + }, + "family": "awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageTaskDefC0C6519F", + "memory": "512", + "networkMode": "awsvpc", + "requiresCompatibilities": [ + "FARGATE" + ], + "taskRoleArn": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageTaskDefTaskRoleDB8D0B36", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnTaskDefinition", + "version": "0.0.0" + } + }, + "web": { + "id": "web", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/web", + "children": { + "LogGroup": { + "id": "LogGroup", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/web/LogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/web/LogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.ContainerDefinition", + "version": "0.0.0" + } + }, + "ExecutionRole": { + "id": "ExecutionRole", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole", + "children": { + "ImportExecutionRole": { + "id": "ImportExecutionRole", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole/ImportExecutionRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/TaskDef/ExecutionRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageTaskDefwebLogGroup99D5D241", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ALBServiceWithCustomStorageTaskDefExecutionRoleDefaultPolicy39D49813", + "roles": [ + { + "Ref": "ALBServiceWithCustomStorageTaskDefExecutionRole4C674E37" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.FargateTaskDefinition", + "version": "0.0.0" + } + }, + "Service": { + "id": "Service", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service", + "children": { + "Service": { + "id": "Service", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/Service", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::Service", + "aws:cdk:cloudformation:props": { + "cluster": { + "Ref": "EcsDefaultClusterMnL3mNNYNVPC9C1EC7A3" + }, + "deploymentConfiguration": { + "maximumPercent": 200, + "minimumHealthyPercent": 50, + "alarms": { + "alarmNames": [], + "enable": false, + "rollback": false + } + }, + "enableEcsManagedTags": false, + "healthCheckGracePeriodSeconds": 60, + "launchType": "FARGATE", + "loadBalancers": [ + { + "targetGroupArn": { + "Ref": "ALBServiceWithCustomStorageLBPublicListenerECSGroup9AD0558E" + }, + "containerName": "web", + "containerPort": 80 + } + ], + "networkConfiguration": { + "awsvpcConfiguration": { + "assignPublicIp": "ENABLED", + "subnets": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ], + "securityGroups": [ + { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1", + "GroupId" + ] + } + ] + } + }, + "taskDefinition": { + "Ref": "ALBServiceWithCustomStorageTaskDef874CA24B" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnService", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + }, + "from awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLBSecurityGroup415BB80D:80": { + "id": "from awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLBSecurityGroup415BB80D:80", + "path": "aws-ecs-patterns-alb-with-custom-storage/ALBServiceWithCustomStorage/Service/SecurityGroup/from awsecspatternsalbwithcustomstorageALBServiceWithCustomStorageLBSecurityGroup415BB80D:80", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", + "aws:cdk:cloudformation:props": { + "description": "Load balancer to target", + "fromPort": 80, + "groupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageServiceSecurityGroupC2DED8D1", + "GroupId" + ] + }, + "ipProtocol": "tcp", + "sourceSecurityGroupId": { + "Fn::GetAtt": [ + "ALBServiceWithCustomStorageLBSecurityGroup5CCF3B01", + "GroupId" + ] + }, + "toPort": 80 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroupIngress", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.FargateService", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs_patterns.ApplicationLoadBalancedFargateService", + "version": "0.0.0" + } + }, + "EcsDefaultClusterMnL3mNNYNVPC": { + "id": "EcsDefaultClusterMnL3mNNYNVPC", + "path": "aws-ecs-patterns-alb-with-custom-storage/EcsDefaultClusterMnL3mNNYNVPC", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-patterns-alb-with-custom-storage/EcsDefaultClusterMnL3mNNYNVPC/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.Cluster", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-ecs-patterns-alb-with-custom-storage/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-ecs-patterns-alb-with-custom-storage/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "ApplicationLoadBalancedFargateServiceCustomStorageTest": { + "id": "ApplicationLoadBalancedFargateServiceCustomStorageTest", + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "ApplicationLoadBalancedFargateServiceCustomStorageTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.ts new file mode 100644 index 0000000000000..a97061e81b9a7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/fargate/integ.alb-fargate-service-custom-storage.ts @@ -0,0 +1,30 @@ +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import { App, Stack, Duration } from 'aws-cdk-lib'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import { ApplicationLoadBalancedFargateService } from 'aws-cdk-lib/aws-ecs-patterns'; +import { ContainerImage } from 'aws-cdk-lib/aws-ecs'; + +const app = new App(); +const stack = new Stack(app, 'aws-ecs-patterns-alb-with-custom-storage'); +const vpc = new ec2.Vpc(stack, 'VPC', { restrictDefaultSecurityGroup: false }); + +new ApplicationLoadBalancedFargateService(stack, 'ALBServiceWithCustomStorage', { + vpc, + memoryLimitMiB: 512, + ephemeralStorageGiB: 35, + taskImageOptions: { + image: ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + }, + assignPublicIp: true, + healthCheck: { + command: ['CMD-SHELL', 'curl -f http://localhost/ || exit 1'], + interval: Duration.seconds(10), + retries: 10, + }, +}); + +new integ.IntegTest(app, 'ApplicationLoadBalancedFargateServiceCustomStorageTest', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.js.snapshot/aws-cdk-sqs.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.js.snapshot/aws-cdk-sqs.template.json index a116bcb48f618..a17bfbfefa270 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.js.snapshot/aws-cdk-sqs.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.js.snapshot/aws-cdk-sqs.template.json @@ -2,11 +2,21 @@ "Resources": { "SourceQueue1F4BBA4BB": { "Type": "AWS::SQS::Queue", + "Properties": { + "RedriveAllowPolicy": { + "redrivePermission": "allowAll" + } + }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, "SourceQueue22481CB5A": { "Type": "AWS::SQS::Queue", + "Properties": { + "RedriveAllowPolicy": { + "redrivePermission": "denyAll" + } + }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.ts index e6079ba21f67e..3ff61390fd95d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sqs/test/integ.sqs-source-queue-permission.ts @@ -7,8 +7,16 @@ const app = new App(); const stack = new Stack(app, 'aws-cdk-sqs'); -const sourceQueue1 = new Queue(stack, 'SourceQueue1'); -const sourceQueue2 = new Queue(stack, 'SourceQueue2'); +const sourceQueue1 = new Queue(stack, 'SourceQueue1', { + redriveAllowPolicy: { + redrivePermission: RedrivePermission.ALLOW_ALL, + }, +}); +const sourceQueue2 = new Queue(stack, 'SourceQueue2', { + redriveAllowPolicy: { + redrivePermission: RedrivePermission.DENY_ALL, + }, +}); new Queue(stack, 'DeadLetterQueue', { redriveAllowPolicy: { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.assets.json index a71a5fd674bd0..c2d9506a6a2a5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.assets.json @@ -1,7 +1,7 @@ { - "version": "34.0.0", + "version": "36.0.0", "files": { - "9947de492887a96f39e8510bfffd6b8914e1677fe0dab27eb0c043f0c2f6d17a": { + "02a90dd088b90a83c2e917a07e465b621f46664f62ae3c4440f0d0799957e3f4": { "source": { "path": "cdk-stepfunctions-map-distributed-stack.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9947de492887a96f39e8510bfffd6b8914e1677fe0dab27eb0c043f0c2f6d17a.json", + "objectKey": "02a90dd088b90a83c2e917a07e465b621f46664f62ae3c4440f0d0799957e3f4.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.template.json index 0dbcc08458793..ca6011ed5094a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk-stepfunctions-map-distributed-stack.template.json @@ -20,7 +20,7 @@ "StateMachine2E01A3A5": { "Type": "AWS::StepFunctions::StateMachine", "Properties": { - "DefinitionString": "{\"StartAt\":\"My-Map-State\",\"States\":{\"My-Map-State\":{\"Type\":\"Map\",\"End\":true,\"Parameters\":{\"foo\":\"foo\",\"bar.$\":\"$.bar\"},\"ItemsPath\":\"$.inputForMap\",\"ItemProcessor\":{\"ProcessorConfig\":{\"Mode\":\"DISTRIBUTED\",\"ExecutionType\":\"STANDARD\"},\"StartAt\":\"Pass State\",\"States\":{\"Pass State\":{\"Type\":\"Pass\",\"End\":true}}},\"MaxConcurrency\":1}},\"TimeoutSeconds\":30}", + "DefinitionString": "{\"StartAt\":\"My-Map-State\",\"States\":{\"My-Map-State\":{\"Type\":\"Map\",\"End\":true,\"Parameters\":{\"foo\":\"foo\",\"bar.$\":\"$.bar\"},\"ItemsPath\":\"$.inputForMap\",\"ItemProcessor\":{\"ProcessorConfig\":{\"Mode\":\"DISTRIBUTED\",\"ExecutionType\":\"STANDARD\"},\"StartAt\":\"Pass State\",\"States\":{\"Pass State\":{\"Type\":\"Pass\",\"End\":true}}},\"MaxConcurrencyPath\":\"$.maxConcurrency\"}},\"TimeoutSeconds\":30}", "RoleArn": { "Fn::GetAtt": [ "StateMachineRoleB840431D", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk.out index 2313ab5436501..1f0068d32659a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdkstepfunctionsmapdistributedintegDefaultTestDeployAssert69F30423.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdkstepfunctionsmapdistributedintegDefaultTestDeployAssert69F30423.assets.json index 4ea723044a871..173182173d32c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdkstepfunctionsmapdistributedintegDefaultTestDeployAssert69F30423.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/cdkstepfunctionsmapdistributedintegDefaultTestDeployAssert69F30423.assets.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "36.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/integ.json index 49c5aed19a1c4..cd3346dd3eb6c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "36.0.0", "testCases": { "cdk-stepfunctions-map-distributed-integ/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/manifest.json index 1dead0f510155..d0bedf2d3a6b0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "36.0.0", "artifacts": { "cdk-stepfunctions-map-distributed-stack.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9947de492887a96f39e8510bfffd6b8914e1677fe0dab27eb0c043f0c2f6d17a.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/02a90dd088b90a83c2e917a07e465b621f46664f62ae3c4440f0d0799957e3f4.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/tree.json index ed58194eadb4f..fa970c0ce7496 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.js.snapshot/tree.json @@ -77,7 +77,7 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", "aws:cdk:cloudformation:props": { - "definitionString": "{\"StartAt\":\"My-Map-State\",\"States\":{\"My-Map-State\":{\"Type\":\"Map\",\"End\":true,\"Parameters\":{\"foo\":\"foo\",\"bar.$\":\"$.bar\"},\"ItemsPath\":\"$.inputForMap\",\"ItemProcessor\":{\"ProcessorConfig\":{\"Mode\":\"DISTRIBUTED\",\"ExecutionType\":\"STANDARD\"},\"StartAt\":\"Pass State\",\"States\":{\"Pass State\":{\"Type\":\"Pass\",\"End\":true}}},\"MaxConcurrency\":1}},\"TimeoutSeconds\":30}", + "definitionString": "{\"StartAt\":\"My-Map-State\",\"States\":{\"My-Map-State\":{\"Type\":\"Map\",\"End\":true,\"Parameters\":{\"foo\":\"foo\",\"bar.$\":\"$.bar\"},\"ItemsPath\":\"$.inputForMap\",\"ItemProcessor\":{\"ProcessorConfig\":{\"Mode\":\"DISTRIBUTED\",\"ExecutionType\":\"STANDARD\"},\"StartAt\":\"Pass State\",\"States\":{\"Pass State\":{\"Type\":\"Pass\",\"End\":true}}},\"MaxConcurrencyPath\":\"$.maxConcurrency\"}},\"TimeoutSeconds\":30}", "roleArn": { "Fn::GetAtt": [ "StateMachineRoleB840431D", @@ -140,7 +140,7 @@ "path": "cdk-stepfunctions-map-distributed-integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "DeployAssert": { @@ -186,7 +186,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.ts index bb99002f11e69..66f3a38fd6114 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.map-distributed.ts @@ -12,7 +12,7 @@ const stack = new cdk.Stack(app, 'cdk-stepfunctions-map-distributed-stack'); const map = new sfn.Map(stack, 'Map', { stateName: 'My-Map-State', - maxConcurrency: 1, + maxConcurrencyPath: sfn.JsonPath.stringAt('$.maxConcurrency'), itemsPath: sfn.JsonPath.stringAt('$.inputForMap'), parameters: { foo: 'foo', diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index 54d0bc9eb2c62..0963f584b1b32 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -23,8 +23,8 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/aws-service-spec": "^0.0.51", - "@aws-cdk/service-spec-types": "^0.0.51", + "@aws-cdk/aws-service-spec": "^0.0.52", + "@aws-cdk/service-spec-types": "^0.0.52", "chalk": "^4", "diff": "^5.2.0", "fast-deep-equal": "^3.1.3", diff --git a/packages/@aws-cdk/integ-runner/package.json b/packages/@aws-cdk/integ-runner/package.json index 6beaaf3668ddf..a41e82cbcfa34 100644 --- a/packages/@aws-cdk/integ-runner/package.json +++ b/packages/@aws-cdk/integ-runner/package.json @@ -74,7 +74,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "@aws-cdk/aws-service-spec": "^0.0.51", + "@aws-cdk/aws-service-spec": "^0.0.52", "cdk-assets": "0.0.0", "@aws-cdk/cdk-cli-wrapper": "0.0.0", "aws-cdk": "0.0.0", diff --git a/packages/aws-cdk-lib/aws-batch/lib/ecs-container-definition.ts b/packages/aws-cdk-lib/aws-batch/lib/ecs-container-definition.ts index 8d5369d7c88d9..2253cb7d4868c 100644 --- a/packages/aws-cdk-lib/aws-batch/lib/ecs-container-definition.ts +++ b/packages/aws-cdk-lib/aws-batch/lib/ecs-container-definition.ts @@ -1057,6 +1057,11 @@ export class EcsFargateContainerDefinition extends EcsContainerDefinitionBase im this.fargateCpuArchitecture = props.fargateCpuArchitecture; this.fargateOperatingSystemFamily = props.fargateOperatingSystemFamily; + if (this.fargateOperatingSystemFamily?.isWindows() && this.readonlyRootFilesystem) { + // see https://kubernetes.io/docs/concepts/windows/intro/ + throw new Error('Readonly root filesystem is not possible on Windows; write access is required for registry & system processes to run inside the container'); + } + // validates ephemeralStorageSize is within limits if (props.ephemeralStorageSize) { if (props.ephemeralStorageSize.toGibibytes() > 200) { @@ -1071,7 +1076,7 @@ export class EcsFargateContainerDefinition extends EcsContainerDefinitionBase im * @internal */ public _renderContainerDefinition(): CfnJobDefinition.ContainerPropertiesProperty { - return { + let containerDef = { ...super._renderContainerDefinition(), ephemeralStorage: this.ephemeralStorageSize? { sizeInGiB: this.ephemeralStorageSize?.toGibibytes(), @@ -1087,6 +1092,13 @@ export class EcsFargateContainerDefinition extends EcsContainerDefinitionBase im operatingSystemFamily: this.fargateOperatingSystemFamily?._operatingSystemFamily, }, }; + + // readonlyRootFilesystem isn't applicable to Windows, see https://kubernetes.io/docs/concepts/windows/intro/ + if (this.fargateOperatingSystemFamily?.isWindows()) { + containerDef.readonlyRootFilesystem = undefined; + } + + return containerDef; }; } diff --git a/packages/aws-cdk-lib/aws-batch/test/ecs-container-definition.test.ts b/packages/aws-cdk-lib/aws-batch/test/ecs-container-definition.test.ts index 038ba05965020..c771cd19a3d90 100644 --- a/packages/aws-cdk-lib/aws-batch/test/ecs-container-definition.test.ts +++ b/packages/aws-cdk-lib/aws-batch/test/ecs-container-definition.test.ts @@ -2,7 +2,7 @@ import * as path from 'path'; import { capitalizePropertyNames } from './utils'; import { Size, Stack } from '../..'; import * as cdk from '../..'; -import { Template } from '../../assertions'; +import { Match, Template } from '../../assertions'; import { Vpc } from '../../aws-ec2'; import * as ecr from '../../aws-ecr'; import { DockerImageAsset } from '../../aws-ecr-assets'; @@ -1067,4 +1067,31 @@ describe('Fargate containers', () => { }), })).toThrow("ECS Fargate container 'EcsFargateContainer2' specifies 'ephemeralStorageSize' at 201 > 200 GB"); }); + + test('readonlyRootFilesystem can\'t be true with Windows family', () => { + expect(() => new EcsJobDefinition(stack, 'ECSJobDefn', { + container: new EcsFargateContainerDefinition(stack, 'EcsFargateContainer', { + ...defaultContainerProps, + readonlyRootFilesystem: true, + fargateOperatingSystemFamily: ecs.OperatingSystemFamily.WINDOWS_SERVER_2004_CORE, + }), + })).toThrow('Readonly root filesystem is not possible on Windows; write access is required for registry & system processes to run inside the container'); + }); + + test('readonlyRootFilesystem is undefined with Windows family', () => { + // WHEN + new EcsJobDefinition(stack, 'ECSJobDefn', { + container: new EcsFargateContainerDefinition(stack, 'EcsFargateContainer', { + ...defaultContainerProps, + fargateOperatingSystemFamily: ecs.OperatingSystemFamily.WINDOWS_SERVER_2004_CORE, + }), + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Batch::JobDefinition', { + ContainerProperties: { + ReadonlyRootFilesystem: Match.absent(), + }, + }); + }); }); diff --git a/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts b/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts index 99f7a27bc138c..8b6c05bc45122 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/lib/metric.ts @@ -509,8 +509,8 @@ export class Metric implements IMetric { } var dimsArray = Object.keys(dims); - if (dimsArray?.length > 10) { - throw new Error(`The maximum number of dimensions is 10, received ${dimsArray.length}`); + if (dimsArray?.length > 30) { + throw new Error(`The maximum number of dimensions is 30, received ${dimsArray.length}`); } dimsArray.map(key => { diff --git a/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts b/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts index ac0d0186ea014..42f3bd14a1fbb 100644 --- a/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts +++ b/packages/aws-cdk-lib/aws-cloudwatch/test/metrics.test.ts @@ -112,7 +112,7 @@ describe('Metrics', () => { }); - testDeprecated('throws error when there are more than 10 dimensions', () => { + testDeprecated('throws error when there are more than 30 dimensions', () => { expect(() => { new Metric({ namespace: 'Test', @@ -130,13 +130,33 @@ describe('Metrics', () => { dimensionI: 'value9', dimensionJ: 'value10', dimensionK: 'value11', + dimensionL: 'value12', + dimensionM: 'value13', + dimensionN: 'value14', + dimensionO: 'value15', + dimensionP: 'value16', + dimensionQ: 'value17', + dimensionR: 'value18', + dimensionS: 'value19', + dimensionT: 'value20', + dimensionU: 'value21', + dimensionV: 'value22', + dimensionW: 'value23', + dimensionX: 'value24', + dimensionY: 'value25', + dimensionZ: 'value26', + dimensionAA: 'value27', + dimensionAB: 'value28', + dimensionAC: 'value29', + dimensionAD: 'value30', + dimensionAE: 'value31', }, } ); - }).toThrow(/The maximum number of dimensions is 10, received 11/); + }).toThrow(/The maximum number of dimensions is 30, received 31/); }); - test('throws error when there are more than 10 dimensions in dimensionsMap', () => { + test('throws error when there are more than 30 dimensions in dimensionsMap', () => { expect(() => { new Metric({ namespace: 'Test', @@ -154,9 +174,29 @@ describe('Metrics', () => { dimensionI: 'value9', dimensionJ: 'value10', dimensionK: 'value11', + dimensionL: 'value12', + dimensionM: 'value13', + dimensionN: 'value14', + dimensionO: 'value15', + dimensionP: 'value16', + dimensionQ: 'value17', + dimensionR: 'value18', + dimensionS: 'value19', + dimensionT: 'value20', + dimensionU: 'value21', + dimensionV: 'value22', + dimensionW: 'value23', + dimensionX: 'value24', + dimensionY: 'value25', + dimensionZ: 'value26', + dimensionAA: 'value27', + dimensionAB: 'value28', + dimensionAC: 'value29', + dimensionAD: 'value30', + dimensionAE: 'value31', }, } ); - }).toThrow(/The maximum number of dimensions is 10, received 11/); + }).toThrow(/The maximum number of dimensions is 30, received 31/); }); diff --git a/packages/aws-cdk-lib/aws-ec2/README.md b/packages/aws-cdk-lib/aws-ec2/README.md index fef870d937a84..50b7bf8d2c72b 100644 --- a/packages/aws-cdk-lib/aws-ec2/README.md +++ b/packages/aws-cdk-lib/aws-ec2/README.md @@ -189,9 +189,7 @@ are managed by AWS. If you would prefer to use your own managed NAT *instances* instead, specify a different value for the `natGatewayProvider` property, as follows: -[using NAT instances](test/integ.nat-instances.lit.ts) - -The construct will automatically search for the most recent NAT gateway AMI. +The construct will automatically selects the latest version of Amazon Linux 2023. If you prefer to use a custom AMI, use `machineImage: MachineImage.genericLinux({ ... })` and configure the right AMI ID for the regions you want to deploy to. @@ -204,6 +202,25 @@ the VPC: ```ts declare const instanceType: ec2.InstanceType; +const provider = ec2.NatProvider.instanceV2({ + instanceType, + defaultAllowedTraffic: ec2.NatTrafficDirection.OUTBOUND_ONLY, +}); +new ec2.Vpc(this, 'TheVPC', { + natGatewayProvider: provider, +}); +provider.connections.allowFrom(ec2.Peer.ipv4('1.2.3.4/8'), ec2.Port.tcp(80)); +``` + +[using NAT instances](test/integ.nat-instances.lit.ts) [Deprecated] + +The construct will use the AWS official NAT instance AMI, which has already +reached EOL on Dec 31, 2023. For more information, see the following blog post: +[Amazon Linux AMI end of life](https://aws.amazon.com/blogs/aws/update-on-amazon-linux-ami-end-of-life/). + +```ts +declare const instanceType: ec2.InstanceType; + const provider = ec2.NatProvider.instance({ instanceType, defaultAllowedTraffic: ec2.NatTrafficDirection.OUTBOUND_ONLY, diff --git a/packages/aws-cdk-lib/aws-ec2/lib/nat.ts b/packages/aws-cdk-lib/aws-ec2/lib/nat.ts index 48c2ac0de94f2..d8463c742b9fd 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/nat.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/nat.ts @@ -3,9 +3,10 @@ import { Instance } from './instance'; import { InstanceType } from './instance-types'; import { IKeyPair } from './key-pair'; import { CpuCredits } from './launch-template'; -import { IMachineImage, LookupMachineImage } from './machine-image'; +import { AmazonLinuxGeneration, AmazonLinuxImage, IMachineImage, LookupMachineImage } from './machine-image'; import { Port } from './port'; import { ISecurityGroup, SecurityGroup } from './security-group'; +import { UserData } from './user-data'; import { PrivateSubnet, PublicSubnet, RouterType, Vpc } from './vpc'; import * as iam from '../../aws-iam'; import { Fn, Token } from '../../core'; @@ -76,11 +77,29 @@ export abstract class NatProvider { * your own NatProvider based on AutoScaling groups if you need that. * * @see https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html + * + * @deprecated use instanceV2. 'instance' is deprecated since NatInstanceProvider + * uses a instance image that has reached EOL on Dec 31 2023 */ public static instance(props: NatInstanceProps): NatInstanceProvider { return new NatInstanceProvider(props); } + /** + * Use NAT instances to provide NAT services for your VPC + * + * NAT instances are managed by you, but in return allow more configuration. + * + * Be aware that instances created using this provider will not be + * automatically replaced if they are stopped for any reason. You should implement + * your own NatProvider based on AutoScaling groups if you need that. + * + * @see https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html + */ + public static instanceV2(props: NatInstanceProps): NatInstanceProviderV2 { + return new NatInstanceProviderV2(props); + } + /** * Return list of gateways spawned by the provider */ @@ -280,6 +299,9 @@ class NatGatewayProvider extends NatProvider { /** * NAT provider which uses NAT Instances + * + * @deprecated use NatInstanceProviderV2. NatInstanceProvider is deprecated since + * the instance image used has reached EOL on Dec 31 2023 */ export class NatInstanceProvider extends NatProvider implements IConnectable { private gateways: PrefSet = new PrefSet(); @@ -303,7 +325,7 @@ export class NatInstanceProvider extends NatProvider implements IConnectable { (this.props.allowAllTraffic ?? true ? NatTrafficDirection.INBOUND_AND_OUTBOUND : NatTrafficDirection.OUTBOUND_ONLY); // Create the NAT instances. They can share a security group and a Role. - const machineImage = this.props.machineImage || new NatInstanceImage(); + const machineImage = this.props.machineImage ?? new NatInstanceImage(); this._securityGroup = this.props.securityGroup ?? new SecurityGroup(options.vpc, 'NatSecurityGroup', { vpc: options.vpc, description: 'Security Group for NAT instances', @@ -409,6 +431,117 @@ class PrefSet { } } +/** + * Modern NAT provider which uses NAT Instances. + * The instance uses Amazon Linux 2023 as the operating system. + */ +export class NatInstanceProviderV2 extends NatProvider implements IConnectable { + private gateways: PrefSet = new PrefSet(); + private _securityGroup?: ISecurityGroup; + private _connections?: Connections; + + constructor(private readonly props: NatInstanceProps) { + super(); + + if (props.defaultAllowedTraffic !== undefined && props.allowAllTraffic !== undefined) { + throw new Error('Can not specify both of \'defaultAllowedTraffic\' and \'defaultAllowedTraffic\'; prefer \'defaultAllowedTraffic\''); + } + + if (props.keyName && props.keyPair) { + throw new Error('Cannot specify both of \'keyName\' and \'keyPair\'; prefer \'keyPair\''); + } + } + + public configureNat(options: ConfigureNatOptions) { + const defaultDirection = this.props.defaultAllowedTraffic ?? + (this.props.allowAllTraffic ?? true ? NatTrafficDirection.INBOUND_AND_OUTBOUND : NatTrafficDirection.OUTBOUND_ONLY); + + // Create the NAT instances. They can share a security group and a Role. The new NAT instance created uses latest + // Amazon Linux 2023 image. This is important since the original NatInstanceProvider uses an instance image that has + // reached EOL on Dec 31 2023 + const machineImage = this.props.machineImage || new AmazonLinuxImage({ generation: AmazonLinuxGeneration.AMAZON_LINUX_2023 }); + this._securityGroup = this.props.securityGroup ?? new SecurityGroup(options.vpc, 'NatSecurityGroup', { + vpc: options.vpc, + description: 'Security Group for NAT instances', + allowAllOutbound: isOutboundAllowed(defaultDirection), + }); + this._connections = new Connections({ securityGroups: [this._securityGroup] }); + + if (isInboundAllowed(defaultDirection)) { + this.connections.allowFromAnyIpv4(Port.allTraffic()); + } + + // Enable iptables on the instance, enable persistent IP forwarding, configure NAT on instance + // https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html#create-nat-ami + const userData = UserData.forLinux(); + userData.addCommands( + 'yum install iptables-services -y', + 'systemctl enable iptables', + 'systemctl start iptables', + 'echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/custom-ip-forwarding.conf', + 'sudo sysctl -p /etc/sysctl.d/custom-ip-forwarding.conf', + 'sudo /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE', + 'sudo /sbin/iptables -F FORWARD', + 'sudo service iptables save', + ); + + for (const sub of options.natSubnets) { + const natInstance = new Instance(sub, 'NatInstance', { + instanceType: this.props.instanceType, + machineImage, + sourceDestCheck: false, // Required for NAT + vpc: options.vpc, + vpcSubnets: { subnets: [sub] }, + securityGroup: this._securityGroup, + keyPair: this.props.keyPair, + keyName: this.props.keyName, + userData, + }); + // NAT instance routes all traffic, both ways + this.gateways.add(sub.availabilityZone, natInstance); + } + + // Add routes to them in the private subnets + for (const sub of options.privateSubnets) { + this.configureSubnet(sub); + } + } + + /** + * The Security Group associated with the NAT instances + */ + public get securityGroup(): ISecurityGroup { + if (!this._securityGroup) { + throw new Error('Pass the NatInstanceProvider to a Vpc before accessing \'securityGroup\''); + } + return this._securityGroup; + } + + /** + * Manage the Security Groups associated with the NAT instances + */ + public get connections(): Connections { + if (!this._connections) { + throw new Error('Pass the NatInstanceProvider to a Vpc before accessing \'connections\''); + } + return this._connections; + } + + public get configuredGateways(): GatewayConfig[] { + return this.gateways.values().map(x => ({ az: x[0], gatewayId: x[1].instanceId })); + } + + public configureSubnet(subnet: PrivateSubnet) { + const az = subnet.availabilityZone; + const gatewayId = this.gateways.pick(az).instanceId; + subnet.addRoute('DefaultRoute', { + routerType: RouterType.INSTANCE, + routerId: gatewayId, + enablesInternetConnectivity: true, + }); + } +} + /** * Machine image representing the latest NAT instance image * diff --git a/packages/aws-cdk-lib/aws-ec2/test/vpc.test.ts b/packages/aws-cdk-lib/aws-ec2/test/vpc.test.ts index 52bad89bb72dc..0fcd7e08734f9 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/vpc.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/vpc.test.ts @@ -1578,6 +1578,50 @@ describe('vpc', () => { }); + test('Can configure NAT instances V2 instead of NAT gateways', () => { + // GIVEN + const stack = getTestStack(); + + // WHEN + const natGatewayProvider = NatProvider.instanceV2({ + instanceType: new InstanceType('q86.mega'), + machineImage: new GenericLinuxImage({ + 'us-east-1': 'ami-1', + }), + }); + new Vpc(stack, 'TheVPC', { natGatewayProvider }); + + // THEN + Template.fromStack(stack).resourceCountIs('AWS::EC2::Instance', 3); + Template.fromStack(stack).hasResourceProperties('AWS::EC2::Instance', { + ImageId: 'ami-1', + InstanceType: 'q86.mega', + SourceDestCheck: false, + }); + Template.fromStack(stack).hasResourceProperties('AWS::EC2::Route', { + RouteTableId: { Ref: 'TheVPCPrivateSubnet1RouteTableF6513BC2' }, + DestinationCidrBlock: '0.0.0.0/0', + InstanceId: { Ref: 'TheVPCPublicSubnet1NatInstanceCC514192' }, + }); + Template.fromStack(stack).hasResourceProperties('AWS::EC2::SecurityGroup', { + SecurityGroupEgress: [ + { + CidrIp: '0.0.0.0/0', + Description: 'Allow all outbound traffic by default', + IpProtocol: '-1', + }, + ], + SecurityGroupIngress: [ + { + CidrIp: '0.0.0.0/0', + Description: 'from 0.0.0.0/0:ALL TRAFFIC', + IpProtocol: '-1', + }, + ], + }); + + }); + test('natGateways controls amount of NAT instances', () => { // GIVEN const stack = getTestStack(); @@ -1597,6 +1641,25 @@ describe('vpc', () => { Template.fromStack(stack).resourceCountIs('AWS::EC2::Instance', 1); }); + test('natGateways controls amount of NAT instances V2', () => { + // GIVEN + const stack = getTestStack(); + + // WHEN + new Vpc(stack, 'TheVPC', { + natGatewayProvider: NatProvider.instanceV2({ + instanceType: new InstanceType('q86.mega'), + machineImage: new GenericLinuxImage({ + 'us-east-1': 'ami-1', + }), + }), + natGateways: 1, + }); + + // THEN + Template.fromStack(stack).resourceCountIs('AWS::EC2::Instance', 1); + }); + testDeprecated('can configure Security Groups of NAT instances with allowAllTraffic false', () => { // GIVEN const stack = getTestStack(); diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/README.md b/packages/aws-cdk-lib/aws-ecs-patterns/README.md index ab4991275a62e..6dda31ecccfaf 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/README.md +++ b/packages/aws-cdk-lib/aws-ecs-patterns/README.md @@ -921,56 +921,6 @@ const scheduledFargateTask = new ecsPatterns.ScheduledFargateTask(this, 'Schedul }); ``` -### Use the REMOVE_DEFAULT_DESIRED_COUNT feature flag - -The REMOVE_DEFAULT_DESIRED_COUNT feature flag is used to override the default desiredCount that is autogenerated by the CDK. This will set the desiredCount of any service created by any of the following constructs to be undefined. - -* ApplicationLoadBalancedEc2Service -* ApplicationLoadBalancedFargateService -* NetworkLoadBalancedEc2Service -* NetworkLoadBalancedFargateService -* QueueProcessingEc2Service -* QueueProcessingFargateService - -If a desiredCount is not passed in as input to the above constructs, CloudFormation will either create a new service to start up with a desiredCount of 1, or update an existing service to start up with the same desiredCount as prior to the update. - -To enable the feature flag, ensure that the REMOVE_DEFAULT_DESIRED_COUNT flag within an application stack context is set to true, like so: - -```ts -declare const stack: Stack; -stack.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); -``` - -The following is an example of an application with the REMOVE_DEFAULT_DESIRED_COUNT feature flag enabled: - -```ts nofixture -import { Construct } from 'constructs'; -import { App, Stack } from 'aws-cdk-lib'; -import * as ec2 from 'aws-cdk-lib/aws-ec2'; -import * as ecs from 'aws-cdk-lib/aws-ecs'; -import * as ecsPatterns from 'aws-cdk-lib/aws-ecs-patterns'; -import * as cxapi from 'aws-cdk-lib/cx-api'; -import * as path from 'path'; - -class MyStack extends Stack { - constructor(scope: Construct, id: string) { - super(scope, id); - - this.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true); - - const vpc = new ec2.Vpc(this, 'VPC', { - maxAzs: 2, - }); - - new ecsPatterns.QueueProcessingFargateService(this, 'QueueProcessingService', { - vpc, - memoryLimitMiB: 512, - image: new ecs.AssetImage(path.join(__dirname, '..', 'sqs-reader')), - }); - } -} -``` - ### Deploy application and metrics sidecar The following is an example of deploying an application along with a metrics sidecar container that utilizes `dockerLabels` for discovery: @@ -1093,4 +1043,33 @@ const scheduledFargateTask = new ecsPatterns.ScheduledFargateTask(this, 'Schedul }, ], }); +``` + +### Use custom ephemeral storage for ECS Fargate tasks + +You can pass a custom ephemeral storage (21GiB - 200GiB) to ECS Fargate tasks on Fargate Platform Version 1.4.0 or later. + +```ts +const vpc = new ec2.Vpc(this, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); +const cluster = new ecs.Cluster(this, 'FargateCluster', { vpc }); + +const applicationLoadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'ALBFargateServiceWithCustomEphemeralStorage', { + cluster, + memoryLimitMiB: 1024, + cpu: 512, + ephemeralStorageGiB: 21, + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + }, +}); + +const networkLoadBalancedFargateService = new ecsPatterns.NetworkLoadBalancedFargateService(this, 'NLBFargateServiceWithCustomEphemeralStorage', { + cluster, + memoryLimitMiB: 1024, + cpu: 512, + ephemeralStorageGiB: 200, + taskImageOptions: { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + }, +}); ``` \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts index 626f35bff4150..8f734fe2fb461 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts @@ -78,8 +78,7 @@ export interface ApplicationLoadBalancedServiceBaseProps { * The desired number of instantiations of the task definition to keep running on the service. * The minimum value is 1 * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; - * if true, the default is 1 for all new services and uses the existing services desired count + * @default - The default is 1 for all new services and uses the existing service's desired count * when updating an existing service. */ readonly desiredCount?: number; diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts index 219aa491fcdbe..11898cbfb511c 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts @@ -50,8 +50,7 @@ export interface ApplicationMultipleTargetGroupsServiceBaseProps { /** * The desired number of instantiations of the task definition to keep running on the service. * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; - * if true, the default is 1 for all new services and uses the existing services desired count + * @default - The default is 1 for all new services and uses the existing service's desired count * when updating an existing service. */ readonly desiredCount?: number; diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/fargate-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/fargate-service-base.ts index 823640674fd59..d8df18c5501db 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/fargate-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/fargate-service-base.ts @@ -61,6 +61,17 @@ export interface FargateServiceBaseProps { */ readonly memoryLimitMiB?: number; + /** + * The amount (in GiB) of ephemeral storage to be allocated to the task. + * + * The minimum supported value is `21` GiB and the maximum supported value is `200` GiB. + * + * Only supported in Fargate platform version 1.4.0 or later. + * + * @default Undefined, in which case, the task will receive 20GiB ephemeral storage. + */ + readonly ephemeralStorageGiB?: number; + /** * The platform version on which to run your service. * diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts index 45f58dd517a12..1939c0fd0684a 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts @@ -66,8 +66,7 @@ export interface NetworkLoadBalancedServiceBaseProps { * The desired number of instantiations of the task definition to keep running on the service. * The minimum value is 1 * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; - * if true, the default is 1 for all new services and uses the existing services desired count + * @default - The default is 1 for all new services and uses the existing service's desired count * when updating an existing service. */ readonly desiredCount?: number; diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts index 5eeaa3ba9bf82..72d58e12ee2f2 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts @@ -41,8 +41,7 @@ export interface NetworkMultipleTargetGroupsServiceBaseProps { * The desired number of instantiations of the task definition to keep running on the service. * The minimum value is 1 * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; - * if true, the default is 1 for all new services and uses the existing services desired count + * @default - The default is 1 for all new services and uses the existing service's desired count * when updating an existing service. */ readonly desiredCount?: number; diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts index beb207309b217..d61567e55670e 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/queue-processing-service-base.ts @@ -58,8 +58,7 @@ export interface QueueProcessingServiceBaseProps { /** * The desired number of instantiations of the task definition to keep running on the service. * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is 1; - * if true, the minScalingCapacity is 1 for all new services and uses the existing services desired count + * @default - The minScalingCapacity is 1 for all new services and uses the existing services desired count * when updating an existing service. * @deprecated - Use `minScalingCapacity` or a literal object instead. */ @@ -128,14 +127,14 @@ export interface QueueProcessingServiceBaseProps { /** * Maximum capacity to scale to. * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is (desiredTaskCount * 2); if true, the default is 2. + * @default 2 */ readonly maxScalingCapacity?: number; /** * Minimum capacity to scale to. * - * @default - If the feature flag, ECS_REMOVE_DEFAULT_DESIRED_COUNT is false, the default is the desiredTaskCount; if true, the default is 1. + * @default 1 */ readonly minScalingCapacity?: number; diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts index 5c101ee7dd964..4bc76a56b73dc 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts @@ -74,6 +74,7 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc this.taskDefinition = new FargateTaskDefinition(this, 'TaskDef', { memoryLimitMiB: props.memoryLimitMiB, cpu: props.cpu, + ephemeralStorageGiB: props.ephemeralStorageGiB, executionRole: taskImageOptions.executionRole, taskRole: taskImageOptions.taskRole, family: taskImageOptions.family, diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts index df9ed2cfd79e3..aca6f639ae0ac 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts @@ -65,6 +65,7 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu this.taskDefinition = new FargateTaskDefinition(this, 'TaskDef', { memoryLimitMiB: props.memoryLimitMiB, cpu: props.cpu, + ephemeralStorageGiB: props.ephemeralStorageGiB, executionRole: taskImageOptions.executionRole, taskRole: taskImageOptions.taskRole, family: taskImageOptions.family, diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts index a7c2c01f6d9f7..993a17a92aed2 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts @@ -59,6 +59,7 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic this.taskDefinition = new FargateTaskDefinition(this, 'TaskDef', { memoryLimitMiB: props.memoryLimitMiB, cpu: props.cpu, + ephemeralStorageGiB: props.ephemeralStorageGiB, executionRole: taskImageOptions.executionRole, taskRole: taskImageOptions.taskRole, family: taskImageOptions.family, diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts index 21d97d8e9d5cb..9c6cc3c66649f 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts @@ -65,6 +65,7 @@ export class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTa this.taskDefinition = new FargateTaskDefinition(this, 'TaskDef', { memoryLimitMiB: props.memoryLimitMiB, cpu: props.cpu, + ephemeralStorageGiB: props.ephemeralStorageGiB, executionRole: taskImageOptions.executionRole, taskRole: taskImageOptions.taskRole, family: taskImageOptions.family, diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index f2f26d5e8669d..77d28ea2821d0 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -77,6 +77,7 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { this.taskDefinition = new FargateTaskDefinition(this, 'QueueProcessingTaskDef', { memoryLimitMiB: props.memoryLimitMiB || 512, cpu: props.cpu || 256, + ephemeralStorageGiB: props.ephemeralStorageGiB, family: props.family, runtimePlatform: props.runtimePlatform, }); diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts index c7725538ca7e2..bfd63a8fa2fc9 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts @@ -76,6 +76,7 @@ export class ScheduledFargateTask extends ScheduledTaskBase { this.taskDefinition = new FargateTaskDefinition(this, 'ScheduledTaskDef', { memoryLimitMiB: taskImageOptions.memoryLimitMiB || 512, cpu: taskImageOptions.cpu || 256, + ephemeralStorageGiB: taskImageOptions.ephemeralStorageGiB, }); this.taskDefinition.addContainer('ScheduledContainer', { image: taskImageOptions.image, @@ -97,6 +98,9 @@ export class ScheduledFargateTask extends ScheduledTaskBase { if (props.memoryLimitMiB) { Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs-patterns:propertyIgnored', 'Property \'memoryLimitMiB\' is ignored, use \'scheduledFargateTaskImageOptions.memoryLimitMiB\' instead.'); } + if (props.ephemeralStorageGiB) { + Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs-patterns:propertyIgnored', 'Property \'ephemeralStorageGiB\' is ignored, use \'scheduledFargateTaskImageOptions.ephemeralStorageGiB\' instead.'); + } if (props.runtimePlatform) { Annotations.of(this).addWarningV2('@aws-cdk/aws-ecs-patterns:propertyIgnored', 'Property \'runtimePlatform\' is ignored.'); } diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/load-balanced-fargate-service-v2.test.ts b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/load-balanced-fargate-service-v2.test.ts index 53c34c69b5dde..b7417f4ce962f 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/load-balanced-fargate-service-v2.test.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/load-balanced-fargate-service-v2.test.ts @@ -225,6 +225,7 @@ describe('Application Load Balancer', () => { cpu: 256, assignPublicIp: true, memoryLimitMiB: 512, + ephemeralStorageGiB: 50, desiredCount: 3, enableECSManagedTags: true, enableExecuteCommand: true, @@ -349,6 +350,9 @@ describe('Application Load Balancer', () => { }, ], Cpu: '256', + EphemeralStorage: { + SizeInGiB: 50, + }, ExecutionRoleArn: { 'Fn::GetAtt': [ 'ExecutionRole605A040B', @@ -847,6 +851,7 @@ describe('Network Load Balancer', () => { cpu: 256, assignPublicIp: true, memoryLimitMiB: 512, + ephemeralStorageGiB: 80, desiredCount: 3, enableECSManagedTags: true, enableExecuteCommand: true, @@ -955,6 +960,9 @@ describe('Network Load Balancer', () => { }, ], Cpu: '256', + EphemeralStorage: { + SizeInGiB: 80, + }, ExecutionRoleArn: { 'Fn::GetAtt': [ 'ExecutionRole605A040B', diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts index f69c898ba7c1a..b4290f9c15f54 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.test.ts @@ -497,6 +497,7 @@ testDeprecated('test Fargate queue worker service construct - with optional prop new ecsPatterns.QueueProcessingFargateService(stack, 'Service', { cluster, memoryLimitMiB: 512, + ephemeralStorageGiB: 100, image: ecs.ContainerImage.fromRegistry('test'), command: ['-c', '4', 'amazon.com'], enableLogging: false, @@ -565,6 +566,9 @@ testDeprecated('test Fargate queue worker service construct - with optional prop }), ], Family: 'fargate-task-family', + EphemeralStorage: { + SizeInGiB: 100, + }, }); }); diff --git a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts index 8b318fd8b1167..3e98cac7e023e 100644 --- a/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts +++ b/packages/aws-cdk-lib/aws-ecs-patterns/test/fargate/scheduled-fargate-task.test.ts @@ -92,6 +92,7 @@ test('Can create a scheduled Fargate Task - with optional props', () => { image: ecs.ContainerImage.fromRegistry('henk'), memoryLimitMiB: 512, cpu: 2, + ephemeralStorageGiB: 100, environment: { TRIGGER: 'CloudWatch Events' }, }, desiredTaskCount: 2, @@ -162,6 +163,9 @@ test('Can create a scheduled Fargate Task - with optional props', () => { Name: 'ScheduledContainer', }, ], + EphemeralStorage: { + SizeInGiB: 100, + }, }); }); diff --git a/packages/aws-cdk-lib/aws-ecs/lib/runtime-platform.ts b/packages/aws-cdk-lib/aws-ecs/lib/runtime-platform.ts index 37d760c62e657..250e64a1f9ca4 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/runtime-platform.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/runtime-platform.ts @@ -88,6 +88,13 @@ export class OperatingSystemFamily { * @param _operatingSystemFamily The operating system family. */ private constructor(public readonly _operatingSystemFamily: string) { } + + /** + * Returns true if the operating system family is Windows + */ + public isWindows(): boolean { + return this._operatingSystemFamily?.toLowerCase().startsWith('windows') ? true : false; + } } /** @@ -107,4 +114,4 @@ export interface RuntimePlatform { * @default - Undefined. */ readonly operatingSystemFamily?: OperatingSystemFamily; -} \ No newline at end of file +} diff --git a/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts b/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts index 9aee08d143e68..4e3d4c7751d8a 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts @@ -70,6 +70,14 @@ export enum NodegroupAmiType { * Windows Full 2022 (x86-64) */ WINDOWS_FULL_2022_X86_64 = 'WINDOWS_FULL_2022_x86_64', + /** + * Amazon Linux 2023 (x86-64) + */ + AL2023_X86_64_STANDARD = 'AL2023_x86_64_STANDARD', + /** + * Amazon Linux 2023 (ARM-64) + */ + AL2023_ARM_64_STANDARD = 'AL2023_ARM_64_STANDARD', } /** diff --git a/packages/aws-cdk-lib/aws-sqs/lib/queue.ts b/packages/aws-cdk-lib/aws-sqs/lib/queue.ts index c8a9c758978a9..f425536f89937 100644 --- a/packages/aws-cdk-lib/aws-sqs/lib/queue.ts +++ b/packages/aws-cdk-lib/aws-sqs/lib/queue.ts @@ -411,7 +411,7 @@ export class Queue extends QueueBase { redrivePermission: props.redriveAllowPolicy.redrivePermission // When `sourceQueues` is provided in `redriveAllowPolicy`, `redrivePermission` defaults to allow specified queues (`BY_QUEUE`); // otherwise, it defaults to allow all queues (`ALLOW_ALL`). - ?? props.redriveAllowPolicy.sourceQueues ? RedrivePermission.BY_QUEUE : RedrivePermission.ALLOW_ALL, + ?? (props.redriveAllowPolicy.sourceQueues ? RedrivePermission.BY_QUEUE : RedrivePermission.ALLOW_ALL), sourceQueueArns: props.redriveAllowPolicy.sourceQueues?.map(q => q.queueArn), } : undefined; diff --git a/packages/aws-cdk-lib/aws-sqs/test/sqs.test.ts b/packages/aws-cdk-lib/aws-sqs/test/sqs.test.ts index 956c8a77cdd7a..0ae7bc2919ef5 100644 --- a/packages/aws-cdk-lib/aws-sqs/test/sqs.test.ts +++ b/packages/aws-cdk-lib/aws-sqs/test/sqs.test.ts @@ -753,6 +753,33 @@ describe('redriveAllowPolicy', () => { }); }); + test.each([ + [sqs.RedrivePermission.ALLOW_ALL, 'allowAll'], + [sqs.RedrivePermission.DENY_ALL, 'denyAll'], + ])('redrive permission can be set to %s', (permission, expected) => { + const stack = new Stack(); + new sqs.Queue(stack, 'Queue', { + redriveAllowPolicy: { + redrivePermission: permission, + }, + }); + + Template.fromStack(stack).templateMatches({ + 'Resources': { + 'Queue4A7E3555': { + 'Type': 'AWS::SQS::Queue', + 'Properties': { + 'RedriveAllowPolicy': { + 'redrivePermission': expected, + }, + }, + 'UpdateReplacePolicy': 'Delete', + 'DeletionPolicy': 'Delete', + }, + }, + }); + }); + test('explicit specification of dead letter source queues', () => { const stack = new Stack(); const sourceQueue1 = new sqs.Queue(stack, 'SourceQueue1'); diff --git a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/map-base.ts b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/map-base.ts index 95e8532a64375..2359558b33624 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/map-base.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/map-base.ts @@ -90,9 +90,24 @@ export interface MapBaseProps { * * An upper bound on the number of iterations you want running at once. * + * @see + * https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-additional-fields + * * @default - full concurrency */ readonly maxConcurrency?: number; + + /** + * MaxConcurrencyPath + * + * A JsonPath that specifies the maximum concurrency dynamically from the state input. + * + * @see + * https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-additional-fields + * + * @default - full concurrency + */ + readonly maxConcurrencyPath?: string; } /** @@ -122,6 +137,7 @@ export abstract class MapBase extends State implements INextable { public readonly endStates: INextable[]; private readonly maxConcurrency?: number; + private readonly maxConcurrencyPath?: string; protected readonly itemsPath?: string; protected readonly itemSelector?: { [key: string]: any }; @@ -129,6 +145,7 @@ export abstract class MapBase extends State implements INextable { super(scope, id, props); this.endStates = [this]; this.maxConcurrency = props.maxConcurrency; + this.maxConcurrencyPath = props.maxConcurrencyPath; this.itemsPath = props.itemsPath; this.itemSelector = props.itemSelector; } @@ -156,7 +173,8 @@ export abstract class MapBase extends State implements INextable { ...this.renderItemsPath(), ...this.renderItemSelector(), ...this.renderItemProcessor(), - MaxConcurrency: this.maxConcurrency, + ...(this.maxConcurrency && { MaxConcurrency: this.maxConcurrency }), + ...(this.maxConcurrencyPath && { MaxConcurrencyPath: renderJsonPath(this.maxConcurrencyPath) }), }; } @@ -174,6 +192,10 @@ export abstract class MapBase extends State implements INextable { errors.push('maxConcurrency has to be a positive integer'); } + if (this.maxConcurrency && this.maxConcurrencyPath) { + errors.push('Provide either `maxConcurrency` or `maxConcurrencyPath`, but not both'); + } + return errors; } diff --git a/packages/aws-cdk-lib/aws-stepfunctions/test/map.test.ts b/packages/aws-cdk-lib/aws-stepfunctions/test/map.test.ts index a082bf1bea61f..be09ab9282609 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/test/map.test.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions/test/map.test.ts @@ -45,6 +45,49 @@ describe('Map State', () => { }); }), + test('State Machine With Map State and MaxConcurrencyPath', () => { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + const map = new stepfunctions.Map(stack, 'Map State', { + stateName: 'My-Map-State', + maxConcurrencyPath: stepfunctions.JsonPath.stringAt('$.maxConcurrencyPath'), + itemsPath: stepfunctions.JsonPath.stringAt('$.inputForMap'), + parameters: { + foo: 'foo', + bar: stepfunctions.JsonPath.stringAt('$.bar'), + }, + }); + map.iterator(new stepfunctions.Pass(stack, 'Pass State')); + + // THEN + expect(render(map)).toStrictEqual({ + StartAt: 'My-Map-State', + States: { + 'My-Map-State': { + Type: 'Map', + End: true, + Parameters: { + 'foo': 'foo', + 'bar.$': '$.bar', + }, + Iterator: { + StartAt: 'Pass State', + States: { + 'Pass State': { + Type: 'Pass', + End: true, + }, + }, + }, + ItemsPath: '$.inputForMap', + MaxConcurrencyPath: '$.maxConcurrencyPath', + }, + }, + }); + }), + test('State Machine With Map State and ResultSelector', () => { // GIVEN const stack = new cdk.Stack(); @@ -395,6 +438,21 @@ describe('Map State', () => { expect(() => app.synth()).toThrow(/maxConcurrency has to be a positive integer/); }), + test('fails in synthesis when maxConcurrency and maxConcurrencyPath are both defined', () => { + const app = createAppWithMap((stack) => { + const map = new stepfunctions.Map(stack, 'Map State', { + maxConcurrency: 1, + maxConcurrencyPath: stepfunctions.JsonPath.stringAt('$.maxConcurrencyPath'), + itemsPath: stepfunctions.JsonPath.stringAt('$.inputForMap'), + }); + map.iterator(new stepfunctions.Pass(stack, 'Pass State')); + + return map; + }); + + expect(() => app.synth()).toThrow(/Provide either `maxConcurrency` or `maxConcurrencyPath`, but not both/); + }), + test('does not fail synthesis when maxConcurrency is a jsonPath', () => { const app = createAppWithMap((stack) => { const map = new stepfunctions.Map(stack, 'Map State', { diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 85671434b9163..cc3bd7c682bbe 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -135,7 +135,7 @@ "mime-types": "^2.1.35" }, "devDependencies": { - "@aws-cdk/aws-service-spec": "^0.0.51", + "@aws-cdk/aws-service-spec": "^0.0.52", "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/custom-resource-handlers": "0.0.0", "@aws-cdk/pkglint": "0.0.0", diff --git a/tools/@aws-cdk/spec2cdk/package.json b/tools/@aws-cdk/spec2cdk/package.json index 1991d96ecc446..3c9f8b5e968da 100644 --- a/tools/@aws-cdk/spec2cdk/package.json +++ b/tools/@aws-cdk/spec2cdk/package.json @@ -32,9 +32,9 @@ }, "license": "Apache-2.0", "dependencies": { - "@aws-cdk/aws-service-spec": "^0.0.51", - "@aws-cdk/service-spec-importers": "^0.0.22", - "@aws-cdk/service-spec-types": "^0.0.51", + "@aws-cdk/aws-service-spec": "^0.0.52", + "@aws-cdk/service-spec-importers": "^0.0.23", + "@aws-cdk/service-spec-types": "^0.0.52", "@cdklabs/tskb": "^0.0.3", "@cdklabs/typewriter": "^0.0.3", "camelcase": "^6", diff --git a/version.v2.json b/version.v2.json index 54fc3903e4853..7239f92c1d1a9 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.130.0", - "alphaVersion": "2.130.0-alpha.0" + "version": "2.131.0", + "alphaVersion": "2.131.0-alpha.0" } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 66beee8e03dd3..2cbafb6831dea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -56,12 +56,12 @@ resolved "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.0.1.tgz#6dc9b7cdb22ff622a7176141197962360c33e9ac" integrity sha512-DDt4SLdLOwWCjGtltH4VCST7hpOI5DzieuhGZsBpZ+AgJdSI2GCjklCXm0GCTwJG/SolkL5dtQXyUKgg9luBDg== -"@aws-cdk/aws-service-spec@^0.0.51": - version "0.0.51" - resolved "https://registry.npmjs.org/@aws-cdk/aws-service-spec/-/aws-service-spec-0.0.51.tgz#c094ac441140bd245c35d4d6b9e1e941e01d239c" - integrity sha512-eqDGgFuJLeKVmc4+ulRMm2sagyZhM7guc/TlXNO4zT4swdXPpNJLoSAuuJJBLEu2KDYw2EZDY4Fa33SQnUsavg== +"@aws-cdk/aws-service-spec@^0.0.52": + version "0.0.52" + resolved "https://registry.npmjs.org/@aws-cdk/aws-service-spec/-/aws-service-spec-0.0.52.tgz#426bf8adebc825b49b152a3ba89d6816fa8be903" + integrity sha512-SJA4xtG2y5NpTmtKtFNbrYh6BaFgKEcr7ye8N+S4H3KByXIa0NLOh5bPTVBjvyXiRPDJ9q39Xu433vxC3BsDhg== dependencies: - "@aws-cdk/service-spec-types" "^0.0.51" + "@aws-cdk/service-spec-types" "^0.0.52" "@cdklabs/tskb" "^0.0.3" "@aws-cdk/lambda-layer-kubectl-v24@^2.0.242": @@ -69,12 +69,12 @@ resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v24/-/lambda-layer-kubectl-v24-2.0.242.tgz#4273a5ad7714f933a7eba155eb9280823086db71" integrity sha512-7/wIOo685tmrEe4hh6zqDELhBZh5OQGf3Hd2FU2Vnwy2ZubW8qTmEw5gqJCsCrGKeYDoa1BcVhDRZ/nzjkaqyA== -"@aws-cdk/service-spec-importers@^0.0.22": - version "0.0.22" - resolved "https://registry.npmjs.org/@aws-cdk/service-spec-importers/-/service-spec-importers-0.0.22.tgz#05a3f200e2bcfd59d81fbbd6643930705547419b" - integrity sha512-GWAglOy/9kVNPJtKuDt6RX+uMgszaKBPrRwHKuvUDlYvGBcB7XT1e0e7sPtSArFCALHQuu1fapNpunC5pjEytw== +"@aws-cdk/service-spec-importers@^0.0.23": + version "0.0.23" + resolved "https://registry.npmjs.org/@aws-cdk/service-spec-importers/-/service-spec-importers-0.0.23.tgz#eaade0ef38a2be6fe2932d6ba2a0f46c97a72dc8" + integrity sha512-U0e3AUfnmf/wFScWbXJHUIAqYOmIzhAbVuzvKVbVc5vC9o0OsQvjvdb5vnOnLbsjjgxCDsHtWF4nZhkxRIBK3g== dependencies: - "@aws-cdk/service-spec-types" "^0.0.49" + "@aws-cdk/service-spec-types" "^0.0.52" "@cdklabs/tskb" "^0.0.3" ajv "^6" canonicalize "^2.0.0" @@ -85,17 +85,10 @@ glob "^8" sort-json "^2.0.1" -"@aws-cdk/service-spec-types@^0.0.49": - version "0.0.49" - resolved "https://registry.npmjs.org/@aws-cdk/service-spec-types/-/service-spec-types-0.0.49.tgz#1adc059466cd4107b6fd2d424c663bf6964ee1ac" - integrity sha512-j8UZXdWjplG+HcmpejNlJcEHJzkoVdj4hhxa8cTW+PNqqw8j0nAniZbS58qI+dcg7zFB1NA0M76gX2ns7ExgTQ== - dependencies: - "@cdklabs/tskb" "^0.0.3" - -"@aws-cdk/service-spec-types@^0.0.51": - version "0.0.51" - resolved "https://registry.npmjs.org/@aws-cdk/service-spec-types/-/service-spec-types-0.0.51.tgz#33976fe494a9fd6d7cf4128b449ac0be0580b85b" - integrity sha512-WL1sxvpXAp2wDtXrSqpvGWMaStFgXycqksGBp98wGx8Motac8jbkPwVcTWde/4VOL1cjJ49w49c4xroXgQ0G7A== +"@aws-cdk/service-spec-types@^0.0.52": + version "0.0.52" + resolved "https://registry.npmjs.org/@aws-cdk/service-spec-types/-/service-spec-types-0.0.52.tgz#08824dcf78dbf8435c25c771ddd7a1e89897c3a0" + integrity sha512-vVoZPgEmkUPeTVJSQ9iyXTiwnb6GiBbntJdnsWTr6I9ao66TuU9HijEcAQHxkC7CxTkian+3KSX/NTl01Klm0A== dependencies: "@cdklabs/tskb" "^0.0.3"