Skip to content

Commit cef8935

Browse files
[PRMP-579] refactor policies
1 parent 169ceb9 commit cef8935

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

infrastructure/modules/cloudfront/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ module "cloudfront" {
4949

5050
| Name | Description | Type | Default | Required |
5151
|------|-------------|------|---------|:--------:|
52-
| <a name="input_access_log_bucket"></a> [access\_log\_bucket](#input\_access\_log\_bucket) | Bucket to store access logs | `string` | n/a | yes |
5352
| <a name="input_bucket_domain_name"></a> [bucket\_domain\_name](#input\_bucket\_domain\_name) | Domain name to assign CloudFront distribution to. | `string` | n/a | yes |
5453
| <a name="input_bucket_id"></a> [bucket\_id](#input\_bucket\_id) | Bucket ID to assign CloudFront distribution to. | `string` | n/a | yes |
5554
| <a name="input_has_secondary_bucket"></a> [has\_secondary\_bucket](#input\_has\_secondary\_bucket) | Whether distribution is associated with a secondary buckets | `bool` | n/a | yes |
56-
| <a name="input_log_prefix"></a> [log\_prefix](#input\_log\_prefix) | Prefix to store access logs under | `string` | n/a | yes |
5755
| <a name="input_qualifed_arn"></a> [qualifed\_arn](#input\_qualifed\_arn) | Lambda@Edge function association. | `string` | n/a | yes |
5856
| <a name="input_secondary_bucket_domain_name"></a> [secondary\_bucket\_domain\_name](#input\_secondary\_bucket\_domain\_name) | Secondary bucket domain names | `string` | n/a | yes |
5957
| <a name="input_secondary_bucket_id"></a> [secondary\_bucket\_id](#input\_secondary\_bucket\_id) | Secondary bucket IDs | `string` | n/a | yes |

infrastructure/modules/lambda_edge/main.tf

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ resource "aws_iam_role_policy" "lambda_exec_policy" {
7575
}
7676

7777

78-
resource "aws_iam_role" "lambda_execution_role" {
79-
name = "${terraform.workspace}_lambda_execution_role_${var.name}"
80-
assume_role_policy = data.aws_iam_policy_document.assume_role.json
81-
}
82-
8378
data "aws_iam_policy_document" "merged_policy" {
8479
source_policy_documents = concat(var.iam_role_policy_documents)
8580
}
@@ -91,11 +86,11 @@ resource "aws_iam_policy" "combined_policies" {
9186

9287
resource "aws_iam_role_policy_attachment" "default_policies" {
9388
for_each = toset(var.default_policies)
94-
role = aws_iam_role.lambda_execution_role.name
89+
role = aws_iam_role.lambda_exec_role.name
9590
policy_arn = each.value
9691
}
9792

9893
resource "aws_iam_role_policy_attachment" "lambda_execution_policy" {
99-
role = aws_iam_role.lambda_execution_role.name
94+
role = aws_iam_role.lambda_exec_role.name
10095
policy_arn = aws_iam_policy.combined_policies.arn
10196
}

0 commit comments

Comments
 (0)