Skip to content

Commit 823cab3

Browse files
authored
feat(stepfunctions-tasks): support for the step functions mediaconvert optimized integration for createJob api (#30300)
Step Functions recently released an [Optimized Integration for MediaConvert CreateJob API](https://docs.aws.amazon.com/step-functions/latest/dg/connect-mediaconvert.html) and these changes add support for the MediaConvert CreateJob task to Step Functions state machines. ### Issue # (if applicable) Closes [#30299](#30299) ### Reason for this change The aws-stepfunctions-tasks now needs to support creating MediaConvert CreateJob tasks ### Description of changes Added a new L2 construct for MediaConvert Create-Job Task: ``packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/mediaconvert/create-job.ts`` ### Description of how you validated changes Unit test - ``packages/aws-cdk-lib/aws-stepfunctions-tasks/test/mediaconvert/create-job.test.ts`` Integration test - ``packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/mediaconvert/test/integ.create-job.ts`` Verified the State Machine with MediaConvert CreateJob Task with all the necessary permissions ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 544e54a commit 823cab3

File tree

13 files changed

+1105
-0
lines changed

13 files changed

+1105
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/mediaconvert/test/integ.create-job.js.snapshot/MediaConvertCreateJobTestDefaultTestDeployAssertA293ABFD.assets.json

Lines changed: 19 additions & 0 deletions
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/mediaconvert/test/integ.create-job.js.snapshot/MediaConvertCreateJobTestDefaultTestDeployAssertA293ABFD.template.json

Lines changed: 36 additions & 0 deletions
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/mediaconvert/test/integ.create-job.js.snapshot/aws-cdk-mediaconvert-create-job-test-stack.assets.json

Lines changed: 19 additions & 0 deletions
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,115 @@
1+
{
2+
"Resources": {
3+
"StateMachineRoleB840431D": {
4+
"Type": "AWS::IAM::Role",
5+
"Properties": {
6+
"AssumeRolePolicyDocument": {
7+
"Statement": [
8+
{
9+
"Action": "sts:AssumeRole",
10+
"Effect": "Allow",
11+
"Principal": {
12+
"Service": "states.amazonaws.com"
13+
}
14+
}
15+
],
16+
"Version": "2012-10-17"
17+
}
18+
}
19+
},
20+
"StateMachineRoleDefaultPolicyDF1E6607": {
21+
"Type": "AWS::IAM::Policy",
22+
"Properties": {
23+
"PolicyDocument": {
24+
"Statement": [
25+
{
26+
"Action": "iam:PassRole",
27+
"Condition": {
28+
"StringLike": {
29+
"iam:PassedToService": "mediaconvert.amazonaws.com"
30+
}
31+
},
32+
"Effect": "Allow",
33+
"Resource": "arn:aws:iam::123456789012:role/MediaConvertRole"
34+
},
35+
{
36+
"Action": "mediaconvert:CreateJob",
37+
"Effect": "Allow",
38+
"Resource": "*"
39+
}
40+
],
41+
"Version": "2012-10-17"
42+
},
43+
"PolicyName": "StateMachineRoleDefaultPolicyDF1E6607",
44+
"Roles": [
45+
{
46+
"Ref": "StateMachineRoleB840431D"
47+
}
48+
]
49+
}
50+
},
51+
"StateMachine2E01A3A5": {
52+
"Type": "AWS::StepFunctions::StateMachine",
53+
"Properties": {
54+
"DefinitionString": {
55+
"Fn::Join": [
56+
"",
57+
[
58+
"{\"StartAt\":\"MediaConvertCreateJob\",\"States\":{\"MediaConvertCreateJob\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:",
59+
{
60+
"Ref": "AWS::Partition"
61+
},
62+
":states:::mediaconvert:createJob\",\"Parameters\":{\"Role\":\"arn:aws:iam::123456789012:role/MediaConvertRole\",\"Settings\":{\"OutputGroups\":[{\"Outputs\":[{\"ContainerSettings\":{\"Container\":\"MP4\"},\"VideoDescription\":{\"CodecSettings\":{\"Codec\":\"H_264\",\"H264Settings\":{\"MaxBitrate\":1000,\"RateControlMode\":\"QVBR\",\"SceneChangeDetect\":\"TRANSITION_DETECTION\"}}},\"AudioDescriptions\":[{\"CodecSettings\":{\"Codec\":\"AAC\",\"AacSettings\":{\"Bitrate\":96000,\"CodingMode\":\"CODING_MODE_2_0\",\"SampleRate\":48000}}}]}],\"OutputGroupSettings\":{\"Type\":\"FILE_GROUP_SETTINGS\",\"FileGroupSettings\":{\"Destination\":\"s3://EXAMPLE-DESTINATION-BUCKET/\"}}}],\"Inputs\":[{\"AudioSelectors\":{\"Audio Selector 1\":{\"DefaultSelection\":\"DEFAULT\"}},\"FileInput\":\"s3://EXAMPLE-SOURCE-BUCKET/EXAMPLE-SOURCE_FILE\"}]}}}}}"
63+
]
64+
]
65+
},
66+
"RoleArn": {
67+
"Fn::GetAtt": [
68+
"StateMachineRoleB840431D",
69+
"Arn"
70+
]
71+
}
72+
},
73+
"DependsOn": [
74+
"StateMachineRoleDefaultPolicyDF1E6607",
75+
"StateMachineRoleB840431D"
76+
],
77+
"UpdateReplacePolicy": "Delete",
78+
"DeletionPolicy": "Delete"
79+
}
80+
},
81+
"Parameters": {
82+
"BootstrapVersion": {
83+
"Type": "AWS::SSM::Parameter::Value<String>",
84+
"Default": "/cdk-bootstrap/hnb659fds/version",
85+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
86+
}
87+
},
88+
"Rules": {
89+
"CheckBootstrapVersion": {
90+
"Assertions": [
91+
{
92+
"Assert": {
93+
"Fn::Not": [
94+
{
95+
"Fn::Contains": [
96+
[
97+
"1",
98+
"2",
99+
"3",
100+
"4",
101+
"5"
102+
],
103+
{
104+
"Ref": "BootstrapVersion"
105+
}
106+
]
107+
}
108+
]
109+
},
110+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
111+
}
112+
]
113+
}
114+
}
115+
}

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/mediaconvert/test/integ.create-job.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
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/mediaconvert/test/integ.create-job.js.snapshot/integ.json

Lines changed: 12 additions & 0 deletions
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/mediaconvert/test/integ.create-job.js.snapshot/manifest.json

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)