linux_wiki:terraform

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
linux_wiki:terraform [2018/06/14 22:42]
billdozor [Terraform]
linux_wiki:terraform [2018/06/19 22:37]
billdozor [File Contents: Root Files]
Line 5: Line 5:
 "Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned." "Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned."
  
-Site+Sites
   * Official Site: https://www.terraform.io/   * Official Site: https://www.terraform.io/
   * Downloads: https://www.terraform.io/downloads.html   * Downloads: https://www.terraform.io/downloads.html
Line 11: Line 11:
   * AWS Provider Reference Doc: https://www.terraform.io/docs/providers/aws/index.html   * AWS Provider Reference Doc: https://www.terraform.io/docs/providers/aws/index.html
  
 +\\
 **Checklist** **Checklist**
   * AWS Account   * AWS Account
Line 175: Line 176:
 }</code> }</code>
  
-<code bash outputs.tf>Title: outputs.tf+<code bash outputs.tf> Title: outputs.tf
 # Description: Outputs from resources saved as variables # Description: Outputs from resources saved as variables
 +#              If terraform apply is run within this directory, these variables
 +#              are displayed at the end of the run.
  
 # Pull the VPC ID from the site module # Pull the VPC ID from the site module
Line 509: Line 512:
 <code bash outputs.tf># Title: outputs.tf <code bash outputs.tf># Title: outputs.tf
 # Description: Outputs from resources saved as variables # Description: Outputs from resources saved as variables
 +#              Accessible via "${module.site.variable_name}"
  
-# Store the VPC ID - pulled from here in main's output.tf+# Set output variable from resource format                                                                            
 +# output "variable_name"
 +#   value = "${aws_resource.name.attribute}" 
 +# } 
 + 
 +# Store the VPC ID
 output "vpc_id" { output "vpc_id" {
   value = "${aws_vpc.myvpc.id}"   value = "${aws_vpc.myvpc.id}"
 +}
 +
 +# Store the Public Subnet ID
 +output "subnet01_public_id" {
 +  value = "${aws_subnet.subnet01-public.id}"
 +}
 +
 +# Store the Public Security Group ID
 +output "sg_public_default_id" {
 +  value = "${aws_security_group.sg_public_default.id}"
 }</code> }</code>
  
 ---- ----
  
  • linux_wiki/terraform.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)