Skip to content

Commit 92e6c67

Browse files
authored
feat(batch): new L2 Constructs (#24775)
Adds a new set of L2s for Batch. See https://github.com/aws/aws-cdk-rfcs/pull/484/files for details. This contains breaking changes to the alpha module! To use the previous API, pin your version of `aws-batch-alpha` to `2.71.0`. BREAKING CHANGE: `ComputeEnvironment` has been removed and replaced by `ManagedEc2EcsComputeEnvironment`, `ManagedEc2EksComputeEnvironment`, and `UnmanagedComputeEnvironment`. `JobDefinition` has been removed and replaced by `EcsJobDefinition`, `EksJobDefinition`, and `MultiNodeJobDefinition` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent adc1a13 commit 92e6c67

File tree

161 files changed

+25617
-15082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+25617
-15082
lines changed

packages/@aws-cdk-testing/framework-integ/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"lint": "cdk-lint",
1010
"pkglint": "pkglint -f",
1111
"test": "cdk-test",
12+
"integ": "integ-runner",
1213
"package": "cdk-package",
1314
"build+test": "yarn build && yarn test",
1415
"build+extract": "yarn build",
@@ -29,6 +30,7 @@
2930
"license": "Apache-2.0",
3031
"devDependencies": {
3132
"@aws-cdk/cdk-build-tools": "0.0.0",
33+
"@aws-cdk/aws-batch-alpha": "0.0.0",
3234
"delay": "5.0.0",
3335
"@aws-cdk/pkglint": "0.0.0"
3436
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.placement-group.js

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/BatchWithEFSTestDefaultTestDeployAssert0F887B55.assets.json renamed to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.placement-group.js.snapshot/BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": {
44
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
55
"source": {
6-
"path": "BatchWithEFSTestDefaultTestDeployAssert0F887B55.template.json",
6+
"path": "BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "30.1.0",
3+
"testCases": {
4+
"BatchEcsJobDefinitionTest/DefaultTest": {
5+
"stacks": [
6+
"stack"
7+
],
8+
"assertionStack": "BatchEcsJobDefinitionTest/DefaultTest/DeployAssert",
9+
"assertionStackName": "BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
{
2-
"version": "21.0.0",
2+
"version": "30.1.0",
33
"artifacts": {
4-
"Tree": {
5-
"type": "cdk:tree",
6-
"properties": {
7-
"file": "tree.json"
8-
}
9-
},
10-
"BatchDefaultEnvVarsStack.assets": {
4+
"stack.assets": {
115
"type": "cdk:asset-manifest",
126
"properties": {
13-
"file": "BatchDefaultEnvVarsStack.assets.json",
7+
"file": "stack.assets.json",
148
"requiresBootstrapStackVersion": 6,
159
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
1610
}
1711
},
18-
"BatchDefaultEnvVarsStack": {
12+
"stack": {
1913
"type": "aws:cloudformation:stack",
2014
"environment": "aws://unknown-account/unknown-region",
2115
"properties": {
22-
"templateFile": "BatchDefaultEnvVarsStack.template.json",
16+
"templateFile": "stack.template.json",
2317
"validateOnSynth": false,
2418
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2519
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
26-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fa4cb3c0495612b2b5dea9687948520b07f859705061dad691367153183cbc90.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0b927fc6af35b0be2fbb51ba554a3cab79965916b4fd4360b714ca91692778b6.json",
2721
"requiresBootstrapStackVersion": 6,
2822
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2923
"additionalDependencies": [
30-
"BatchDefaultEnvVarsStack.assets"
24+
"stack.assets"
3125
],
3226
"lookupRole": {
3327
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
@@ -36,57 +30,93 @@
3630
}
3731
},
3832
"dependencies": [
39-
"BatchDefaultEnvVarsStack.assets"
33+
"stack.assets"
4034
],
4135
"metadata": {
42-
"/BatchDefaultEnvVarsStack/JobDefinition/Resource": [
36+
"/stack/placementGroupNoProps/Resource": [
37+
{
38+
"type": "aws:cdk:logicalId",
39+
"data": "placementGroupNoProps90C69A95"
40+
}
41+
],
42+
"/stack/PlacementGroupOnlyPartition/Resource": [
43+
{
44+
"type": "aws:cdk:logicalId",
45+
"data": "PlacementGroupOnlyPartitionE64D552B"
46+
}
47+
],
48+
"/stack/PlacementGroupOnlySpreadLevel/Resource": [
49+
{
50+
"type": "aws:cdk:logicalId",
51+
"data": "PlacementGroupOnlySpreadLevel485BBC0A"
52+
}
53+
],
54+
"/stack/PlacementGroupOnlyStrategyPartition/Resource": [
55+
{
56+
"type": "aws:cdk:logicalId",
57+
"data": "PlacementGroupOnlyStrategyPartition580333B9"
58+
}
59+
],
60+
"/stack/PlacementGroupOnlyStrategyCluster/Resource": [
61+
{
62+
"type": "aws:cdk:logicalId",
63+
"data": "PlacementGroupOnlyStrategyCluster0992DD47"
64+
}
65+
],
66+
"/stack/PlacementSpreadOnly/Resource": [
67+
{
68+
"type": "aws:cdk:logicalId",
69+
"data": "PlacementSpreadOnlyBE12475D"
70+
}
71+
],
72+
"/stack/PlacementSpreadHost/Resource": [
4373
{
4474
"type": "aws:cdk:logicalId",
45-
"data": "JobDefinition24FFE3ED"
75+
"data": "PlacementSpreadHostAFE1CB82"
4676
}
4777
],
48-
"/BatchDefaultEnvVarsStack/JobDefinitionTags/Resource": [
78+
"/stack/PlacementSpreadRack/Resource": [
4979
{
5080
"type": "aws:cdk:logicalId",
51-
"data": "JobDefinitionTags76FA063A"
81+
"data": "PlacementSpreadRackAABF96D4"
5282
}
5383
],
54-
"/BatchDefaultEnvVarsStack/BootstrapVersion": [
84+
"/stack/BootstrapVersion": [
5585
{
5686
"type": "aws:cdk:logicalId",
5787
"data": "BootstrapVersion"
5888
}
5989
],
60-
"/BatchDefaultEnvVarsStack/CheckBootstrapVersion": [
90+
"/stack/CheckBootstrapVersion": [
6191
{
6292
"type": "aws:cdk:logicalId",
6393
"data": "CheckBootstrapVersion"
6494
}
6595
]
6696
},
67-
"displayName": "BatchDefaultEnvVarsStack"
97+
"displayName": "stack"
6898
},
69-
"IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets": {
99+
"BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.assets": {
70100
"type": "cdk:asset-manifest",
71101
"properties": {
72-
"file": "IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets.json",
102+
"file": "BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.assets.json",
73103
"requiresBootstrapStackVersion": 6,
74104
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
75105
}
76106
},
77-
"IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2": {
107+
"BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B": {
78108
"type": "aws:cloudformation:stack",
79109
"environment": "aws://unknown-account/unknown-region",
80110
"properties": {
81-
"templateFile": "IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.template.json",
111+
"templateFile": "BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.template.json",
82112
"validateOnSynth": false,
83113
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
84114
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
85-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/674d442d4a977a672cccae088b5eabcf91e06ee46b2464e4437c0332e04cf1a8.json",
115+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
86116
"requiresBootstrapStackVersion": 6,
87117
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
88118
"additionalDependencies": [
89-
"IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets"
119+
"BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.assets"
90120
],
91121
"lookupRole": {
92122
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
@@ -95,53 +125,29 @@
95125
}
96126
},
97127
"dependencies": [
98-
"IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.assets"
128+
"BatchEcsJobDefinitionTestDefaultTestDeployAssertE5BAAC9B.assets"
99129
],
100130
"metadata": {
101-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/Default/Default": [
102-
{
103-
"type": "aws:cdk:logicalId",
104-
"data": "AwsApiCallBatchdescribeJobDefinitions"
105-
}
106-
],
107-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/AssertEqualsBatchdescribeJobDefinitions/Default/Default": [
108-
{
109-
"type": "aws:cdk:logicalId",
110-
"data": "AwsApiCallBatchdescribeJobDefinitionsAssertEqualsBatchdescribeJobDefinitions39706B7C"
111-
}
112-
],
113-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/AssertEqualsBatchdescribeJobDefinitions/AssertionResults": [
114-
{
115-
"type": "aws:cdk:logicalId",
116-
"data": "AssertionResultsAssertEqualsBatchdescribeJobDefinitions"
117-
}
118-
],
119-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [
120-
{
121-
"type": "aws:cdk:logicalId",
122-
"data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73"
123-
}
124-
],
125-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [
126-
{
127-
"type": "aws:cdk:logicalId",
128-
"data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F"
129-
}
130-
],
131-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/BootstrapVersion": [
131+
"/BatchEcsJobDefinitionTest/DefaultTest/DeployAssert/BootstrapVersion": [
132132
{
133133
"type": "aws:cdk:logicalId",
134134
"data": "BootstrapVersion"
135135
}
136136
],
137-
"/IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/CheckBootstrapVersion": [
137+
"/BatchEcsJobDefinitionTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [
138138
{
139139
"type": "aws:cdk:logicalId",
140140
"data": "CheckBootstrapVersion"
141141
}
142142
]
143143
},
144-
"displayName": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert"
144+
"displayName": "BatchEcsJobDefinitionTest/DefaultTest/DeployAssert"
145+
},
146+
"Tree": {
147+
"type": "cdk:tree",
148+
"properties": {
149+
"file": "tree.json"
150+
}
145151
}
146152
}
147153
}

packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.js.snapshot/batch-stack.assets.json renamed to packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.placement-group.js.snapshot/stack.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"version": "30.1.0",
33
"files": {
4-
"dea8441064e2b7f93a29d086bcfc92bbdd9b163aed56cc08208f3ec941e96441": {
4+
"0b927fc6af35b0be2fbb51ba554a3cab79965916b4fd4360b714ca91692778b6": {
55
"source": {
6-
"path": "batch-stack.template.json",
6+
"path": "stack.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "dea8441064e2b7f93a29d086bcfc92bbdd9b163aed56cc08208f3ec941e96441.json",
12+
"objectKey": "0b927fc6af35b0be2fbb51ba554a3cab79965916b4fd4360b714ca91692778b6.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

0 commit comments

Comments
 (0)