Skip to content

Instantly share code, notes, and snippets.

@MattSurabian
Last active March 21, 2016 14:20
Show Gist options
  • Save MattSurabian/d1dde2c7950f3c3dc8e7 to your computer and use it in GitHub Desktop.
Save MattSurabian/d1dde2c7950f3c3dc8e7 to your computer and use it in GitHub Desktop.
Should live in ~/.aws/
[default]
aws_access_key_id = SOME_ACCESS_KEY_ID
aws_secret_access_key = SOME_SECRET_KEY_ID
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "vpc" {
cidr_block = "10.0.0.0/24"
}

terraform plan

terraform plan
Refreshing Terraform state prior to plan...

The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

+ aws_vpc.vpc
    cidr_block:                "" => "10.0.0.0/24"
    default_network_acl_id:    "" => "<computed>"
    default_security_group_id: "" => "<computed>"
    dhcp_options_id:           "" => "<computed>"
    enable_classiclink:        "" => "<computed>"
    enable_dns_hostnames:      "" => "<computed>"
    enable_dns_support:        "" => "<computed>"
    main_route_table_id:       "" => "<computed>"


Plan: 1 to add, 0 to change, 0 to destroy.

terraform apply

terraform apply
aws_vpc.vpc: Creating...
  cidr_block:                "" => "10.0.0.0/24"
  default_network_acl_id:    "" => "<computed>"
  default_security_group_id: "" => "<computed>"
  dhcp_options_id:           "" => "<computed>"
  enable_classiclink:        "" => "<computed>"
  enable_dns_hostnames:      "" => "<computed>"
  enable_dns_support:        "" => "<computed>"
  main_route_table_id:       "" => "<computed>"
aws_vpc.vpc: Creation complete

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.

State path: terraform.tfstate

terraform destroy

terraform destroy
Do you really want to destroy?
  Terraform will delete all your managed infrastructure.
  There is no undo. Only 'yes' will be accepted to confirm.

  Enter a value: yes

aws_vpc.vpc: Refreshing state... (ID: vpc-821e1ae6)
aws_vpc.vpc: Destroying...
aws_vpc.vpc: Destruction complete

Apply complete! Resources: 0 added, 0 changed, 1 destroyed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment