From 3f5d6d89a63f9904f23df0cfc5733d338fea8879 Mon Sep 17 00:00:00 2001 From: Kendra Neil <53584728+TheRealAmazonKendra@users.noreply.github.com> Date: Thu, 11 Aug 2022 14:58:52 -0700 Subject: [PATCH] chore(batch): fix test that cannot pass (#21566) JobQueue has a limit of three compute environments but one of the queues in this test have four. This separates it out into it's own queue so that this test succeeds. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../batch-stack.assets.json | 19 - .../batch-stack.template.json | 301 +++++++------ ...aultTestDeployAssertA73A8412.template.json | 1 + .../test/batch.integ.snapshot/integ.json | 9 +- .../test/batch.integ.snapshot/manifest.json | 67 +-- .../test/batch.integ.snapshot/tree.json | 423 ++++++++++-------- .../@aws-cdk/aws-batch/test/integ.batch.ts | 49 +- 7 files changed, 473 insertions(+), 396 deletions(-) delete mode 100644 packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.assets.json create mode 100644 packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batchtestsDefaultTestDeployAssertA73A8412.template.json diff --git a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.assets.json b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.assets.json deleted file mode 100644 index e8f7e16a4dbbb..0000000000000 --- a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "20.0.0", - "files": { - "dd24d4801d80a639d9d7dcd67e4caa9af438a4af95a6243cdebbe188e79ba312": { - "source": { - "path": "batch-stack.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "dd24d4801d80a639d9d7dcd67e4caa9af438a4af95a6243cdebbe188e79ba312.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/aws-batch/test/batch.integ.snapshot/batch-stack.template.json b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.template.json index c7637933fee61..2081868e2a97d 100644 --- a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.template.json +++ b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.template.json @@ -1002,10 +1002,37 @@ "vpcVPCGW7984C166" ] }, - "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5": { + "batchjobqueueE3C528F2": { + "Type": "AWS::Batch::JobQueue", + "Properties": { + "ComputeEnvironmentOrder": [ + { + "ComputeEnvironment": { + "Ref": "batchunmanagedcomputeenvED550298" + }, + "Order": 1 + }, + { + "ComputeEnvironment": { + "Ref": "batchdemandcomputeenvlaunchtemplateF8A5B233" + }, + "Order": 2 + }, + { + "ComputeEnvironment": { + "Ref": "batchspotcomputeenv2CE4DFD9" + }, + "Order": 3 + } + ], + "Priority": 1, + "State": "ENABLED" + } + }, + "batchfargatecomputeenvResourceSecurityGroupE2963776": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group", + "GroupDescription": "batch-stack/batch-fargate-compute-env/Resource-Security-Group", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -1043,7 +1070,7 @@ "vpcVPCGW7984C166" ] }, - "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754": { + "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -1052,17 +1079,7 @@ "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": { - "Fn::Join": [ - "", - [ - "ec2.", - { - "Ref": "AWS::URLSuffix" - } - ] - ] - } + "Service": "batch.amazonaws.com" } } ], @@ -1077,7 +1094,7 @@ { "Ref": "AWS::Partition" }, - ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + ":iam::aws:policy/service-role/AWSBatchServiceRole" ] ] } @@ -1109,14 +1126,78 @@ "vpcVPCGW7984C166" ] }, - "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC": { - "Type": "AWS::IAM::InstanceProfile", + "batchfargatecomputeenvE9C3FCA4": { + "Type": "AWS::Batch::ComputeEnvironment", "Properties": { - "Roles": [ + "Type": "MANAGED", + "ComputeResources": { + "MaxvCpus": 256, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "batchfargatecomputeenvResourceSecurityGroupE2963776", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "vpcPrivateSubnet1Subnet934893E8" + }, + { + "Ref": "vpcPrivateSubnet2Subnet7031C2BA" + } + ], + "Type": "FARGATE" + }, + "ServiceRole": { + "Fn::GetAtt": [ + "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F", + "Arn" + ] + }, + "State": "ENABLED" + }, + "DependsOn": [ + "vpcIGWE57CBDCA", + "vpcPrivateSubnet1DefaultRoute1AA8E2E5", + "vpcPrivateSubnet1RouteTableB41A48CC", + "vpcPrivateSubnet1RouteTableAssociation67945127", + "vpcPrivateSubnet1Subnet934893E8", + "vpcPrivateSubnet2DefaultRouteB0E07F99", + "vpcPrivateSubnet2RouteTable7280F23E", + "vpcPrivateSubnet2RouteTableAssociation007E94D3", + "vpcPrivateSubnet2Subnet7031C2BA", + "vpcPublicSubnet1DefaultRoute10708846", + "vpcPublicSubnet1EIPDA49DCBE", + "vpcPublicSubnet1NATGateway9C16659E", + "vpcPublicSubnet1RouteTable48A2DF9B", + "vpcPublicSubnet1RouteTableAssociation5D3F4579", + "vpcPublicSubnet1Subnet2E65531E", + "vpcPublicSubnet2DefaultRouteA1EC0F60", + "vpcPublicSubnet2EIP9B3743B1", + "vpcPublicSubnet2NATGateway9B8AE11A", + "vpcPublicSubnet2RouteTableEB40D4CB", + "vpcPublicSubnet2RouteTableAssociation21F81B59", + "vpcPublicSubnet2Subnet009B674F", + "vpcA2121C38", + "vpcVPCGW7984C166" + ] + }, + "batchfargatespotcomputeenvResourceSecurityGroup923D2390": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group", + "SecurityGroupEgress": [ { - "Ref": "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754" + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" } - ] + ], + "VpcId": { + "Ref": "vpcA2121C38" + } }, "DependsOn": [ "vpcIGWE57CBDCA", @@ -1144,7 +1225,7 @@ "vpcVPCGW7984C166" ] }, - "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1": { + "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -1200,32 +1281,16 @@ "vpcVPCGW7984C166" ] }, - "batchdemandcomputeenvlaunchtemplate2E12D5CBC": { + "batchfargatespotcomputeenv374749B0": { "Type": "AWS::Batch::ComputeEnvironment", "Properties": { "Type": "MANAGED", "ComputeResources": { - "AllocationStrategy": "BEST_FIT", - "InstanceRole": { - "Fn::GetAtt": [ - "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC", - "Arn" - ] - }, - "InstanceTypes": [ - "optimal" - ], - "LaunchTemplate": { - "LaunchTemplateId": { - "Ref": "ec2launchtemplate" - } - }, "MaxvCpus": 256, - "MinvCpus": 0, "SecurityGroupIds": [ { "Fn::GetAtt": [ - "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5", + "batchfargatespotcomputeenvResourceSecurityGroup923D2390", "GroupId" ] } @@ -1238,14 +1303,11 @@ "Ref": "vpcPrivateSubnet2Subnet7031C2BA" } ], - "Tags": { - "compute-env-tag": "123XYZ" - }, - "Type": "EC2" + "Type": "FARGATE_SPOT" }, "ServiceRole": { "Fn::GetAtt": [ - "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1", + "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0", "Arn" ] }, @@ -1277,43 +1339,31 @@ "vpcVPCGW7984C166" ] }, - "batchjobqueueE3C528F2": { + "batchjobfargatequeue5A12983E": { "Type": "AWS::Batch::JobQueue", "Properties": { "ComputeEnvironmentOrder": [ { "ComputeEnvironment": { - "Ref": "batchunmanagedcomputeenvED550298" + "Ref": "batchfargatecomputeenvE9C3FCA4" }, "Order": 1 }, { "ComputeEnvironment": { - "Ref": "batchdemandcomputeenvlaunchtemplateF8A5B233" + "Ref": "batchfargatespotcomputeenv374749B0" }, "Order": 2 - }, - { - "ComputeEnvironment": { - "Ref": "batchspotcomputeenv2CE4DFD9" - }, - "Order": 3 - }, - { - "ComputeEnvironment": { - "Ref": "batchdemandcomputeenvlaunchtemplate2E12D5CBC" - }, - "Order": 4 } ], "Priority": 1, "State": "ENABLED" } }, - "batchfargatecomputeenvResourceSecurityGroupE2963776": { + "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "batch-stack/batch-fargate-compute-env/Resource-Security-Group", + "GroupDescription": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -1351,7 +1401,7 @@ "vpcVPCGW7984C166" ] }, - "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F": { + "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -1360,7 +1410,17 @@ "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "batch.amazonaws.com" + "Service": { + "Fn::Join": [ + "", + [ + "ec2.", + { + "Ref": "AWS::URLSuffix" + } + ] + ] + } } } ], @@ -1375,7 +1435,7 @@ { "Ref": "AWS::Partition" }, - ":iam::aws:policy/service-role/AWSBatchServiceRole" + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" ] ] } @@ -1407,78 +1467,14 @@ "vpcVPCGW7984C166" ] }, - "batchfargatecomputeenvE9C3FCA4": { - "Type": "AWS::Batch::ComputeEnvironment", - "Properties": { - "Type": "MANAGED", - "ComputeResources": { - "MaxvCpus": 256, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "batchfargatecomputeenvResourceSecurityGroupE2963776", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "vpcPrivateSubnet1Subnet934893E8" - }, - { - "Ref": "vpcPrivateSubnet2Subnet7031C2BA" - } - ], - "Type": "FARGATE" - }, - "ServiceRole": { - "Fn::GetAtt": [ - "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F", - "Arn" - ] - }, - "State": "ENABLED" - }, - "DependsOn": [ - "vpcIGWE57CBDCA", - "vpcPrivateSubnet1DefaultRoute1AA8E2E5", - "vpcPrivateSubnet1RouteTableB41A48CC", - "vpcPrivateSubnet1RouteTableAssociation67945127", - "vpcPrivateSubnet1Subnet934893E8", - "vpcPrivateSubnet2DefaultRouteB0E07F99", - "vpcPrivateSubnet2RouteTable7280F23E", - "vpcPrivateSubnet2RouteTableAssociation007E94D3", - "vpcPrivateSubnet2Subnet7031C2BA", - "vpcPublicSubnet1DefaultRoute10708846", - "vpcPublicSubnet1EIPDA49DCBE", - "vpcPublicSubnet1NATGateway9C16659E", - "vpcPublicSubnet1RouteTable48A2DF9B", - "vpcPublicSubnet1RouteTableAssociation5D3F4579", - "vpcPublicSubnet1Subnet2E65531E", - "vpcPublicSubnet2DefaultRouteA1EC0F60", - "vpcPublicSubnet2EIP9B3743B1", - "vpcPublicSubnet2NATGateway9B8AE11A", - "vpcPublicSubnet2RouteTableEB40D4CB", - "vpcPublicSubnet2RouteTableAssociation21F81B59", - "vpcPublicSubnet2Subnet009B674F", - "vpcA2121C38", - "vpcVPCGW7984C166" - ] - }, - "batchfargatespotcomputeenvResourceSecurityGroup923D2390": { - "Type": "AWS::EC2::SecurityGroup", + "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC": { + "Type": "AWS::IAM::InstanceProfile", "Properties": { - "GroupDescription": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group", - "SecurityGroupEgress": [ + "Roles": [ { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" + "Ref": "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754" } - ], - "VpcId": { - "Ref": "vpcA2121C38" - } + ] }, "DependsOn": [ "vpcIGWE57CBDCA", @@ -1506,7 +1502,7 @@ "vpcVPCGW7984C166" ] }, - "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0": { + "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { @@ -1562,16 +1558,32 @@ "vpcVPCGW7984C166" ] }, - "batchfargatespotcomputeenv374749B0": { + "batchdemandcomputeenvlaunchtemplate2E12D5CBC": { "Type": "AWS::Batch::ComputeEnvironment", "Properties": { "Type": "MANAGED", "ComputeResources": { + "AllocationStrategy": "BEST_FIT", + "InstanceRole": { + "Fn::GetAtt": [ + "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC", + "Arn" + ] + }, + "InstanceTypes": [ + "optimal" + ], + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ec2launchtemplate" + } + }, "MaxvCpus": 256, + "MinvCpus": 0, "SecurityGroupIds": [ { "Fn::GetAtt": [ - "batchfargatespotcomputeenvResourceSecurityGroup923D2390", + "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5", "GroupId" ] } @@ -1584,11 +1596,14 @@ "Ref": "vpcPrivateSubnet2Subnet7031C2BA" } ], - "Type": "FARGATE_SPOT" + "Tags": { + "compute-env-tag": "123XYZ" + }, + "Type": "EC2" }, "ServiceRole": { "Fn::GetAtt": [ - "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0", + "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1", "Arn" ] }, @@ -1620,21 +1635,15 @@ "vpcVPCGW7984C166" ] }, - "batchjobfargatequeue5A12983E": { + "batchwithlaunchtemplateid89A1A604": { "Type": "AWS::Batch::JobQueue", "Properties": { "ComputeEnvironmentOrder": [ { "ComputeEnvironment": { - "Ref": "batchfargatecomputeenvE9C3FCA4" + "Ref": "batchdemandcomputeenvlaunchtemplate2E12D5CBC" }, "Order": 1 - }, - { - "ComputeEnvironment": { - "Ref": "batchfargatespotcomputeenv374749B0" - }, - "Order": 2 } ], "Priority": 1, diff --git a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batchtestsDefaultTestDeployAssertA73A8412.template.json b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batchtestsDefaultTestDeployAssertA73A8412.template.json new file mode 100644 index 0000000000000..9e26dfeeb6e64 --- /dev/null +++ b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batchtestsDefaultTestDeployAssertA73A8412.template.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/integ.json b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/integ.json index 25186aa4394c3..1edeeb413543a 100644 --- a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/integ.json @@ -1,14 +1,11 @@ { "version": "20.0.0", "testCases": { - "integ.batch": { + "batch-tests/DefaultTest": { "stacks": [ "batch-stack" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "batchtestsDefaultTestDeployAssertA73A8412" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/manifest.json index 2dd614ef193fb..adbc595f56190 100644 --- a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/manifest.json @@ -231,82 +231,88 @@ "data": "batchspotcomputeenv2CE4DFD9" } ], - "/batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group/Resource": [ + "/batch-stack/batch-job-queue/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5" + "data": "batchjobqueueE3C528F2" } ], - "/batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role/Resource": [ + "/batch-stack/batch-fargate-compute-env/Resource-Security-Group/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754" + "data": "batchfargatecomputeenvResourceSecurityGroupE2963776" } ], - "/batch-stack/batch-demand-compute-env-launch-template-2/Instance-Profile": [ + "/batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC" + "data": "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F" } ], - "/batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role/Resource": [ + "/batch-stack/batch-fargate-compute-env/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1" + "data": "batchfargatecomputeenvE9C3FCA4" } ], - "/batch-stack/batch-demand-compute-env-launch-template-2/Resource": [ + "/batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchdemandcomputeenvlaunchtemplate2E12D5CBC" + "data": "batchfargatespotcomputeenvResourceSecurityGroup923D2390" } ], - "/batch-stack/batch-job-queue/Resource": [ + "/batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchjobqueueE3C528F2" + "data": "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0" } ], - "/batch-stack/batch-fargate-compute-env/Resource-Security-Group/Resource": [ + "/batch-stack/batch-fargate-spot-compute-env/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchfargatecomputeenvResourceSecurityGroupE2963776" + "data": "batchfargatespotcomputeenv374749B0" } ], - "/batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role/Resource": [ + "/batch-stack/batch-job-fargate-queue/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F" + "data": "batchjobfargatequeue5A12983E" } ], - "/batch-stack/batch-fargate-compute-env/Resource": [ + "/batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchfargatecomputeenvE9C3FCA4" + "data": "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5" } ], - "/batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group/Resource": [ + "/batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchfargatespotcomputeenvResourceSecurityGroup923D2390" + "data": "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754" } ], - "/batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role/Resource": [ + "/batch-stack/batch-demand-compute-env-launch-template-2/Instance-Profile": [ { "type": "aws:cdk:logicalId", - "data": "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0" + "data": "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC" } ], - "/batch-stack/batch-fargate-spot-compute-env/Resource": [ + "/batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchfargatespotcomputeenv374749B0" + "data": "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1" } ], - "/batch-stack/batch-job-fargate-queue/Resource": [ + "/batch-stack/batch-demand-compute-env-launch-template-2/Resource": [ { "type": "aws:cdk:logicalId", - "data": "batchjobfargatequeue5A12983E" + "data": "batchdemandcomputeenvlaunchtemplate2E12D5CBC" + } + ], + "/batch-stack/batch-with-launch-template-id/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "batchwithlaunchtemplateid89A1A604" } ], "/batch-stack/batch-job-repo/Resource": [ @@ -353,6 +359,15 @@ ] }, "displayName": "batch-stack" + }, + "batchtestsDefaultTestDeployAssertA73A8412": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "batchtestsDefaultTestDeployAssertA73A8412.template.json", + "validateOnSynth": false + }, + "displayName": "batch-tests/DefaultTest/DeployAssert" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/tree.json b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/tree.json index aeaca262c2d79..762d3f29c42f1 100644 --- a/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.33" + "version": "10.1.71" } }, "batch-stack": { @@ -1240,21 +1240,66 @@ "version": "0.0.0" } }, - "batch-demand-compute-env-launch-template-2": { - "id": "batch-demand-compute-env-launch-template-2", - "path": "batch-stack/batch-demand-compute-env-launch-template-2", + "batch-job-queue": { + "id": "batch-job-queue", + "path": "batch-stack/batch-job-queue", + "children": { + "Resource": { + "id": "Resource", + "path": "batch-stack/batch-job-queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Batch::JobQueue", + "aws:cdk:cloudformation:props": { + "computeEnvironmentOrder": [ + { + "computeEnvironment": { + "Ref": "batchunmanagedcomputeenvED550298" + }, + "order": 1 + }, + { + "computeEnvironment": { + "Ref": "batchdemandcomputeenvlaunchtemplateF8A5B233" + }, + "order": 2 + }, + { + "computeEnvironment": { + "Ref": "batchspotcomputeenv2CE4DFD9" + }, + "order": 3 + } + ], + "priority": 1, + "state": "ENABLED" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-batch.CfnJobQueue", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-batch.JobQueue", + "version": "0.0.0" + } + }, + "batch-fargate-compute-env": { + "id": "batch-fargate-compute-env", + "path": "batch-stack/batch-fargate-compute-env", "children": { "Resource-Security-Group": { "id": "Resource-Security-Group", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group", + "path": "batch-stack/batch-fargate-compute-env/Resource-Security-Group", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group/Resource", + "path": "batch-stack/batch-fargate-compute-env/Resource-Security-Group/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group", + "groupDescription": "batch-stack/batch-fargate-compute-env/Resource-Security-Group", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -1278,13 +1323,13 @@ "version": "0.0.0" } }, - "Ecs-Instance-Role": { - "id": "Ecs-Instance-Role", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role", + "Resource-Service-Instance-Role": { + "id": "Resource-Service-Instance-Role", + "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role/Resource", + "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1294,17 +1339,7 @@ "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": { - "Fn::Join": [ - "", - [ - "ec2.", - { - "Ref": "AWS::URLSuffix" - } - ] - ] - } + "Service": "batch.amazonaws.com" } } ], @@ -1319,7 +1354,7 @@ { "Ref": "AWS::Partition" }, - ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + ":iam::aws:policy/service-role/AWSBatchServiceRole" ] ] } @@ -1337,31 +1372,98 @@ "version": "0.0.0" } }, - "Instance-Profile": { - "id": "Instance-Profile", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Instance-Profile", + "Resource": { + "id": "Resource", + "path": "batch-stack/batch-fargate-compute-env/Resource", "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:type": "AWS::Batch::ComputeEnvironment", "aws:cdk:cloudformation:props": { - "roles": [ - { - "Ref": "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754" + "type": "MANAGED", + "computeResources": { + "maxvCpus": 256, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "batchfargatecomputeenvResourceSecurityGroupE2963776", + "GroupId" + ] + } + ], + "subnets": [ + { + "Ref": "vpcPrivateSubnet1Subnet934893E8" + }, + { + "Ref": "vpcPrivateSubnet2Subnet7031C2BA" + } + ], + "type": "FARGATE" + }, + "serviceRole": { + "Fn::GetAtt": [ + "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F", + "Arn" + ] + }, + "state": "ENABLED" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-batch.CfnComputeEnvironment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-batch.ComputeEnvironment", + "version": "0.0.0" + } + }, + "batch-fargate-spot-compute-env": { + "id": "batch-fargate-spot-compute-env", + "path": "batch-stack/batch-fargate-spot-compute-env", + "children": { + "Resource-Security-Group": { + "id": "Resource-Security-Group", + "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group", + "children": { + "Resource": { + "id": "Resource", + "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "vpcA2121C38" + } } - ] + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnInstanceProfile", + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", "version": "0.0.0" } }, "Resource-Service-Instance-Role": { "id": "Resource-Service-Instance-Role", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role", + "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role/Resource", + "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1406,22 +1508,17 @@ }, "Resource": { "id": "Resource", - "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource", + "path": "batch-stack/batch-fargate-spot-compute-env/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Batch::ComputeEnvironment", "aws:cdk:cloudformation:props": { "type": "MANAGED", "computeResources": { - "launchTemplate": { - "launchTemplateId": { - "Ref": "ec2launchtemplate" - } - }, "maxvCpus": 256, "securityGroupIds": [ { "Fn::GetAtt": [ - "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5", + "batchfargatespotcomputeenvResourceSecurityGroup923D2390", "GroupId" ] } @@ -1434,25 +1531,11 @@ "Ref": "vpcPrivateSubnet2Subnet7031C2BA" } ], - "tags": { - "compute-env-tag": "123XYZ" - }, - "type": "EC2", - "allocationStrategy": "BEST_FIT", - "instanceRole": { - "Fn::GetAtt": [ - "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC", - "Arn" - ] - }, - "instanceTypes": [ - "optimal" - ], - "minvCpus": 0 + "type": "FARGATE_SPOT" }, "serviceRole": { "Fn::GetAtt": [ - "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1", + "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0", "Arn" ] }, @@ -1470,40 +1553,28 @@ "version": "0.0.0" } }, - "batch-job-queue": { - "id": "batch-job-queue", - "path": "batch-stack/batch-job-queue", + "batch-job-fargate-queue": { + "id": "batch-job-fargate-queue", + "path": "batch-stack/batch-job-fargate-queue", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-job-queue/Resource", + "path": "batch-stack/batch-job-fargate-queue/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Batch::JobQueue", "aws:cdk:cloudformation:props": { "computeEnvironmentOrder": [ { "computeEnvironment": { - "Ref": "batchunmanagedcomputeenvED550298" + "Ref": "batchfargatecomputeenvE9C3FCA4" }, "order": 1 }, { "computeEnvironment": { - "Ref": "batchdemandcomputeenvlaunchtemplateF8A5B233" + "Ref": "batchfargatespotcomputeenv374749B0" }, "order": 2 - }, - { - "computeEnvironment": { - "Ref": "batchspotcomputeenv2CE4DFD9" - }, - "order": 3 - }, - { - "computeEnvironment": { - "Ref": "batchdemandcomputeenvlaunchtemplate2E12D5CBC" - }, - "order": 4 } ], "priority": 1, @@ -1521,21 +1592,21 @@ "version": "0.0.0" } }, - "batch-fargate-compute-env": { - "id": "batch-fargate-compute-env", - "path": "batch-stack/batch-fargate-compute-env", + "batch-demand-compute-env-launch-template-2": { + "id": "batch-demand-compute-env-launch-template-2", + "path": "batch-stack/batch-demand-compute-env-launch-template-2", "children": { "Resource-Security-Group": { "id": "Resource-Security-Group", - "path": "batch-stack/batch-fargate-compute-env/Resource-Security-Group", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-fargate-compute-env/Resource-Security-Group/Resource", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "batch-stack/batch-fargate-compute-env/Resource-Security-Group", + "groupDescription": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Security-Group", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -1559,13 +1630,13 @@ "version": "0.0.0" } }, - "Resource-Service-Instance-Role": { - "id": "Resource-Service-Instance-Role", - "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role", + "Ecs-Instance-Role": { + "id": "Ecs-Instance-Role", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-fargate-compute-env/Resource-Service-Instance-Role/Resource", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Ecs-Instance-Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1575,7 +1646,17 @@ "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "batch.amazonaws.com" + "Service": { + "Fn::Join": [ + "", + [ + "ec2.", + { + "Ref": "AWS::URLSuffix" + } + ] + ] + } } } ], @@ -1590,7 +1671,7 @@ { "Ref": "AWS::Partition" }, - ":iam::aws:policy/service-role/AWSBatchServiceRole" + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" ] ] } @@ -1608,98 +1689,31 @@ "version": "0.0.0" } }, - "Resource": { - "id": "Resource", - "path": "batch-stack/batch-fargate-compute-env/Resource", + "Instance-Profile": { + "id": "Instance-Profile", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Instance-Profile", "attributes": { - "aws:cdk:cloudformation:type": "AWS::Batch::ComputeEnvironment", + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { - "type": "MANAGED", - "computeResources": { - "maxvCpus": 256, - "securityGroupIds": [ - { - "Fn::GetAtt": [ - "batchfargatecomputeenvResourceSecurityGroupE2963776", - "GroupId" - ] - } - ], - "subnets": [ - { - "Ref": "vpcPrivateSubnet1Subnet934893E8" - }, - { - "Ref": "vpcPrivateSubnet2Subnet7031C2BA" - } - ], - "type": "FARGATE" - }, - "serviceRole": { - "Fn::GetAtt": [ - "batchfargatecomputeenvResourceServiceInstanceRole94D7AA5F", - "Arn" - ] - }, - "state": "ENABLED" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-batch.CfnComputeEnvironment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-batch.ComputeEnvironment", - "version": "0.0.0" - } - }, - "batch-fargate-spot-compute-env": { - "id": "batch-fargate-spot-compute-env", - "path": "batch-stack/batch-fargate-spot-compute-env", - "children": { - "Resource-Security-Group": { - "id": "Resource-Security-Group", - "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group", - "children": { - "Resource": { - "id": "Resource", - "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "batch-stack/batch-fargate-spot-compute-env/Resource-Security-Group", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "vpcA2121C38" - } + "roles": [ + { + "Ref": "batchdemandcomputeenvlaunchtemplate2EcsInstanceRoleEE146754" } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } + ] } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "fqn": "@aws-cdk/aws-iam.CfnInstanceProfile", "version": "0.0.0" } }, "Resource-Service-Instance-Role": { "id": "Resource-Service-Instance-Role", - "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-fargate-spot-compute-env/Resource-Service-Instance-Role/Resource", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource-Service-Instance-Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1744,17 +1758,22 @@ }, "Resource": { "id": "Resource", - "path": "batch-stack/batch-fargate-spot-compute-env/Resource", + "path": "batch-stack/batch-demand-compute-env-launch-template-2/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Batch::ComputeEnvironment", "aws:cdk:cloudformation:props": { "type": "MANAGED", "computeResources": { + "launchTemplate": { + "launchTemplateId": { + "Ref": "ec2launchtemplate" + } + }, "maxvCpus": 256, "securityGroupIds": [ { "Fn::GetAtt": [ - "batchfargatespotcomputeenvResourceSecurityGroup923D2390", + "batchdemandcomputeenvlaunchtemplate2ResourceSecurityGroupBEA8DDD5", "GroupId" ] } @@ -1767,11 +1786,25 @@ "Ref": "vpcPrivateSubnet2Subnet7031C2BA" } ], - "type": "FARGATE_SPOT" + "tags": { + "compute-env-tag": "123XYZ" + }, + "type": "EC2", + "allocationStrategy": "BEST_FIT", + "instanceRole": { + "Fn::GetAtt": [ + "batchdemandcomputeenvlaunchtemplate2InstanceProfileC5A36CBC", + "Arn" + ] + }, + "instanceTypes": [ + "optimal" + ], + "minvCpus": 0 }, "serviceRole": { "Fn::GetAtt": [ - "batchfargatespotcomputeenvResourceServiceInstanceRole6462BFB0", + "batchdemandcomputeenvlaunchtemplate2ResourceServiceInstanceRole41CADAC1", "Arn" ] }, @@ -1789,28 +1822,22 @@ "version": "0.0.0" } }, - "batch-job-fargate-queue": { - "id": "batch-job-fargate-queue", - "path": "batch-stack/batch-job-fargate-queue", + "batch-with-launch-template-id": { + "id": "batch-with-launch-template-id", + "path": "batch-stack/batch-with-launch-template-id", "children": { "Resource": { "id": "Resource", - "path": "batch-stack/batch-job-fargate-queue/Resource", + "path": "batch-stack/batch-with-launch-template-id/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Batch::JobQueue", "aws:cdk:cloudformation:props": { "computeEnvironmentOrder": [ { "computeEnvironment": { - "Ref": "batchfargatecomputeenvE9C3FCA4" + "Ref": "batchdemandcomputeenvlaunchtemplate2E12D5CBC" }, "order": 1 - }, - { - "computeEnvironment": { - "Ref": "batchfargatespotcomputeenv374749B0" - }, - "order": 2 } ], "priority": 1, @@ -2248,6 +2275,42 @@ "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "batch-tests": { + "id": "batch-tests", + "path": "batch-tests", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "batch-tests/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "batch-tests/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.71" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "batch-tests/DefaultTest/DeployAssert", + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-batch/test/integ.batch.ts b/packages/@aws-cdk/aws-batch/test/integ.batch.ts index 47e21cb14ca53..e2206b072c73b 100644 --- a/packages/@aws-cdk/aws-batch/test/integ.batch.ts +++ b/packages/@aws-cdk/aws-batch/test/integ.batch.ts @@ -4,10 +4,10 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; import * as batch from '../lib/'; -export const app = new cdk.App(); - +const app = new cdk.App(); const stack = new cdk.Stack(app, 'batch-stack'); const vpc = new ec2.Vpc(stack, 'vpc'); @@ -63,26 +63,10 @@ new batch.JobQueue(stack, 'batch-job-queue', { }), order: 3, }, - { - computeEnvironment: new batch.ComputeEnvironment(stack, 'batch-demand-compute-env-launch-template-2', { - managed: true, - computeResources: { - type: batch.ComputeResourceType.ON_DEMAND, - vpc, - launchTemplate: { - launchTemplateId: launchTemplate.ref as string, - }, - computeResourcesTags: { - 'compute-env-tag': '123XYZ', - }, - }, - }), - order: 4, - }, ], }); -// Split out into two job queues because each queue +// Split out into multiple job queues because each queue // supports a max of 3 compute environments new batch.JobQueue(stack, 'batch-job-fargate-queue', { computeEnvironments: [ @@ -109,6 +93,27 @@ new batch.JobQueue(stack, 'batch-job-fargate-queue', { ], }); +new batch.JobQueue(stack, 'batch-with-launch-template-id', { + computeEnvironments: [ + { + computeEnvironment: new batch.ComputeEnvironment(stack, 'batch-demand-compute-env-launch-template-2', { + managed: true, + computeResources: { + type: batch.ComputeResourceType.ON_DEMAND, + vpc, + launchTemplate: { + launchTemplateId: launchTemplate.ref as string, + }, + computeResourcesTags: { + 'compute-env-tag': '123XYZ', + }, + }, + }), + order: 1, + }, + ], +}); + const repo = new ecr.Repository(stack, 'batch-job-repo'); const secret = new secretsmanager.Secret(stack, 'batch-secret'); @@ -138,3 +143,9 @@ new batch.JobDefinition(stack, 'batch-job-def-fargate', { }, }, }); + +new integ.IntegTest(app, 'batch-tests', { + testCases: [stack], +}); + +app.synth();