Skip to content

Instantly share code, notes, and snippets.

@bahrmichael
Created July 7, 2021 18:19
Show Gist options
  • Save bahrmichael/213f16d179ea6cdcc000eb0bf6761405 to your computer and use it in GitHub Desktop.
Save bahrmichael/213f16d179ea6cdcc000eb0bf6761405 to your computer and use it in GitHub Desktop.
An IAM statement which allows the Query operation on a "EventsTable" and a GSI called "eventIdIndex"
{
Effect: 'Allow',
Action: ['dynamodb:Query'],
Resource: [
// assuming a table "EventsTable" with a GSI called "eventIdIndex"
{'Fn::GetAtt': ['EventsTable', 'Arn']},
{'Fn::Join': [ '/', [{ 'Fn::GetAtt': ['EventsTable', 'Arn' ] }, 'index', 'eventIdIndex' ]]}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment