Skip to content

Commit bbe98a5

Browse files
jdg2896moelasmar
andauthored
feat: add StepFunctionsCallbackPolicy policy template (#3545)
Co-authored-by: Mohamed Elasmar <[email protected]>
1 parent c4f3746 commit bbe98a5

File tree

5 files changed

+102
-0
lines changed

5 files changed

+102
-0
lines changed

samtranslator/policy_templates_data/policy_templates.json

+30
Original file line numberDiff line numberDiff line change
@@ -2329,6 +2329,36 @@
23292329
"Description": "Gives access permissions to create and list applications in the AWS Serverless Application Repository service",
23302330
"Parameters": {}
23312331
},
2332+
"StepFunctionsCallbackPolicy": {
2333+
"Definition": {
2334+
"Statement": [
2335+
{
2336+
"Action": [
2337+
"states:SendTaskFailure",
2338+
"states:SendTaskHeartbeat",
2339+
"states:SendTaskSuccess"
2340+
],
2341+
"Effect": "Allow",
2342+
"Resource": {
2343+
"Fn::Sub": [
2344+
"arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${stateMachineName}",
2345+
{
2346+
"stateMachineName": {
2347+
"Ref": "StateMachineName"
2348+
}
2349+
}
2350+
]
2351+
}
2352+
}
2353+
]
2354+
},
2355+
"Description": "Gives permission to implement callback tasks in Step Functions",
2356+
"Parameters": {
2357+
"StateMachineName": {
2358+
"Description": "The name of the state machine to execute."
2359+
}
2360+
}
2361+
},
23322362
"StepFunctionsExecutionPolicy": {
23332363
"Definition": {
23342364
"Statement": [

tests/translator/input/all_policy_templates.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,6 @@ Resources:
184184
- SESBulkTemplatedCrudPolicy_v2:
185185
IdentityName: name
186186
TemplateName: template_name
187+
188+
- StepFunctionsCallbackPolicy:
189+
StateMachineName: name

tests/translator/output/all_policy_templates.json

+23
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,29 @@
17031703
]
17041704
},
17051705
"PolicyName": "KitchenSinkFunctionRolePolicy62"
1706+
},
1707+
{
1708+
"PolicyDocument": {
1709+
"Statement": [
1710+
{
1711+
"Action": [
1712+
"states:SendTaskFailure",
1713+
"states:SendTaskHeartbeat",
1714+
"states:SendTaskSuccess"
1715+
],
1716+
"Effect": "Allow",
1717+
"Resource": {
1718+
"Fn::Sub": [
1719+
"arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${stateMachineName}",
1720+
{
1721+
"stateMachineName": "name"
1722+
}
1723+
]
1724+
}
1725+
}
1726+
]
1727+
},
1728+
"PolicyName": "KitchenSinkFunctionRolePolicy63"
17061729
}
17071730
],
17081731
"Tags": [

tests/translator/output/aws-cn/all_policy_templates.json

+23
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,29 @@
17031703
]
17041704
},
17051705
"PolicyName": "KitchenSinkFunctionRolePolicy62"
1706+
},
1707+
{
1708+
"PolicyDocument": {
1709+
"Statement": [
1710+
{
1711+
"Action": [
1712+
"states:SendTaskFailure",
1713+
"states:SendTaskHeartbeat",
1714+
"states:SendTaskSuccess"
1715+
],
1716+
"Effect": "Allow",
1717+
"Resource": {
1718+
"Fn::Sub": [
1719+
"arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${stateMachineName}",
1720+
{
1721+
"stateMachineName": "name"
1722+
}
1723+
]
1724+
}
1725+
}
1726+
]
1727+
},
1728+
"PolicyName": "KitchenSinkFunctionRolePolicy63"
17061729
}
17071730
],
17081731
"Tags": [

tests/translator/output/aws-us-gov/all_policy_templates.json

+23
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,29 @@
17031703
]
17041704
},
17051705
"PolicyName": "KitchenSinkFunctionRolePolicy62"
1706+
},
1707+
{
1708+
"PolicyDocument": {
1709+
"Statement": [
1710+
{
1711+
"Action": [
1712+
"states:SendTaskFailure",
1713+
"states:SendTaskHeartbeat",
1714+
"states:SendTaskSuccess"
1715+
],
1716+
"Effect": "Allow",
1717+
"Resource": {
1718+
"Fn::Sub": [
1719+
"arn:${AWS::Partition}:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${stateMachineName}",
1720+
{
1721+
"stateMachineName": "name"
1722+
}
1723+
]
1724+
}
1725+
}
1726+
]
1727+
},
1728+
"PolicyName": "KitchenSinkFunctionRolePolicy63"
17061729
}
17071730
],
17081731
"Tags": [

0 commit comments

Comments
 (0)