Skip to content

Commit

Permalink
attached policy attachment resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Cullan Carey authored and Cullan Carey committed May 8, 2022
1 parent 18b34bf commit 49ba7ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lambda_rotate_header.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ resource "aws_iam_policy" "custom_header_lambda_iam_policy" {
POLICY
}

resource "aws_iam_role_policy_attachment" "lambda_attach" {
role = aws_iam_role.iam_for_custom_header_lambda.name
policy_arn = aws_iam_policy.custom_header_lambda_iam_policy.arn
}

resource "aws_cloudwatch_event_rule" "rotate_custom_headers" {
name = "rotate_custom_header-s3-static-website"
schedule_expression = "${var.cron_schedule}"
Expand Down
7 changes: 6 additions & 1 deletion s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,9 @@ resource "aws_iam_policy" "s3_replication_exec_policy" {
}
POLICY
}
}

resource "aws_iam_role_policy_attachment" "s3_attach" {
role = aws_iam_role.replication.name
policy_arn = aws_iam_policy.s3_replication_exec_policy.arn
}

0 comments on commit 49ba7ae

Please sign in to comment.