Skip to content
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

Backport of docs: update splat expressions in directives into v1.5 #33529

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #32074 to be assessed for backporting due to the inclusion of the label 1.5-backport.

The below text is copied from the body of the original PR.


Updates the Expressions > Strings and Templates docs to use the recommend splat expression syntax, with square brackets. While Terraform continues to support the .* syntax for resources with count, the docs describe them as "legacy 'attribute-only' splat expressions."

For good measure, I tested to confirm this works:

output "ips" {
  value = <<-EOF
    %{ for ip in aws_instance.example[*].private_ip }
    server ${ip}
    %{ endfor }
  EOF
}

resource "aws_instance" "example" {
  count = 2
  instance_type = "t3.nano"
  ami = "ami-0d593311db5abb72b"
}
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

ips = <<EOT

server 172.31.52.27

server 172.31.53.123


EOT

@teamterraform teamterraform force-pushed the backport/patch-1/seemingly-boss-hagfish branch 2 times, most recently from 9f94627 to 00ac0bb Compare July 14, 2023 17:24
@crw crw merged commit bca119c into v1.5 Jul 14, 2023
@crw crw deleted the backport/patch-1/seemingly-boss-hagfish branch July 14, 2023 17:34
@github-actions
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants