1
1
Fork 0
mirror of https://github.com/mcuadros/ascode synced 2024-05-09 00:56:14 +02:00
ascode/starlark/types/testdata/examples/attribute.star

14 lines
355 B
Plaintext

# When a Resource has an Attribute means that the value it's only available
# during the `apply` phase of Terraform. So in, AsCode an attribute behaves
# like a poor-man pointer.
aws = tf.provider("aws")
ami = aws.resource.ami("ubuntu")
instance = aws.resource.instance("foo")
instance.ami = ami.id
print(instance.ami)
# Output:
# ${aws_ami.ubuntu.id}