Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Getting Started with Terraform

You're reading from   Getting Started with Terraform Manage production infrastructure as a code

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781788623537
Length 208 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Kirill Shirinkin Kirill Shirinkin
Author Profile Icon Kirill Shirinkin
Kirill Shirinkin
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Infrastructure Automation FREE CHAPTER 2. Deploying First Server 3. Resource Dependencies and Modules 4. Storing and Supplying Configuration 5. Connecting with Other Tools 6. Scaling and Updating Infrastructure 7. Collaborative Infrastructure 8. Future of Terraform

Handling resource updates


Let's change our instance's name to be hello-updated-instance:

resource "aws_instance" "hello-instance" {  ami = "ami-9bf712f4"  instance_type = "t2.micro"  subnet_id = "subnet-5f22f536"  tags {    Name = "hello-update-instance"  }}

Before we actually run the update, wouldn't it be useful to see what exactly Terraform do when we run the terraform apply command again? Luckily, there is the terraform plan command that does exactly the same, that is, it shows you what applying do by checking the template, state file, and actual state of the resource:

$> terraform planRefreshing Terraform state in-memory prior to plan...The refreshed state will be used to calculate this plan, butwill not be persisted to local or remote state storage.aws_instance.hello-instance: Refreshing state... (ID: i-119a10ac)The Terraform execution plan has been generated and is shown below.Resources are shown in alphabetical order for quick scanning. Green resourceswill be created (or destroyed...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime
Visually different images