Skip to content

Commit 4ab32ac

Browse files
forzagreenmgrandis
authored andcommitted
feat(policy-templates): add AcmGetCertificatePolicy (aws#1853)
* Policy templates: add AcmGetCertificatePolicy * Add unit tests
1 parent b8c678f commit 4ab32ac

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

samtranslator/policy_templates_data/policy_templates.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,34 @@
23062306
}
23072307
]
23082308
}
2309+
},
2310+
"AcmGetCertificatePolicy": {
2311+
"Description": "Gives permission to retrieve a certificate and its certificate chain from ACM",
2312+
"Parameters": {
2313+
"CertificateArn": {
2314+
"Description": "The ARN of the certificate to grant access to"
2315+
}
2316+
},
2317+
"Definition": {
2318+
"Statement": [
2319+
{
2320+
"Effect": "Allow",
2321+
"Action": [
2322+
"acm:GetCertificate"
2323+
],
2324+
"Resource": {
2325+
"Fn::Sub": [
2326+
"${certificateArn}",
2327+
{
2328+
"certificateArn": {
2329+
"Ref": "CertificateArn"
2330+
}
2331+
}
2332+
]
2333+
}
2334+
}
2335+
]
2336+
}
23092337
}
23102338
}
23112339
}

tests/translator/input/all_policy_templates.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,6 @@ Resources:
168168

169169
- EventBridgePutEventsPolicy:
170170
EventBusName: name
171+
172+
- AcmGetCertificatePolicy:
173+
CertificateArn: arn

tests/translator/output/all_policy_templates.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,27 @@
15701570
}
15711571
]
15721572
}
1573+
},
1574+
{
1575+
"PolicyName": "KitchenSinkFunctionRolePolicy58",
1576+
"PolicyDocument": {
1577+
"Statement": [
1578+
{
1579+
"Action": [
1580+
"acm:GetCertificate"
1581+
],
1582+
"Resource": {
1583+
"Fn::Sub": [
1584+
"${certificateArn}",
1585+
{
1586+
"certificateArn": "arn"
1587+
}
1588+
]
1589+
},
1590+
"Effect": "Allow"
1591+
}
1592+
]
1593+
}
15731594
}
15741595
],
15751596
"Tags": [

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,27 @@
15701570
}
15711571
]
15721572
}
1573+
},
1574+
{
1575+
"PolicyName": "KitchenSinkFunctionRolePolicy58",
1576+
"PolicyDocument": {
1577+
"Statement": [
1578+
{
1579+
"Action": [
1580+
"acm:GetCertificate"
1581+
],
1582+
"Resource": {
1583+
"Fn::Sub": [
1584+
"${certificateArn}",
1585+
{
1586+
"certificateArn": "arn"
1587+
}
1588+
]
1589+
},
1590+
"Effect": "Allow"
1591+
}
1592+
]
1593+
}
15731594
}
15741595
],
15751596
"Tags": [

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,27 @@
15701570
}
15711571
]
15721572
}
1573+
},
1574+
{
1575+
"PolicyName": "KitchenSinkFunctionRolePolicy58",
1576+
"PolicyDocument": {
1577+
"Statement": [
1578+
{
1579+
"Action": [
1580+
"acm:GetCertificate"
1581+
],
1582+
"Resource": {
1583+
"Fn::Sub": [
1584+
"${certificateArn}",
1585+
{
1586+
"certificateArn": "arn"
1587+
}
1588+
]
1589+
},
1590+
"Effect": "Allow"
1591+
}
1592+
]
1593+
}
15731594
}
15741595
],
15751596
"Tags": [

0 commit comments

Comments
 (0)