Skip to content

Commit 5d7c1aa

Browse files
authored
chore(stepfunctions-tasks): add a doc and an integ test for spot instance fleets in EMR (#27809)
This PR adds the following points for spot instance fleet in EMR. - a doc that blockDurationMinutes is no longer available to new customers from July 1, 2021. - https://docs.aws.amazon.com/emr/latest/APIReference/API_SpotProvisioningSpecification.html - an integ test for spot instance fleet in EMR. - There was no integ test, so I added. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7385ffb commit 5d7c1aa

10 files changed

+972
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emr/integ.emr-create-cluster-with-spot-instance-fleet.js.snapshot/EmrCreateClusterTestDefaultTestDeployAssert697DC891.assets.json

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

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emr/integ.emr-create-cluster-with-spot-instance-fleet.js.snapshot/EmrCreateClusterTestDefaultTestDeployAssert697DC891.template.json

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

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emr/integ.emr-create-cluster-with-spot-instance-fleet.js.snapshot/aws-cdk-emr-create-cluster-with-spot-instance-fleet.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
{
2+
"Resources": {
3+
"EmrCreateClusterServiceRole5251910D": {
4+
"Type": "AWS::IAM::Role",
5+
"Properties": {
6+
"AssumeRolePolicyDocument": {
7+
"Statement": [
8+
{
9+
"Action": "sts:AssumeRole",
10+
"Condition": {
11+
"StringEquals": {
12+
"aws:RequestTag/for-use-with-amazon-emr-managed-policies": "true"
13+
}
14+
},
15+
"Effect": "Allow",
16+
"Principal": {
17+
"Service": "elasticmapreduce.amazonaws.com"
18+
}
19+
}
20+
],
21+
"Version": "2012-10-17"
22+
},
23+
"ManagedPolicyArns": [
24+
{
25+
"Fn::Join": [
26+
"",
27+
[
28+
"arn:",
29+
{
30+
"Ref": "AWS::Partition"
31+
},
32+
":iam::aws:policy/service-role/AmazonEMRServicePolicy_v2"
33+
]
34+
]
35+
}
36+
]
37+
}
38+
},
39+
"EmrCreateClusterInstanceRoleC80466F5": {
40+
"Type": "AWS::IAM::Role",
41+
"Properties": {
42+
"AssumeRolePolicyDocument": {
43+
"Statement": [
44+
{
45+
"Action": "sts:AssumeRole",
46+
"Effect": "Allow",
47+
"Principal": {
48+
"Service": "ec2.amazonaws.com"
49+
}
50+
}
51+
],
52+
"Version": "2012-10-17"
53+
}
54+
}
55+
},
56+
"EmrCreateClusterInstanceProfileC1729180": {
57+
"Type": "AWS::IAM::InstanceProfile",
58+
"Properties": {
59+
"InstanceProfileName": {
60+
"Ref": "EmrCreateClusterInstanceRoleC80466F5"
61+
},
62+
"Roles": [
63+
{
64+
"Ref": "EmrCreateClusterInstanceRoleC80466F5"
65+
}
66+
]
67+
}
68+
},
69+
"SMRole49C19C48": {
70+
"Type": "AWS::IAM::Role",
71+
"Properties": {
72+
"AssumeRolePolicyDocument": {
73+
"Statement": [
74+
{
75+
"Action": "sts:AssumeRole",
76+
"Effect": "Allow",
77+
"Principal": {
78+
"Service": "states.amazonaws.com"
79+
}
80+
}
81+
],
82+
"Version": "2012-10-17"
83+
}
84+
}
85+
},
86+
"SMRoleDefaultPolicy34CA15C7": {
87+
"Type": "AWS::IAM::Policy",
88+
"Properties": {
89+
"PolicyDocument": {
90+
"Statement": [
91+
{
92+
"Action": [
93+
"elasticmapreduce:DescribeCluster",
94+
"elasticmapreduce:RunJobFlow",
95+
"elasticmapreduce:TerminateJobFlows"
96+
],
97+
"Effect": "Allow",
98+
"Resource": "*"
99+
},
100+
{
101+
"Action": "iam:PassRole",
102+
"Effect": "Allow",
103+
"Resource": [
104+
{
105+
"Fn::GetAtt": [
106+
"EmrCreateClusterInstanceRoleC80466F5",
107+
"Arn"
108+
]
109+
},
110+
{
111+
"Fn::GetAtt": [
112+
"EmrCreateClusterServiceRole5251910D",
113+
"Arn"
114+
]
115+
}
116+
]
117+
},
118+
{
119+
"Action": "elasticmapreduce:AddTags",
120+
"Effect": "Allow",
121+
"Resource": {
122+
"Fn::Join": [
123+
"",
124+
[
125+
"arn:",
126+
{
127+
"Ref": "AWS::Partition"
128+
},
129+
":elasticmapreduce:",
130+
{
131+
"Ref": "AWS::Region"
132+
},
133+
":",
134+
{
135+
"Ref": "AWS::AccountId"
136+
},
137+
":cluster/*"
138+
]
139+
]
140+
}
141+
},
142+
{
143+
"Action": [
144+
"events:DescribeRule",
145+
"events:PutRule",
146+
"events:PutTargets"
147+
],
148+
"Effect": "Allow",
149+
"Resource": {
150+
"Fn::Join": [
151+
"",
152+
[
153+
"arn:",
154+
{
155+
"Ref": "AWS::Partition"
156+
},
157+
":events:",
158+
{
159+
"Ref": "AWS::Region"
160+
},
161+
":",
162+
{
163+
"Ref": "AWS::AccountId"
164+
},
165+
":rule/StepFunctionsGetEventForEMRRunJobFlowRule"
166+
]
167+
]
168+
}
169+
}
170+
],
171+
"Version": "2012-10-17"
172+
},
173+
"PolicyName": "SMRoleDefaultPolicy34CA15C7",
174+
"Roles": [
175+
{
176+
"Ref": "SMRole49C19C48"
177+
}
178+
]
179+
}
180+
},
181+
"SM934E715A": {
182+
"Type": "AWS::StepFunctions::StateMachine",
183+
"Properties": {
184+
"DefinitionString": {
185+
"Fn::Join": [
186+
"",
187+
[
188+
"{\"StartAt\":\"EmrCreateCluster\",\"States\":{\"EmrCreateCluster\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:",
189+
{
190+
"Ref": "AWS::Partition"
191+
},
192+
":states:::elasticmapreduce:createCluster.sync\",\"Parameters\":{\"Instances\":{\"InstanceFleets\":[{\"InstanceFleetType\":\"MASTER\",\"InstanceTypeConfigs\":[{\"InstanceType\":\"m5.xlarge\",\"WeightedCapacity\":1}],\"LaunchSpecifications\":{\"SpotSpecification\":{\"AllocationStrategy\":\"capacity-optimized\",\"TimeoutAction\":\"TERMINATE_CLUSTER\",\"TimeoutDurationMinutes\":60}},\"Name\":\"Master\",\"TargetSpotCapacity\":1}],\"KeepJobFlowAliveWhenNoSteps\":true},\"JobFlowRole\":\"",
193+
{
194+
"Ref": "EmrCreateClusterInstanceRoleC80466F5"
195+
},
196+
"\",\"Name\":\"Cluster\",\"ServiceRole\":\"",
197+
{
198+
"Ref": "EmrCreateClusterServiceRole5251910D"
199+
},
200+
"\",\"ReleaseLabel\":\"emr-5.36.1\",\"Tags\":[{\"Key\":\"Key\",\"Value\":\"Value\"}],\"VisibleToAllUsers\":true}}}}"
201+
]
202+
]
203+
},
204+
"RoleArn": {
205+
"Fn::GetAtt": [
206+
"SMRole49C19C48",
207+
"Arn"
208+
]
209+
}
210+
},
211+
"DependsOn": [
212+
"SMRoleDefaultPolicy34CA15C7",
213+
"SMRole49C19C48"
214+
],
215+
"UpdateReplacePolicy": "Delete",
216+
"DeletionPolicy": "Delete"
217+
}
218+
},
219+
"Parameters": {
220+
"BootstrapVersion": {
221+
"Type": "AWS::SSM::Parameter::Value<String>",
222+
"Default": "/cdk-bootstrap/hnb659fds/version",
223+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
224+
}
225+
},
226+
"Rules": {
227+
"CheckBootstrapVersion": {
228+
"Assertions": [
229+
{
230+
"Assert": {
231+
"Fn::Not": [
232+
{
233+
"Fn::Contains": [
234+
[
235+
"1",
236+
"2",
237+
"3",
238+
"4",
239+
"5"
240+
],
241+
{
242+
"Ref": "BootstrapVersion"
243+
}
244+
]
245+
}
246+
]
247+
},
248+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
249+
}
250+
]
251+
}
252+
}
253+
}

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emr/integ.emr-create-cluster-with-spot-instance-fleet.js.snapshot/cdk.out

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

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/emr/integ.emr-create-cluster-with-spot-instance-fleet.js.snapshot/integ.json

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

0 commit comments

Comments
 (0)