Created
June 10, 2021 09:18
-
-
Save ferzerkerx/34927ec175fc4e25ed4e83ff02b7e855 to your computer and use it in GitHub Desktop.
dynamodb-access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DynamoDB | |
data "aws_iam_policy_document" "tables" { | |
statement { | |
actions = ["dynamodb:*"] | |
resources = ["${var.table_arns}"] | |
} | |
} | |
resource "aws_iam_policy" "tables_policy" { | |
name = "dynamodb-access-from-${var.app_name}" | |
path = "/" | |
policy = "${data.aws_iam_policy_document.tables.json}" | |
} | |
resource "aws_iam_policy_attachment" "tables_access" { | |
name = "dynamodb-access-from-${var.app_name}-attachment" | |
roles = ["${var.app_role_name}"] | |
policy_arn = "${aws_iam_policy.tables_policy.arn}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment