diff options
| author | Alex Schofield <git@ajschof.me> | 2024-08-14 23:05:26 +0100 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2024-08-14 23:05:26 +0100 |
| commit | c5f840e96b8c1696a6ed506e9260c4f1c26db10d (patch) | |
| tree | 6d4dc32bf8725200af6ef5882f8ff36a87c819f4 /terraform | |
| parent | 8ce75bcc1a89000fc0a9fea9b78ad31cd316ca06 (diff) | |
| download | de-project-bentley-c5f840e96b8c1696a6ed506e9260c4f1c26db10d.tar.gz de-project-bentley-c5f840e96b8c1696a6ed506e9260c4f1c26db10d.zip | |
feat(tf): add cloudwatch events iam policies
Diffstat (limited to 'terraform')
| -rw-r--r-- | terraform/iam.tf | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/terraform/iam.tf b/terraform/iam.tf index acb98f4..0e5fa6d 100644 --- a/terraform/iam.tf +++ b/terraform/iam.tf @@ -129,3 +129,30 @@ resource "aws_iam_role_policy_attachment" "cw_attachment" { policy_arn = aws_iam_policy.cw_policy.arn } +################### +# EVENTS POLICIES # +################### + +data "aws_iam_policy_document" "cloudwatch_events_policy" { + statement { + actions = [ + "events:PutRule", + "events:PutTargets", + "events:RemoveTargets", + "events:DeleteRule", + "events:PutEvents" + ] + resources = ["*"] + effect = "Allow" + } +} + +resource "aws_iam_policy" "cloudwatch_events_policy" { + name = "cloudwatch_events_policy" + policy = data.aws_iam_policy_document.cloudwatch_events_policy.json +} + +resource "aws_iam_role_policy_attachment" "cloudwatch_events_attachment" { + role = aws_iam_role.multi_service_role.name + policy_arn = aws_iam_policy.cloudwatch_events_policy.arn +} |
