O'Reilly logo

Getting Started with Terraform - Second Edition by Kirill Shirinkin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refreshing infrastructure

It could be that someone updated the resource managed by Terraform manually, via AWS API or the AWS Management Console. If the changed attribute is specified inside the template, then you can fix it by running the terraform apply command--given that Terraform templates are the source of truth when it comes to the state of the infrastructure. But if this attribute is not managed by a Terraform template, then you might still want it to be reflected in your state file. That's when the terraform refresh command comes to the rescue.

Apply the template and then go to the AWS Console. Open the VPC section and find the VPC Terraform created. Right-click on this VPC and choose Edit DNS Hostnames. Then, change DNS Hostnames ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required