File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ data "aws_iam_policy_document" "example" {
31
31
statement {
32
32
actions = [" s3:GetObject" ]
33
33
effect = " Allow"
34
- resources = [" dynamodb:CreateTable " ]
34
+ resources = [" arn:aws:s3:::amzn-s3-demo-bucket/* " ]
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ variable "enabled" {
40
40
}
41
41
42
42
variable "enterprise_slug" {
43
- default = false
43
+ default = " "
44
44
description = " Enterprise slug for GitHub Enterprise Cloud customers."
45
- type = bool
45
+ type = string
46
46
}
47
47
48
48
variable "force_detach_policies" {
Original file line number Diff line number Diff line change @@ -32,14 +32,13 @@ resource "aws_iam_role" "github" {
32
32
permissions_boundary = var. iam_role_permissions_boundary
33
33
tags = var. tags
34
34
35
- dynamic "inline_policy" {
36
- for_each = var. iam_role_inline_policies
35
+ }
37
36
38
- content {
39
- name = inline_policy . key
40
- policy = inline_policy . value
41
- }
42
- }
37
+ resource "aws_iam_role_policy" "inline_policies" {
38
+ for_each = { for k , v in var . iam_role_inline_policies : k => v if var . enabled }
39
+ name = each . key
40
+ policy = each . value
41
+ role = aws_iam_role . github [ 0 ] . id
43
42
}
44
43
45
44
resource "aws_iam_role_policy_attachment" "admin" {
You can’t perform that action at this time.
0 commit comments