Skip to content

Terraform-Tutorials/terraform-local-exec-outputting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-local-exec-outputting

A easy way project about how you can provision an EC2 instance using local-exec command to get private IP with output on Terraform.

Content

Note

These examples deploy resources into your AWS account. Although all the resources should fall under the AWS Free Tier, it is not me responsibility if you are charged money for this.

Project structure

$ tree
.
├── README.md
├── backend.tf
├── instance.tf
├── output.tf
├── private_ips.txt
├── terraform.tfstate
├── terraform.tfstate.backup
├── variables.tf
└── versions.tf

0 directories, 9 files

Installation

To use Terraform you will need to install it. HashiCorp distributes Terraform as a binary package. You can also install Terraform using popular package managers.

  1. Install yum-config-manager to manage your repositories.
$ sudo yum install -y yum-utils
  1. Use yum-config-manager to add the official HashiCorp Linux repository.
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
  1. Install:
$ sudo yum -y install terraform

Usage

  1. Make sure you have visited the Terraform documentation before to start.
  2. Set your AWS credentials as the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  3. Go to your Terraform project folder.
  4. Run terraform init.
  5. Run terraform-plan.
  6. Run terraform-apply
  7. To clean up and delete all resources after you're done, run terraform destroy.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

A brief overview about how to usage the local-exec and output features with Terraform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages