Skip to content

Commit 0976434

Browse files
53ningenShreya
authored andcommitted
fix(policy-templates): update arn format of DynamoDBStreamReadPolicy (#1222)
1 parent 79dc6b8 commit 0976434

File tree

4 files changed

+66
-12
lines changed

4 files changed

+66
-12
lines changed

samtranslator/policy_templates_data/policy_templates.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,11 @@
609609
"Action": [
610610
"dynamodb:DescribeStream",
611611
"dynamodb:GetRecords",
612-
"dynamodb:GetShardIterator",
613-
"dynamodb:ListStreams"
612+
"dynamodb:GetShardIterator"
614613
],
615614
"Resource": {
616615
"Fn::Sub": [
617-
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/${streamName}",
616+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/${streamName}",
618617
{
619618
"tableName": {
620619
"Ref": "TableName"
@@ -625,6 +624,22 @@
625624
}
626625
]
627626
}
627+
},
628+
{
629+
"Effect": "Allow",
630+
"Action": [
631+
"dynamodb:ListStreams"
632+
],
633+
"Resource": {
634+
"Fn::Sub": [
635+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/*",
636+
{
637+
"tableName": {
638+
"Ref": "TableName"
639+
}
640+
}
641+
]
642+
}
628643
}
629644
]
630645
}

tests/translator/output/all_policy_templates.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,19 +474,32 @@
474474
"Action": [
475475
"dynamodb:DescribeStream",
476476
"dynamodb:GetRecords",
477-
"dynamodb:GetShardIterator",
478-
"dynamodb:ListStreams"
477+
"dynamodb:GetShardIterator"
479478
],
480479
"Resource": {
481480
"Fn::Sub": [
482-
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/${streamName}",
481+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/${streamName}",
483482
{
484483
"streamName": "name",
485484
"tableName": "name"
486485
}
487486
]
488487
},
489488
"Effect": "Allow"
489+
},
490+
{
491+
"Action": [
492+
"dynamodb:ListStreams"
493+
],
494+
"Resource": {
495+
"Fn::Sub": [
496+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/*",
497+
{
498+
"tableName": "name"
499+
}
500+
]
501+
},
502+
"Effect": "Allow"
490503
}
491504
]
492505
}

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,32 @@
473473
"Action": [
474474
"dynamodb:DescribeStream",
475475
"dynamodb:GetRecords",
476-
"dynamodb:GetShardIterator",
477-
"dynamodb:ListStreams"
476+
"dynamodb:GetShardIterator"
478477
],
479478
"Resource": {
480479
"Fn::Sub": [
481-
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/${streamName}",
480+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/${streamName}",
482481
{
483482
"streamName": "name",
484483
"tableName": "name"
485484
}
486485
]
487486
},
488487
"Effect": "Allow"
488+
},
489+
{
490+
"Action": [
491+
"dynamodb:ListStreams"
492+
],
493+
"Resource": {
494+
"Fn::Sub": [
495+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/*",
496+
{
497+
"tableName": "name"
498+
}
499+
]
500+
},
501+
"Effect": "Allow"
489502
}
490503
]
491504
}

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,32 @@
473473
"Action": [
474474
"dynamodb:DescribeStream",
475475
"dynamodb:GetRecords",
476-
"dynamodb:GetShardIterator",
477-
"dynamodb:ListStreams"
476+
"dynamodb:GetShardIterator"
478477
],
479478
"Resource": {
480479
"Fn::Sub": [
481-
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/${streamName}",
480+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/${streamName}",
482481
{
483482
"streamName": "name",
484483
"tableName": "name"
485484
}
486485
]
487486
},
488487
"Effect": "Allow"
488+
},
489+
{
490+
"Action": [
491+
"dynamodb:ListStreams"
492+
],
493+
"Resource": {
494+
"Fn::Sub": [
495+
"arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tableName}/stream/*",
496+
{
497+
"tableName": "name"
498+
}
499+
]
500+
},
501+
"Effect": "Allow"
489502
}
490503
]
491504
}

0 commit comments

Comments
 (0)