Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Terraform - AWS

Back


Terraform Registry


Demo: Spinning up an instance in AWS

aws configure
# AWS Access Key ID:
# AWS Secret Access Key:
# Default region name [us-east-1]: us-east-1
# Default output format [json]:
provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "example" {
  ami           = "ami-0ccb559bf2fde32a9"
  instance_type = "t2.micro"
    tags = {
    Name = "HelloWorld"
  }
}
# initializes a working directory containing Terraform configuration files.
terraform init
# command executes the actions proposed in a Terraform plan.
terraform apply
# destroy all remote objects managed by a particular Terraform configuration.
terraform destroy