O'Reilly logo

Mobile DevOps by Jhalak Modi, Rohin Tak

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

Modifying instances

  1. To modify the instances, you need to make changes in main.tf. For example, I'm updating the elastic IP of the instance. The aws_eip module is used for allocation of elastic IPs:
resource "aws_eip" "ip" {  instance = "${aws_instance.testapp.id}"}
  1. Save the file and run the following commands again to make the changes in the instance:
$ terraform apply+ aws_eip.ip    allocation_id: "<computed>"    association_id: "<computed>"    domain: "<computed>"    instance: "${aws_instance.example.id}"    network_interface: "<computed>"    private_ip: "<computed>"    public_ip: "<computed>"

Type yes to accept the changes and see the changes using the AWS console, or run the terraform show command.

  1. Get the output by creating another output.tf file in ...

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