mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
change provisioner example in terraform_data
The existing example is already covered in the "Provisioners Without a Resource" section, so make this one slightly different by triggering a local-exec on multiple resources.
This commit is contained in:
parent
0a25e40aeb
commit
5adea6d58e
@ -46,19 +46,20 @@ resource "aws_instance" "web" {
|
||||
# ...
|
||||
}
|
||||
|
||||
resource "aws_instance" "database" {
|
||||
# ...
|
||||
}
|
||||
|
||||
# A use-case for terraform_data is as a do-nothing container
|
||||
# for arbitrary actions taken by a provisioner.
|
||||
resource "terraform_data" "bootstrap" {
|
||||
triggers_replace = aws_instance.web.id
|
||||
triggers_replace = [
|
||||
aws_instance.web.id,
|
||||
aws_instance.database.id
|
||||
]
|
||||
|
||||
connection {
|
||||
host = aws_instance.web.public_ip
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"bootstrap-host.sh,
|
||||
]
|
||||
provisioner "local-exec" {
|
||||
command = "bootstrap-hosts.sh"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user