terraform/internal/configs/testdata/valid-files/actions.tf
Kristin Laemmert 5adceda98f
feat: update Actions parsing with current syntax (#37313)
* feat: update Actions parsing with current syntax

Updating actions to match the current RFC:
- config is in a block
- linked_resource(s) exist and need parsing

I added a very basic test for the decoding, and updated existing tests with the correct syntax.

* very important copyrighted test file
2025-07-10 10:03:49 -04:00

35 lines
635 B
HCL

action "provider_reboot" "powercycle" {
config {
method = "biggest_hammer" // drop it in the ocean, i presume
}
}
resource "aws_security_group" "firewall" {
lifecycle {
create_before_destroy = true
prevent_destroy = true
ignore_changes = [
description,
]
action_trigger {
events = [after_create, after_update]
actions = [action.provider_reboot.powercycle]
}
}
connection {
host = "127.0.0.1"
}
provisioner "local-exec" {
command = "echo hello"
connection {
host = "10.1.2.1"
}
}
provisioner "local-exec" {
command = "echo hello"
}
}