-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: define iam_policy_statements object syntax #26
Changes from 2 commits
f9191c9
419fb4b
43364f4
8f2f753
315c312
97ea586
6783c85
ba46cc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,27 @@ variable "iam_source_json_url" { | |
} | ||
|
||
variable "iam_policy_statements" { | ||
type = any | ||
type = object({ | ||
sid = optional(string, "") | ||
effect = optional(string, "") | ||
actions = optional(list(string), []) | ||
not_actions = optional(list(string), []) | ||
resources = optional(list(string), []) | ||
not_resources = optional(list(string), []) | ||
conditions = optional(list(object({ | ||
test = string | ||
variable = string | ||
values = list(string) | ||
})), []) | ||
principals = optional(list(object({ | ||
type = string | ||
identifiers = list(string) | ||
})), []) | ||
not_principals = optional(list(object({ | ||
type = string | ||
identifiers = list(string) | ||
})), []) | ||
}) | ||
description = "Map of IAM policy statements to use in the policy. This can be used with or instead of the `var.iam_source_json_url`." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change "Map of" to "Object describing" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@Nuru from what I can see - a map is expected here, so I fixed the variable definition. |
||
default = {} | ||
} | ||
|
@@ -38,4 +58,4 @@ variable "iam_override_policy_documents" { | |
type = list(string) | ||
description = "List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank sids will override statements with the same sid from earlier documents in the list. Statements with non-blank sids will also override statements with the same sid from documents provided in the `source_json` and `source_policy_documents` arguments. Non-overriding statements will be added to the exported document." | ||
default = null | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version
here and inmain.tf
.dynamic
should default tonull
.main.tf
, replace lookups likeWith direct references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nuru thanks a lot for your review!
aws_iam_policy_document
, so I added it as a separate variable.Please let me know your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gberenice I forgot we want this to be backward compatible and that means the input is a map. I will take it from here. Thank you very much for your contributions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nuru sounds good, thank you!