Exporting all Attributes
Learn to output an entire resource or data block using the Terraform output resource.
We'll cover the following
As of Terraform version 1.0.0
(which this course is based on), Terraform allows you to output an entire resource or data block. To do this, we’ll take the example that we just had in the last lesson and added the output "all"
block:
After running the project, you will notice an output called all
that
has all of the attributes exported by the aws_s3_bucket
resource. Sometimes, it can be handy
to output the whole resource to the console. Normally, when you are debugging something though, you want to see the value of one of the properties.
Running the project#
Clicking the terminal will run terraform init
and then terraform apply
. When prompted, enter yes to run the project.
📝Note: Kindly do change the
bucket
name before running the project.
/
- main.tf
📝Note: Once you are done with the project, do not forget to run
terraform destroy
and then confirm with yes to delete all of the resources in this project.