diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/EcsExternalTestDefaultTestDeployAssert9F72078B.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/EcsExternalTestDefaultTestDeployAssert9F72078B.assets.json new file mode 100644 index 0000000000000..e07b6b8540943 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/EcsExternalTestDefaultTestDeployAssert9F72078B.assets.json @@ -0,0 +1,20 @@ +{ + "version": "48.0.0", + "files": { + "108555c01cfc2f89d6e814b83ffc1c6370ea2ed53c95cb754a89b290f4b82e46": { + "displayName": "EcsExternalTestDefaultTestDeployAssert9F72078B Template", + "source": { + "path": "EcsExternalTestDefaultTestDeployAssert9F72078B.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-32ac6aa5": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "108555c01cfc2f89d6e814b83ffc1c6370ea2ed53c95cb754a89b290f4b82e46.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-events-targets/test/ecs/integ.event-external-task.js.snapshot/EcsExternalTestDefaultTestDeployAssert9F72078B.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/EcsExternalTestDefaultTestDeployAssert9F72078B.template.json new file mode 100644 index 0000000000000..bbf856bb0d4a7 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/EcsExternalTestDefaultTestDeployAssert9F72078B.template.json @@ -0,0 +1,314 @@ +{ + "Resources": { + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/zPQM9AzUEwsL9ZNTsnWzclM0gsuSUzO1snLT0nVyyrWLzMy0jO01DNQzCrOzNQtKs0rycxN1QuC0ABRpOyqPQAAAA==" + }, + "Metadata": { + "aws:cdk:path": "EcsExternalTest/DefaultTest/DeployAssert/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "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-events-targets/test/ecs/integ.event-external-task.js.snapshot/aws-ecs-integ-external.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/aws-ecs-integ-external.assets.json new file mode 100644 index 0000000000000..055c922b20ff3 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/aws-ecs-integ-external.assets.json @@ -0,0 +1,20 @@ +{ + "version": "48.0.0", + "files": { + "70165d4ae45be09cc287d78a00544a4202f7cc0d17ba3e44dd7615cb508cc937": { + "displayName": "aws-ecs-integ-external Template", + "source": { + "path": "aws-ecs-integ-external.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-591c7d7e": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "70165d4ae45be09cc287d78a00544a4202f7cc0d17ba3e44dd7615cb508cc937.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-events-targets/test/ecs/integ.event-external-task.js.snapshot/aws-ecs-integ-external.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/aws-ecs-integ-external.template.json new file mode 100644 index 0000000000000..9e9281848f48e --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/aws-ecs-integ-external.template.json @@ -0,0 +1,942 @@ +{ + "Resources": { + "EcsCluster97242B84": { + "Type": "AWS::ECS::Cluster", + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Resource" + } + }, + "EcsClusterVpc779914AB": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc" + } + ] + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/Resource" + } + }, + "EcsClusterVpcPublicSubnet1Subnet4AC37B0F": { + "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-integ-external/EcsCluster/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/Subnet" + } + }, + "EcsClusterVpcPublicSubnet1RouteTable4AE3113D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/RouteTable" + } + }, + "EcsClusterVpcPublicSubnet1RouteTableAssociation49C4CDBB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EcsClusterVpcPublicSubnet1RouteTable4AE3113D" + }, + "SubnetId": { + "Ref": "EcsClusterVpcPublicSubnet1Subnet4AC37B0F" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/RouteTableAssociation" + } + }, + "EcsClusterVpcPublicSubnet1DefaultRoute8C7EFC96": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "EcsClusterVpcIGW3663B083" + }, + "RouteTableId": { + "Ref": "EcsClusterVpcPublicSubnet1RouteTable4AE3113D" + } + }, + "DependsOn": [ + "EcsClusterVpcVPCGW944296C0" + ], + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/DefaultRoute" + } + }, + "EcsClusterVpcPublicSubnet1EIP2D3759A3": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1" + } + ] + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/EIP" + } + }, + "EcsClusterVpcPublicSubnet1NATGateway2F1E7764": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "EcsClusterVpcPublicSubnet1EIP2D3759A3", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "EcsClusterVpcPublicSubnet1Subnet4AC37B0F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "EcsClusterVpcPublicSubnet1DefaultRoute8C7EFC96", + "EcsClusterVpcPublicSubnet1RouteTableAssociation49C4CDBB" + ], + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/NATGateway" + } + }, + "EcsClusterVpcPublicSubnet2Subnet4A959A4C": { + "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-integ-external/EcsCluster/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/Subnet" + } + }, + "EcsClusterVpcPublicSubnet2RouteTable89A2F6C5": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/RouteTable" + } + }, + "EcsClusterVpcPublicSubnet2RouteTableAssociationE4D42FC1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EcsClusterVpcPublicSubnet2RouteTable89A2F6C5" + }, + "SubnetId": { + "Ref": "EcsClusterVpcPublicSubnet2Subnet4A959A4C" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/RouteTableAssociation" + } + }, + "EcsClusterVpcPublicSubnet2DefaultRoute048730F7": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "EcsClusterVpcIGW3663B083" + }, + "RouteTableId": { + "Ref": "EcsClusterVpcPublicSubnet2RouteTable89A2F6C5" + } + }, + "DependsOn": [ + "EcsClusterVpcVPCGW944296C0" + ], + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/DefaultRoute" + } + }, + "EcsClusterVpcPublicSubnet2EIP26E3EEEF": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2" + } + ] + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/EIP" + } + }, + "EcsClusterVpcPublicSubnet2NATGatewayBD015416": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "EcsClusterVpcPublicSubnet2EIP26E3EEEF", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "EcsClusterVpcPublicSubnet2Subnet4A959A4C" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "EcsClusterVpcPublicSubnet2DefaultRoute048730F7", + "EcsClusterVpcPublicSubnet2RouteTableAssociationE4D42FC1" + ], + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/NATGateway" + } + }, + "EcsClusterVpcPrivateSubnet1SubnetFAB0E487": { + "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-integ-external/EcsCluster/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/Subnet" + } + }, + "EcsClusterVpcPrivateSubnet1RouteTable2EA148EE": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/RouteTable" + } + }, + "EcsClusterVpcPrivateSubnet1RouteTableAssociationF4E8ACD7": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EcsClusterVpcPrivateSubnet1RouteTable2EA148EE" + }, + "SubnetId": { + "Ref": "EcsClusterVpcPrivateSubnet1SubnetFAB0E487" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/RouteTableAssociation" + } + }, + "EcsClusterVpcPrivateSubnet1DefaultRoute0239F5D0": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "EcsClusterVpcPublicSubnet1NATGateway2F1E7764" + }, + "RouteTableId": { + "Ref": "EcsClusterVpcPrivateSubnet1RouteTable2EA148EE" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/DefaultRoute" + } + }, + "EcsClusterVpcPrivateSubnet2SubnetC2B7B1BA": { + "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-integ-external/EcsCluster/Vpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/Subnet" + } + }, + "EcsClusterVpcPrivateSubnet2RouteTable1D430E45": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/RouteTable" + } + }, + "EcsClusterVpcPrivateSubnet2RouteTableAssociation329A2412": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "EcsClusterVpcPrivateSubnet2RouteTable1D430E45" + }, + "SubnetId": { + "Ref": "EcsClusterVpcPrivateSubnet2SubnetC2B7B1BA" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/RouteTableAssociation" + } + }, + "EcsClusterVpcPrivateSubnet2DefaultRoute27221D27": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "EcsClusterVpcPublicSubnet2NATGatewayBD015416" + }, + "RouteTableId": { + "Ref": "EcsClusterVpcPrivateSubnet2RouteTable1D430E45" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/DefaultRoute" + } + }, + "EcsClusterVpcIGW3663B083": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-external/EcsCluster/Vpc" + } + ] + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/IGW" + } + }, + "EcsClusterVpcVPCGW944296C0": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "EcsClusterVpcIGW3663B083" + }, + "VpcId": { + "Ref": "EcsClusterVpc779914AB" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/EcsCluster/Vpc/VPCGW" + } + }, + "TaskDefTaskRole1EDB4A67": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ecs-tasks.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/TaskDef/TaskRole/Resource" + } + }, + "TaskDef54694570": { + "Type": "AWS::ECS::TaskDefinition", + "Properties": { + "ContainerDefinitions": [ + { + "Essential": true, + "Image": "nginx", + "Name": "TheContainer" + } + ], + "Cpu": "256", + "Family": "awsecsintegexternalTaskDef26401107", + "Memory": "512", + "NetworkMode": "bridge", + "RequiresCompatibilities": [ + "EXTERNAL" + ], + "TaskRoleArn": { + "Fn::GetAtt": [ + "TaskDefTaskRole1EDB4A67", + "Arn" + ] + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/TaskDef/Resource" + } + }, + "TaskDefEventsRoleFB3B67B8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/TaskDef/EventsRole/Resource" + } + }, + "TaskDefEventsRoleDefaultPolicyA124E85B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "ecs:RunTask", + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "EcsCluster97242B84", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": { + "Ref": "TaskDef54694570" + } + }, + { + "Action": "ecs:TagResource", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ecs:", + { + "Ref": "AWS::Region" + }, + ":*:task/", + { + "Ref": "EcsCluster97242B84" + }, + "/*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TaskDefEventsRoleDefaultPolicyA124E85B", + "Roles": [ + { + "Ref": "TaskDefEventsRoleFB3B67B8" + } + ] + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/TaskDef/EventsRole/DefaultPolicy/Resource" + } + }, + "Rule4C995B7F": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(1 minute)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "EcsCluster97242B84", + "Arn" + ] + }, + "EcsParameters": { + "TaskCount": 1, + "TaskDefinitionArn": { + "Ref": "TaskDef54694570" + } + }, + "Id": "Target0", + "Input": "{}", + "RoleArn": { + "Fn::GetAtt": [ + "TaskDefEventsRoleFB3B67B8", + "Arn" + ] + } + } + ] + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/Rule/Resource" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/12OT2vDMAzFP0vvjpfltmPJxuhlhLT0OhRXZWocedhywjD+7iNJu8BO7+mnpz+lLnW5gykU5tIXljqdjgKmVzCFz4Qm6FTbGAS9qq/8sCcI/SteiUnI8dz5TxwLEKPfWFZoKp3O32bOn5taNbGzZI6xY5SZba51UfAEncWNb2wfgjMEj9NLYzZvh2aWD5B3EJzgRzWeRhDcFh9Y0DP+BdZP7tVeBMzXgCxZEQw6tW59YNHGWTLLxOqywhFZgk5tvMeixZxVi8FFbzArdhfUt/A0VpV+ftHl7haICh9ZaEDdrvoLzoh3NIIBAAA=" + }, + "Metadata": { + "aws:cdk:path": "aws-ecs-integ-external/CDKMetadata/Default" + }, + "Condition": "CDKMetadataAvailable" + } + }, + "Conditions": { + "CDKMetadataAvailable": { + "Fn::Or": [ + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "af-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-northeast-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-south-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-3" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ap-southeast-4" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "ca-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "cn-northwest-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-central-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-north-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-south-2" + ] + } + ] + }, + { + "Fn::Or": [ + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "eu-west-3" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "il-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-central-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "me-south-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "sa-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-1" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-east-2" + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-1" + ] + } + ] + }, + { + "Fn::Equals": [ + { + "Ref": "AWS::Region" + }, + "us-west-2" + ] + } + ] + } + }, + "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-events-targets/test/ecs/integ.event-external-task.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/cdk.out new file mode 100644 index 0000000000000..523a9aac37cbf --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"48.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/integ.json new file mode 100644 index 0000000000000..56604d2f31a30 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/integ.json @@ -0,0 +1,13 @@ +{ + "version": "48.0.0", + "testCases": { + "EcsExternalTest/DefaultTest": { + "stacks": [ + "aws-ecs-integ-external" + ], + "assertionStack": "EcsExternalTest/DefaultTest/DeployAssert", + "assertionStackName": "EcsExternalTestDefaultTestDeployAssert9F72078B" + } + }, + "minimumCliVersion": "2.1027.0" +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/manifest.json new file mode 100644 index 0000000000000..e980d5929d1d5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/manifest.json @@ -0,0 +1,710 @@ +{ + "version": "48.0.0", + "artifacts": { + "aws-ecs-integ-external.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-ecs-integ-external.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-ecs-integ-external": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-ecs-integ-external.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}/70165d4ae45be09cc287d78a00544a4202f7cc0d17ba3e44dd7615cb508cc937.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-ecs-integ-external.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-integ-external.assets" + ], + "metadata": { + "/aws-ecs-integ-external/EcsCluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsCluster97242B84" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpc779914AB" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet1Subnet4AC37B0F" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet1RouteTable4AE3113D" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet1RouteTableAssociation49C4CDBB" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet1DefaultRoute8C7EFC96" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet1EIP2D3759A3" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet1NATGateway2F1E7764" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet2Subnet4A959A4C" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet2RouteTable89A2F6C5" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet2RouteTableAssociationE4D42FC1" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet2DefaultRoute048730F7" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet2EIP26E3EEEF" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPublicSubnet2NATGatewayBD015416" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet1SubnetFAB0E487" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet1RouteTable2EA148EE" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet1RouteTableAssociationF4E8ACD7" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet1DefaultRoute0239F5D0" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet2SubnetC2B7B1BA" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet2RouteTable1D430E45" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet2RouteTableAssociation329A2412" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcPrivateSubnet2DefaultRoute27221D27" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcIGW3663B083" + } + ], + "/aws-ecs-integ-external/EcsCluster/Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "EcsClusterVpcVPCGW944296C0" + } + ], + "/aws-ecs-integ-external/TaskDef/TaskRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TaskDefTaskRole1EDB4A67" + } + ], + "/aws-ecs-integ-external/TaskDef/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TaskDef54694570" + } + ], + "/aws-ecs-integ-external/TaskDef/EventsRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TaskDefEventsRoleFB3B67B8" + } + ], + "/aws-ecs-integ-external/TaskDef/EventsRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TaskDefEventsRoleDefaultPolicyA124E85B" + } + ], + "/aws-ecs-integ-external/Rule/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Rule4C995B7F" + } + ], + "/aws-ecs-integ-external/CDKMetadata/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "CDKMetadata" + } + ], + "/aws-ecs-integ-external/CDKMetadata/Condition": [ + { + "type": "aws:cdk:logicalId", + "data": "CDKMetadataAvailable" + } + ], + "/aws-ecs-integ-external/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-integ-external/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-integ-external" + }, + "EcsExternalTestDefaultTestDeployAssert9F72078B.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "EcsExternalTestDefaultTestDeployAssert9F72078B.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "EcsExternalTestDefaultTestDeployAssert9F72078B": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "EcsExternalTestDefaultTestDeployAssert9F72078B.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}/108555c01cfc2f89d6e814b83ffc1c6370ea2ed53c95cb754a89b290f4b82e46.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "EcsExternalTestDefaultTestDeployAssert9F72078B.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": [ + "EcsExternalTestDefaultTestDeployAssert9F72078B.assets" + ], + "metadata": { + "/EcsExternalTest/DefaultTest/DeployAssert/CDKMetadata/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "CDKMetadata" + } + ], + "/EcsExternalTest/DefaultTest/DeployAssert/CDKMetadata/Condition": [ + { + "type": "aws:cdk:logicalId", + "data": "CDKMetadataAvailable" + } + ], + "/EcsExternalTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/EcsExternalTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "EcsExternalTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "aws-cdk-lib/feature-flag-report": { + "type": "cdk:feature-flag-report", + "properties": { + "module": "aws-cdk-lib", + "flags": { + "@aws-cdk/aws-signer:signingProfileNamePassedToCfn": { + "recommendedValue": true, + "explanation": "Pass signingProfileName to CfnSigningProfile" + }, + "@aws-cdk/core:newStyleStackSynthesis": { + "recommendedValue": true, + "explanation": "Switch to new stack synthesis method which enables CI/CD", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/core:stackRelativeExports": { + "recommendedValue": true, + "explanation": "Name exports based on the construct paths relative to the stack, rather than the global construct path", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-ecs-patterns:secGroupsDisablesImplicitOpenListener": { + "recommendedValue": true, + "explanation": "Disable implicit openListener when custom security groups are provided" + }, + "@aws-cdk/aws-rds:lowercaseDbIdentifier": { + "recommendedValue": true, + "explanation": "Force lowercasing of RDS Cluster names in CDK", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": { + "recommendedValue": true, + "explanation": "Allow adding/removing multiple UsagePlanKeys independently", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-lambda:recognizeVersionProps": { + "recommendedValue": true, + "explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-lambda:recognizeLayerVersion": { + "recommendedValue": true, + "explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`." + }, + "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": { + "recommendedValue": true, + "explanation": "Enable this feature flag to have cloudfront distributions use the security policy TLSv1.2_2021 by default.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/core:checkSecretUsage": { + "recommendedValue": true, + "explanation": "Enable this flag to make it impossible to accidentally use SecretValues in unsafe locations" + }, + "@aws-cdk/core:target-partitions": { + "recommendedValue": [ + "aws", + "aws-cn" + ], + "explanation": "What regions to include in lookup tables of environment agnostic stacks" + }, + "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": { + "recommendedValue": true, + "explanation": "ECS extensions will automatically add an `awslogs` driver if no logging is specified" + }, + "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": { + "recommendedValue": true, + "explanation": "Enable this feature flag to have Launch Templates generated by the `InstanceRequireImdsv2Aspect` use unique names." + }, + "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": { + "recommendedValue": true, + "explanation": "ARN format used by ECS. In the new ARN format, the cluster name is part of the resource ID." + }, + "@aws-cdk/aws-iam:minimizePolicies": { + "recommendedValue": true, + "explanation": "Minimize IAM policies by combining Statements" + }, + "@aws-cdk/core:validateSnapshotRemovalPolicy": { + "recommendedValue": true, + "explanation": "Error on snapshot removal policies on resources that do not support it." + }, + "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": { + "recommendedValue": true, + "explanation": "Generate key aliases that include the stack name" + }, + "@aws-cdk/aws-s3:createDefaultLoggingPolicy": { + "recommendedValue": true, + "explanation": "Enable this feature flag to create an S3 bucket policy by default in cases where an AWS service would automatically create the Policy if one does not exist." + }, + "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": { + "recommendedValue": true, + "explanation": "Restrict KMS key policy for encrypted Queues a bit more" + }, + "@aws-cdk/aws-apigateway:disableCloudWatchRole": { + "recommendedValue": true, + "explanation": "Make default CloudWatch Role behavior safe for multiple API Gateways in one environment" + }, + "@aws-cdk/core:enablePartitionLiterals": { + "recommendedValue": true, + "explanation": "Make ARNs concrete if AWS partition is known" + }, + "@aws-cdk/aws-events:eventsTargetQueueSameAccount": { + "recommendedValue": true, + "explanation": "Event Rules may only push to encrypted SQS queues in the same account" + }, + "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": { + "recommendedValue": true, + "explanation": "Avoid setting the \"ECS\" deployment controller when adding a circuit breaker" + }, + "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": { + "recommendedValue": true, + "explanation": "Enable this feature to by default create default policy names for imported roles that depend on the stack the role is in." + }, + "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": { + "recommendedValue": true, + "explanation": "Use S3 Bucket Policy instead of ACLs for Server Access Logging" + }, + "@aws-cdk/aws-route53-patters:useCertificate": { + "recommendedValue": true, + "explanation": "Use the official `Certificate` resource instead of `DnsValidatedCertificate`" + }, + "@aws-cdk/customresources:installLatestAwsSdkDefault": { + "recommendedValue": false, + "explanation": "Whether to install the latest SDK by default in AwsCustomResource" + }, + "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": { + "recommendedValue": true, + "explanation": "Use unique resource name for Database Proxy" + }, + "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": { + "recommendedValue": true, + "explanation": "Remove CloudWatch alarms from deployment group" + }, + "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": { + "recommendedValue": true, + "explanation": "Include authorizer configuration in the calculation of the API deployment logical ID." + }, + "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": { + "recommendedValue": true, + "explanation": "Define user data for a launch template by default when a machine image is provided." + }, + "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": { + "recommendedValue": true, + "explanation": "SecretTargetAttachments uses the ResourcePolicy of the attached Secret." + }, + "@aws-cdk/aws-redshift:columnId": { + "recommendedValue": true, + "explanation": "Whether to use an ID to track Redshift column changes" + }, + "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": { + "recommendedValue": true, + "explanation": "Enable AmazonEMRServicePolicy_v2 managed policies" + }, + "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": { + "recommendedValue": true, + "explanation": "Restrict access to the VPC default security group" + }, + "@aws-cdk/aws-apigateway:requestValidatorUniqueId": { + "recommendedValue": true, + "explanation": "Generate a unique id for each RequestValidator added to a method" + }, + "@aws-cdk/aws-kms:aliasNameRef": { + "recommendedValue": true, + "explanation": "KMS Alias name and keyArn will have implicit reference to KMS Key" + }, + "@aws-cdk/aws-kms:applyImportedAliasPermissionsToPrincipal": { + "recommendedValue": true, + "explanation": "Enable grant methods on Aliases imported by name to use kms:ResourceAliases condition" + }, + "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": { + "recommendedValue": true, + "explanation": "Generate a launch template when creating an AutoScalingGroup" + }, + "@aws-cdk/core:includePrefixInUniqueNameGeneration": { + "recommendedValue": true, + "explanation": "Include the stack prefix in the stack name generation process" + }, + "@aws-cdk/aws-efs:denyAnonymousAccess": { + "recommendedValue": true, + "explanation": "EFS denies anonymous clients accesses" + }, + "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": { + "recommendedValue": true, + "explanation": "Enables support for Multi-AZ with Standby deployment for opensearch domains" + }, + "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": { + "recommendedValue": true, + "explanation": "Enables aws-lambda-nodejs.Function to use the latest available NodeJs runtime as the default" + }, + "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": { + "recommendedValue": true, + "explanation": "When enabled, mount targets will have a stable logicalId that is linked to the associated subnet." + }, + "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": { + "recommendedValue": true, + "explanation": "When enabled, a scope of InstanceParameterGroup for AuroraClusterInstance with each parameters will change." + }, + "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": { + "recommendedValue": true, + "explanation": "When enabled, will always use the arn for identifiers for CfnSourceApiAssociation in the GraphqlApi construct rather than id." + }, + "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": { + "recommendedValue": true, + "explanation": "When enabled, creating an RDS database cluster from a snapshot will only render credentials for snapshot credentials." + }, + "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": { + "recommendedValue": true, + "explanation": "When enabled, the CodeCommit source action is using the default branch name 'main'." + }, + "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": { + "recommendedValue": true, + "explanation": "When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID." + }, + "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": { + "recommendedValue": true, + "explanation": "Enables Pipeline to set the default value for crossAccountKeys to false." + }, + "@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": { + "recommendedValue": true, + "explanation": "Enables Pipeline to set the default pipeline type to V2." + }, + "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": { + "recommendedValue": true, + "explanation": "When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only." + }, + "@aws-cdk/pipelines:reduceAssetRoleTrustScope": { + "recommendedValue": true, + "explanation": "Remove the root account principal from PipelineAssetsFileRole trust policy", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-eks:nodegroupNameAttribute": { + "recommendedValue": true, + "explanation": "When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix." + }, + "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": { + "recommendedValue": true, + "explanation": "When enabled, the default volume type of the EBS volume will be GP3" + }, + "@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": { + "recommendedValue": true, + "explanation": "When enabled, remove default deployment alarm settings" + }, + "@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": { + "recommendedValue": false, + "explanation": "When enabled, the custom resource used for `AwsCustomResource` will configure the `logApiResponseData` property as true by default" + }, + "@aws-cdk/aws-s3:keepNotificationInImportedBucket": { + "recommendedValue": false, + "explanation": "When enabled, Adding notifications to a bucket in the current stack will not remove notification from imported stack." + }, + "@aws-cdk/aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": { + "recommendedValue": true, + "explanation": "When enabled, use new props for S3 URI field in task definition of state machine for bedrock invoke model.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/core:explicitStackTags": { + "recommendedValue": true, + "explanation": "When enabled, stack tags need to be assigned explicitly on a Stack." + }, + "@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature": { + "recommendedValue": false, + "explanation": "When set to true along with canContainersAccessInstanceRole=false in ECS cluster, new updated commands will be added to UserData to block container accessing IMDS. **Applicable to Linux only. IMPORTANT: See [details.](#aws-cdkaws-ecsenableImdsBlockingDeprecatedFeature)**" + }, + "@aws-cdk/aws-ecs:disableEcsImdsBlocking": { + "recommendedValue": true, + "explanation": "When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false. **IMPORTANT: See [details.](#aws-cdkaws-ecsdisableEcsImdsBlocking)**" + }, + "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": { + "recommendedValue": true, + "explanation": "When enabled, we will only grant the necessary permissions when users specify cloudwatch log group through logConfiguration" + }, + "@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": { + "recommendedValue": true, + "explanation": "When enabled will allow you to specify a resource policy per replica, and not copy the source table policy to all replicas" + }, + "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": { + "recommendedValue": true, + "explanation": "When enabled, initOptions.timeout and resourceSignalTimeout values will be summed together." + }, + "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": { + "recommendedValue": true, + "explanation": "When enabled, a Lambda authorizer Permission created when using GraphqlApi will be properly scoped with a SourceArn." + }, + "@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": { + "recommendedValue": true, + "explanation": "When enabled, the value of property `instanceResourceId` in construct `DatabaseInstanceReadReplica` will be set to the correct value which is `DbiResourceId` instead of currently `DbInstanceArn`" + }, + "@aws-cdk/core:cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics": { + "recommendedValue": true, + "explanation": "When enabled, CFN templates added with `cfn-include` will error if the template contains Resource Update or Create policies with CFN Intrinsics that include non-primitive values." + }, + "@aws-cdk/aws-lambda-nodejs:sdkV3ExcludeSmithyPackages": { + "recommendedValue": true, + "explanation": "When enabled, both `@aws-sdk` and `@smithy` packages will be excluded from the Lambda Node.js 18.x runtime to prevent version mismatches in bundled applications." + }, + "@aws-cdk/aws-stepfunctions-tasks:fixRunEcsTaskPolicy": { + "recommendedValue": true, + "explanation": "When enabled, the resource of IAM Run Ecs policy generated by SFN EcsRunTask will reference the definition, instead of constructing ARN." + }, + "@aws-cdk/aws-ec2:bastionHostUseAmazonLinux2023ByDefault": { + "recommendedValue": true, + "explanation": "When enabled, the BastionHost construct will use the latest Amazon Linux 2023 AMI, instead of Amazon Linux 2." + }, + "@aws-cdk/core:aspectStabilization": { + "recommendedValue": true, + "explanation": "When enabled, a stabilization loop will be run when invoking Aspects during synthesis.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource": { + "recommendedValue": true, + "explanation": "When enabled, use a new method for DNS Name of user pool domain target without creating a custom resource." + }, + "@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault": { + "recommendedValue": true, + "explanation": "When enabled, the default security group ingress rules will allow IPv6 ingress from anywhere" + }, + "@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections": { + "recommendedValue": true, + "explanation": "When enabled, the default behaviour of OIDC provider will reject unauthorized connections" + }, + "@aws-cdk/core:enableAdditionalMetadataCollection": { + "recommendedValue": true, + "explanation": "When enabled, CDK will expand the scope of usage data collected to better inform CDK development and improve communication for security concerns and emerging issues." + }, + "@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": { + "recommendedValue": false, + "explanation": "[Deprecated] When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement" + }, + "@aws-cdk/aws-s3:setUniqueReplicationRoleName": { + "recommendedValue": true, + "explanation": "When enabled, CDK will automatically generate a unique role name that is used for s3 object replication." + }, + "@aws-cdk/pipelines:reduceStageRoleTrustScope": { + "recommendedValue": true, + "explanation": "Remove the root account principal from Stage addActions trust policy", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-events:requireEventBusPolicySid": { + "recommendedValue": true, + "explanation": "When enabled, grantPutEventsTo() will use resource policies with Statement IDs for service principals." + }, + "@aws-cdk/core:aspectPrioritiesMutating": { + "recommendedValue": true, + "explanation": "When set to true, Aspects added by the construct library on your behalf will be given a priority of MUTATING." + }, + "@aws-cdk/aws-dynamodb:retainTableReplica": { + "recommendedValue": true, + "explanation": "When enabled, table replica will be default to the removal policy of source table unless specified otherwise." + }, + "@aws-cdk/cognito:logUserPoolClientSecretValue": { + "recommendedValue": false, + "explanation": "When disabled, the value of the user pool client secret will not be logged in the custom resource lambda function logs." + }, + "@aws-cdk/pipelines:reduceCrossAccountActionRoleTrustScope": { + "recommendedValue": true, + "explanation": "When enabled, scopes down the trust policy for the cross-account action role", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2": { + "recommendedValue": true, + "explanation": "When enabled, the resultWriterV2 property of DistributedMap will be used insted of resultWriter" + }, + "@aws-cdk/s3-notifications:addS3TrustKeyPolicyForSnsSubscriptions": { + "recommendedValue": true, + "explanation": "Add an S3 trust policy to a KMS key resource policy for SNS subscriptions." + }, + "@aws-cdk/aws-ec2:requirePrivateSubnetsForEgressOnlyInternetGateway": { + "recommendedValue": true, + "explanation": "When enabled, the EgressOnlyGateway resource is only created if private subnets are defined in the dual-stack VPC." + }, + "@aws-cdk/aws-ec2-alpha:useResourceIdForVpcV2Migration": { + "recommendedValue": false, + "explanation": "When enabled, use resource IDs for VPC V2 migration" + }, + "@aws-cdk/aws-s3:publicAccessBlockedByDefault": { + "recommendedValue": true, + "explanation": "When enabled, setting any combination of options for BlockPublicAccess will automatically set true for any options not defined." + }, + "@aws-cdk/aws-lambda:useCdkManagedLogGroup": { + "recommendedValue": true, + "explanation": "When enabled, CDK creates and manages loggroup for the lambda function" + } + } + } + } + }, + "minimumCliVersion": "2.1027.0" +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/tree.json new file mode 100644 index 0000000000000..c902600f97e07 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.js.snapshot/tree.json @@ -0,0 +1 @@ +{"version":"tree-0.1","tree":{"id":"App","path":"","constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"},"children":{"aws-ecs-integ-external":{"id":"aws-ecs-integ-external","path":"aws-ecs-integ-external","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"EcsCluster":{"id":"EcsCluster","path":"aws-ecs-integ-external/EcsCluster","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.Cluster","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-integ-external/EcsCluster/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnCluster","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::Cluster","aws:cdk:cloudformation:props":{}}},"Vpc":{"id":"Vpc","path":"aws-ecs-integ-external/EcsCluster/Vpc","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.Vpc","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-integ-external/EcsCluster/Vpc/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnVPC","version":"0.0.0"},"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-integ-external/EcsCluster/Vpc"}]}}},"PublicSubnet1":{"id":"PublicSubnet1","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PublicSubnet","version":"0.0.0","metadata":[]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-integ-external/EcsCluster/Vpc/PublicSubnet1"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"Acl":{"id":"Acl","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"EcsClusterVpcPublicSubnet1RouteTable4AE3113D"},"subnetId":{"Ref":"EcsClusterVpcPublicSubnet1Subnet4AC37B0F"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","gatewayId":{"Ref":"EcsClusterVpcIGW3663B083"},"routeTableId":{"Ref":"EcsClusterVpcPublicSubnet1RouteTable4AE3113D"}}}},"EIP":{"id":"EIP","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/EIP","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnEIP","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::EIP","aws:cdk:cloudformation:props":{"domain":"vpc","tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1"}]}}},"NATGateway":{"id":"NATGateway","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1/NATGateway","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnNatGateway","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::NatGateway","aws:cdk:cloudformation:props":{"allocationId":{"Fn::GetAtt":["EcsClusterVpcPublicSubnet1EIP2D3759A3","AllocationId"]},"subnetId":{"Ref":"EcsClusterVpcPublicSubnet1Subnet4AC37B0F"},"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet1"}]}}}}},"PublicSubnet2":{"id":"PublicSubnet2","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PublicSubnet","version":"0.0.0","metadata":[]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-integ-external/EcsCluster/Vpc/PublicSubnet2"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"Acl":{"id":"Acl","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"EcsClusterVpcPublicSubnet2RouteTable89A2F6C5"},"subnetId":{"Ref":"EcsClusterVpcPublicSubnet2Subnet4A959A4C"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","gatewayId":{"Ref":"EcsClusterVpcIGW3663B083"},"routeTableId":{"Ref":"EcsClusterVpcPublicSubnet2RouteTable89A2F6C5"}}}},"EIP":{"id":"EIP","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/EIP","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnEIP","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::EIP","aws:cdk:cloudformation:props":{"domain":"vpc","tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2"}]}}},"NATGateway":{"id":"NATGateway","path":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2/NATGateway","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnNatGateway","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::NatGateway","aws:cdk:cloudformation:props":{"allocationId":{"Fn::GetAtt":["EcsClusterVpcPublicSubnet2EIP26E3EEEF","AllocationId"]},"subnetId":{"Ref":"EcsClusterVpcPublicSubnet2Subnet4A959A4C"},"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PublicSubnet2"}]}}}}},"PrivateSubnet1":{"id":"PrivateSubnet1","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PrivateSubnet","version":"0.0.0","metadata":[]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-integ-external/EcsCluster/Vpc/PrivateSubnet1"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"Acl":{"id":"Acl","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"EcsClusterVpcPrivateSubnet1RouteTable2EA148EE"},"subnetId":{"Ref":"EcsClusterVpcPrivateSubnet1SubnetFAB0E487"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet1/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","natGatewayId":{"Ref":"EcsClusterVpcPublicSubnet1NATGateway2F1E7764"},"routeTableId":{"Ref":"EcsClusterVpcPrivateSubnet1RouteTable2EA148EE"}}}}}},"PrivateSubnet2":{"id":"PrivateSubnet2","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PrivateSubnet","version":"0.0.0","metadata":[]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-integ-external/EcsCluster/Vpc/PrivateSubnet2"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"Acl":{"id":"Acl","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2"}],"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"EcsClusterVpcPrivateSubnet2RouteTable1D430E45"},"subnetId":{"Ref":"EcsClusterVpcPrivateSubnet2SubnetC2B7B1BA"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-integ-external/EcsCluster/Vpc/PrivateSubnet2/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","natGatewayId":{"Ref":"EcsClusterVpcPublicSubnet2NATGatewayBD015416"},"routeTableId":{"Ref":"EcsClusterVpcPrivateSubnet2RouteTable1D430E45"}}}}}},"IGW":{"id":"IGW","path":"aws-ecs-integ-external/EcsCluster/Vpc/IGW","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnInternetGateway","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::InternetGateway","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-integ-external/EcsCluster/Vpc"}]}}},"VPCGW":{"id":"VPCGW","path":"aws-ecs-integ-external/EcsCluster/Vpc/VPCGW","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::VPCGatewayAttachment","aws:cdk:cloudformation:props":{"internetGatewayId":{"Ref":"EcsClusterVpcIGW3663B083"},"vpcId":{"Ref":"EcsClusterVpc779914AB"}}}}}}}},"TaskDef":{"id":"TaskDef","path":"aws-ecs-integ-external/TaskDef","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.TaskDefinition","version":"0.0.0","metadata":[]},"children":{"TaskRole":{"id":"TaskRole","path":"aws-ecs-integ-external/TaskDef/TaskRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[]},"children":{"ImportTaskRole":{"id":"ImportTaskRole","path":"aws-ecs-integ-external/TaskDef/TaskRole/ImportTaskRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"Resource":{"id":"Resource","path":"aws-ecs-integ-external/TaskDef/TaskRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"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"}}}}}},"Resource":{"id":"Resource","path":"aws-ecs-integ-external/TaskDef/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnTaskDefinition","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::TaskDefinition","aws:cdk:cloudformation:props":{"containerDefinitions":[{"essential":true,"image":"nginx","name":"TheContainer"}],"cpu":"256","family":"awsecsintegexternalTaskDef26401107","memory":"512","networkMode":"bridge","requiresCompatibilities":["EXTERNAL"],"taskRoleArn":{"Fn::GetAtt":["TaskDefTaskRole1EDB4A67","Arn"]}}}},"TheContainer":{"id":"TheContainer","path":"aws-ecs-integ-external/TaskDef/TheContainer","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.ContainerDefinition","version":"0.0.0"}},"EventsRole":{"id":"EventsRole","path":"aws-ecs-integ-external/TaskDef/EventsRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[]},"children":{"ImportEventsRole":{"id":"ImportEventsRole","path":"aws-ecs-integ-external/TaskDef/EventsRole/ImportEventsRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"Resource":{"id":"Resource","path":"aws-ecs-integ-external/TaskDef/EventsRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"events.amazonaws.com"}}],"Version":"2012-10-17"}}}},"DefaultPolicy":{"id":"DefaultPolicy","path":"aws-ecs-integ-external/TaskDef/EventsRole/DefaultPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-integ-external/TaskDef/EventsRole/DefaultPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"ecs:RunTask","Condition":{"ArnEquals":{"ecs:cluster":{"Fn::GetAtt":["EcsCluster97242B84","Arn"]}}},"Effect":"Allow","Resource":{"Ref":"TaskDef54694570"}},{"Action":"ecs:TagResource","Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":ecs:",{"Ref":"AWS::Region"},":*:task/",{"Ref":"EcsCluster97242B84"},"/*"]]}}],"Version":"2012-10-17"},"policyName":"TaskDefEventsRoleDefaultPolicyA124E85B","roles":[{"Ref":"TaskDefEventsRoleFB3B67B8"}]}}}}}}}}},"Rule":{"id":"Rule","path":"aws-ecs-integ-external/Rule","constructInfo":{"fqn":"aws-cdk-lib.aws_events.Rule","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-integ-external/Rule/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_events.CfnRule","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Events::Rule","aws:cdk:cloudformation:props":{"scheduleExpression":"rate(1 minute)","state":"ENABLED","targets":[{"id":"Target0","arn":{"Fn::GetAtt":["EcsCluster97242B84","Arn"]},"roleArn":{"Fn::GetAtt":["TaskDefEventsRoleFB3B67B8","Arn"]},"ecsParameters":{"taskCount":1,"taskDefinitionArn":{"Ref":"TaskDef54694570"}},"input":"{}"}]}}}}},"CDKMetadata":{"id":"CDKMetadata","path":"aws-ecs-integ-external/CDKMetadata","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"},"children":{"Default":{"id":"Default","path":"aws-ecs-integ-external/CDKMetadata/Default","constructInfo":{"fqn":"aws-cdk-lib.CfnResource","version":"0.0.0"}},"Condition":{"id":"Condition","path":"aws-ecs-integ-external/CDKMetadata/Condition","constructInfo":{"fqn":"aws-cdk-lib.CfnCondition","version":"0.0.0"}}}},"BootstrapVersion":{"id":"BootstrapVersion","path":"aws-ecs-integ-external/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"aws-ecs-integ-external/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}},"EcsExternalTest":{"id":"EcsExternalTest","path":"EcsExternalTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"},"children":{"DefaultTest":{"id":"DefaultTest","path":"EcsExternalTest/DefaultTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"},"children":{"Default":{"id":"Default","path":"EcsExternalTest/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"EcsExternalTest/DefaultTest/DeployAssert","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"CDKMetadata":{"id":"CDKMetadata","path":"EcsExternalTest/DefaultTest/DeployAssert/CDKMetadata","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"},"children":{"Default":{"id":"Default","path":"EcsExternalTest/DefaultTest/DeployAssert/CDKMetadata/Default","constructInfo":{"fqn":"aws-cdk-lib.CfnResource","version":"0.0.0"}},"Condition":{"id":"Condition","path":"EcsExternalTest/DefaultTest/DeployAssert/CDKMetadata/Condition","constructInfo":{"fqn":"aws-cdk-lib.CfnCondition","version":"0.0.0"}}}},"BootstrapVersion":{"id":"BootstrapVersion","path":"EcsExternalTest/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"EcsExternalTest/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}}}}}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}}}} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.ts new file mode 100644 index 0000000000000..cb506462217d9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/ecs/integ.event-external-task.ts @@ -0,0 +1,38 @@ +import * as ecs from 'aws-cdk-lib/aws-ecs'; +import * as events from 'aws-cdk-lib/aws-events'; +import * as cdk from 'aws-cdk-lib'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as targets from 'aws-cdk-lib/aws-events-targets'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-ecs-integ-external'); + +const cluster = new ecs.Cluster(stack, 'EcsCluster'); + +// Create a Task Definition with EXTERNAL compatibility +const taskDefinition = new ecs.TaskDefinition(stack, 'TaskDef', { + networkMode: ecs.NetworkMode.BRIDGE, // Non-AWS_VPC network mode + compatibility: ecs.Compatibility.EXTERNAL, + cpu: '256', + memoryMiB: '512', +}); +taskDefinition.addContainer('TheContainer', { + image: ecs.ContainerImage.fromRegistry('nginx'), +}); + +const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.rate(cdk.Duration.minutes(1)), +}); + +// Use EcsTask with EXTERNAL launch type +rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + launchType: ecs.LaunchType.EXTERNAL, +})); + +new integ.IntegTest(app, 'EcsExternalTest', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/aws-cdk-lib/aws-events-targets/lib/ecs-task.ts b/packages/aws-cdk-lib/aws-events-targets/lib/ecs-task.ts index eccb47cd94896..d1818d087a632 100644 --- a/packages/aws-cdk-lib/aws-events-targets/lib/ecs-task.ts +++ b/packages/aws-cdk-lib/aws-events-targets/lib/ecs-task.ts @@ -292,12 +292,18 @@ export class EcsTask implements events.IRuleTarget { throw new ValidationError('assignPublicIp is only supported for FARGATE tasks', rule); } - const baseEcsParameters = { taskCount, taskDefinitionArn, propagateTags, tagList, enableExecuteCommand }; + const baseEcsParameters = { + taskCount, + taskDefinitionArn, + propagateTags, + tagList, + enableExecuteCommand, + launchType, + }; const ecsParameters: events.CfnRule.EcsParametersProperty = this.taskDefinition.networkMode === ecs.NetworkMode.AWS_VPC ? { ...baseEcsParameters, - launchType, platformVersion: this.platformVersion, networkConfiguration: { awsVpcConfiguration: { diff --git a/packages/aws-cdk-lib/aws-events-targets/test/ecs/event-rule-target.test.ts b/packages/aws-cdk-lib/aws-events-targets/test/ecs/event-rule-target.test.ts index e300b3d855838..f838ace0074e5 100644 --- a/packages/aws-cdk-lib/aws-events-targets/test/ecs/event-rule-target.test.ts +++ b/packages/aws-cdk-lib/aws-events-targets/test/ecs/event-rule-target.test.ts @@ -1097,6 +1097,42 @@ test.each([ }); }); +test('launch type EXTERNAL is included for non-AWS_VPC network mode', () => { + // GIVEN + const taskDefinition = new ecs.TaskDefinition(stack, 'TaskDef', { + networkMode: ecs.NetworkMode.BRIDGE, // Non-AWS_VPC network mode + compatibility: ecs.Compatibility.EXTERNAL, + cpu: '256', + memoryMiB: '512', + }); + taskDefinition.addContainer('TheContainer', { + image: ecs.ContainerImage.fromRegistry('henk'), + }); + + const rule = new events.Rule(stack, 'Rule', { + schedule: events.Schedule.expression('rate(1 min)'), + }); + + // WHEN + rule.addTarget(new targets.EcsTask({ + cluster, + taskDefinition, + launchType: ecs.LaunchType.EXTERNAL, + })); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', { + Targets: [ + { + EcsParameters: { + LaunchType: 'EXTERNAL', + TaskDefinitionArn: { Ref: 'TaskDef54694570' }, + }, + }, + ], + }); +}); + test('When using non-imported TaskDefinition, the IAM policy `Resource` should use `Ref` to reference the TaskDefinition', () => { const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef'); taskDefinition.addContainer('TheContainer', {