Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lorenzoaiello/bcb5e57d3f1da2bdc43c2c808565f6e9 to your computer and use it in GitHub Desktop.
Save lorenzoaiello/bcb5e57d3f1da2bdc43c2c808565f6e9 to your computer and use it in GitHub Desktop.
dc34vo-01
$ cat provider.tf
provider "aws" {
region = "us-west-2"
}
$ cat dns.tf
resource "aws_route53_zone" "main" {
name = "dc34vo.com"
tags = {
Environment = "PROD"
Name = "dc34vo.com Production Zone"
}
}
$ docker run -it -v $(pwd):/workspace -v $HOME/.aws:/home/.aws -e "HOME=/home" -w /workspace hashicorp/terraform:light version
Terraform v0.12.9
+ provider.aws v2.30.0
$ docker run -it -v $(pwd):/workspace -v $HOME/.aws:/home/.aws -e "HOME=/home" -w /workspace hashicorp/terraform:light init
Initializing the backend...
Initializing provider plugins...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.
* provider.aws: version = "~> 2.30"
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ docker run -it -v $(pwd):/workspace -v $HOME/.aws:/home/.aws -e "HOME=/home" -w /workspace hashicorp/terraform:light plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_route53_zone.main will be created
+ resource "aws_route53_zone" "main" {
+ comment = "Managed by Terraform"
+ force_destroy = false
+ id = (known after apply)
+ name = "dc34vo.com"
+ name_servers = (known after apply)
+ tags = {
+ "Environment" = "PROD"
+ "Name" = "dc34vo.com Production Zone"
}
+ vpc_id = (known after apply)
+ vpc_region = (known after apply)
+ zone_id = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
------------------------------------------------------------------------
Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
$ docker run -it -v $(pwd):/workspace -v $HOME/.aws:/home/.aws -e "HOME=/home" -w /workspace hashicorp/terraform:light import aws_route53_zone.main Z1...WV
aws_route53_zone.main: Importing from ID "Z1XB1I9YEXBEWV"...
aws_route53_zone.main: Import prepared!
Prepared aws_route53_zone for import
aws_route53_zone.main: Refreshing state... [id=Z1XB1I9YEXBEWV]
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
$ docker run -it -v $(pwd):/workspace -v $HOME/.aws:/home/.aws -e "HOME=/home" -w /workspace hashicorp/terraform:light plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
aws_route53_zone.main: Refreshing state... [id=Z1XB1I9YEXBEWV]
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_route53_zone.main will be updated in-place
~ resource "aws_route53_zone" "main" {
+ comment = "Managed by Terraform"
+ force_destroy = false
id = "Z1XB1I9YEXBEWV"
name = "dc34vo.com."
name_servers = [
"ns-1187.awsdns-20.org",
"ns-1839.awsdns-37.co.uk",
"ns-23.awsdns-02.com",
"ns-674.awsdns-20.net",
]
~ tags = {
+ "Environment" = "PROD"
+ "Name" = "dc34vo.com Production Zone"
}
zone_id = "Z1XB1I9YEXBEWV"
}
Plan: 0 to add, 1 to change, 0 to destroy.
------------------------------------------------------------------------
Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment