Skip to content

Update defaults for variables of type list#176

Closed
evansmurithi wants to merge 1 commit intoAzure:masterfrom
evansmurithi:list-defaults
Closed

Update defaults for variables of type list#176
evansmurithi wants to merge 1 commit intoAzure:masterfrom
evansmurithi:list-defaults

Conversation

@evansmurithi
Copy link
Copy Markdown

@evansmurithi evansmurithi commented Jun 14, 2022

Terraform converts the given default value to the specified type. Set an
empty list [] default for variables of type list list()

Signed-off-by: Evans Murithi murithievans80@gmail.com

Terraform converts the given default value to the specified type. Set an
empty list `[]` default for variables of type list `list()`

Signed-off-by: Evans Murithi <murithievans80@gmail.com>
@davidkarlsen
Copy link
Copy Markdown
Contributor

Terraform converts the given default value to the specified type. Set an empty list [] default for variables of type list list()

Signed-off-by: Evans Murithi murithievans80@gmail.com

Or maybe even use set(string) if they are used for loops, to avoid larger diffs when changing a value.

@lonegunmanb
Copy link
Copy Markdown
Member

lonegunmanb commented Jun 30, 2022

Terraform converts the given default value to the specified type. Set an empty list [] default for variables of type list list()
Signed-off-by: Evans Murithi murithievans80@gmail.com

Or maybe even use set(string) if they are used for loops, to avoid larger diffs when changing a value.

Great idea! But this time I think the list is ok since we didn't use it for loop, but yes this is a very important principal.

@lonegunmanb
Copy link
Copy Markdown
Member

Terraform converts the given default value to the specified type. Set an empty list [] default for variables of type list list()

Signed-off-by: Evans Murithi murithievans80@gmail.com

Thanks @evansmurithi for opening this pr, would you please give me a hint about what we could gain from this change?

@evansmurithi
Copy link
Copy Markdown
Author

@lonegunmanb prior to the change, I was getting an error Error: expected "....admin_group_object_ids.0" to be a valid UUID. The default value for admin_group_object_ids was null. Not sure how internally terraform parses null values, but changing the default from null to [] fixed my issue.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #241, THIS PR WILL BE UPDATED.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR WILL BE UPDATED.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR WILL BE UPDATED.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants