Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new SESBulkTemplatedCrudPolicy_v2 policy #2929

Merged
merged 7 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions samtranslator/policy_templates_data/policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,54 @@
}
}
},
"SESBulkTemplatedCrudPolicy_v2": {
aaythapa marked this conversation as resolved.
Show resolved Hide resolved
"Definition": {
"Statement": [
{
"Action": [
"ses:GetIdentityVerificationAttributes",
"ses:SendEmail",
"ses:SendRawEmail",
"ses:SendTemplatedEmail",
"ses:SendBulkTemplatedEmail",
"ses:VerifyEmailIdentity"
],
"Effect": "Allow",
"Resource": [
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${identityName}",
aaythapa marked this conversation as resolved.
Show resolved Hide resolved
{
"identityName": {
"Ref": "IdentityName"
}
}
]
},
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:template/${templateName}",
{
"templateName": {
"Ref": "TemplateName"
}
}
]
}
]
}
]
},
"Description": "Gives permission to send email, templated email, templated bulk emails and verify identity",
"Parameters": {
"IdentityName": {
"Description": "Identity to give permissions to"
},
"TemplateName": {
"Description": "Name of the email template"
}
}
},
"SESCrudPolicy": {
"Definition": {
"Statement": [
Expand Down
2 changes: 1 addition & 1 deletion samtranslator/policy_templates_data/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"Templates": {
"additionalProperties": false,
"patternProperties": {
"^[a-zA-Z0-9]+Policy$": {
"^[a-zA-Z0-9]+Policy(_v[0-9])?$": {
"$ref": "#/definitions/template"
}
},
Expand Down
4 changes: 4 additions & 0 deletions tests/translator/input/all_policy_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,7 @@ Resources:

- SSMParameterWithSlashPrefixReadPolicy:
ParameterName: /name

- SESBulkTemplatedCrudPolicy_v2:
IdentityName: name
TemplateName: template_name
36 changes: 36 additions & 0 deletions tests/translator/output/all_policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,42 @@
]
},
"PolicyName": "KitchenSinkFunctionRolePolicy60"
},
{
"PolicyDocument": {
"Statement": [
{
"Action": [
"ses:GetIdentityVerificationAttributes",
"ses:SendEmail",
"ses:SendRawEmail",
"ses:SendTemplatedEmail",
"ses:SendBulkTemplatedEmail",
"ses:VerifyEmailIdentity"
],
"Effect": "Allow",
"Resource": [
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${identityName}",
{
"identityName": "name"
}
]
},
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:template/${templateName}",
{
"templateName": "template_name"
}
]
}
]
}
]
},
"PolicyName": "KitchenSinkFunctionRolePolicy61"
}
],
"Tags": [
Expand Down
36 changes: 36 additions & 0 deletions tests/translator/output/aws-cn/all_policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,42 @@
]
},
"PolicyName": "KitchenSinkFunctionRolePolicy60"
},
{
"PolicyDocument": {
"Statement": [
{
"Action": [
"ses:GetIdentityVerificationAttributes",
"ses:SendEmail",
"ses:SendRawEmail",
"ses:SendTemplatedEmail",
"ses:SendBulkTemplatedEmail",
"ses:VerifyEmailIdentity"
],
"Effect": "Allow",
"Resource": [
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${identityName}",
{
"identityName": "name"
}
]
},
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:template/${templateName}",
{
"templateName": "template_name"
}
]
}
]
}
]
},
"PolicyName": "KitchenSinkFunctionRolePolicy61"
}
],
"Tags": [
Expand Down
36 changes: 36 additions & 0 deletions tests/translator/output/aws-us-gov/all_policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,42 @@
]
},
"PolicyName": "KitchenSinkFunctionRolePolicy60"
},
{
"PolicyDocument": {
"Statement": [
{
"Action": [
"ses:GetIdentityVerificationAttributes",
"ses:SendEmail",
"ses:SendRawEmail",
"ses:SendTemplatedEmail",
"ses:SendBulkTemplatedEmail",
"ses:VerifyEmailIdentity"
],
"Effect": "Allow",
"Resource": [
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:identity/${identityName}",
{
"identityName": "name"
}
]
},
{
"Fn::Sub": [
"arn:${AWS::Partition}:ses:${AWS::Region}:${AWS::AccountId}:template/${templateName}",
{
"templateName": "template_name"
}
]
}
]
}
]
},
"PolicyName": "KitchenSinkFunctionRolePolicy61"
}
],
"Tags": [
Expand Down