Skip to content

Instantly share code, notes, and snippets.

@mf-contino
Created February 15, 2021 09:40
Show Gist options
  • Save mf-contino/ac999057024242e2574dd7acad497efa to your computer and use it in GitHub Desktop.
Save mf-contino/ac999057024242e2574dd7acad497efa to your computer and use it in GitHub Desktop.
cf-dynamo-db-scan-policy
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An IAM Policy that only allows scan access to a specified DynamoDB table",
"Parameters": {
"TableArn": {
"Description": "ARN of the DynamoDB table to allow access to",
"Type": "String"
},
"NamePrefix": {
"Description": "Prefix to attach to the policy name",
"Type": "String"
}
},
"Resources": {
"IAMPolicy": {
"Type": "AWS::IAM::ManagedPolicy",
"Properties": {
"ManagedPolicyName": {
"Fn::Sub" : [ "${Prefix}-DynamoDBScannerPolicy", { "Prefix": {"Ref": "NamePrefix"}}]
},
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:Scan"
],
"Resource": {
"Ref": "TableArn"
}
}
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment