Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 997 Bytes

terraform_exercises_part2.md

File metadata and controls

49 lines (32 loc) · 997 Bytes

Exercises2:

Objective: Demonstrate the openstack resource creation(vm, floatingip, floating ip association) in terraform.

we covers resource, variable, output block of terraform configuration in this exercise.

Steps:

  1. In the Exercise1, Use variable block to declare the image, flavor, key, security group, network.
variable myimage {
  default = "dea87f06-9fdc-410c-974f-470b057cfa2b"
}
  1. Terraform plan and apply

  2. Add floating IP resource.

resource "openstack_networking_floatingip_v2" "fip_1" {
  pool = "public"
}
  1. Terraform Plan,apply and show

  2. Add floating IP association

resource "openstack_compute_floatingip_associate_v2" "fip_1" {
  floating_ip = "${openstack_networking_floatingip_v2.fip_1.address}"
  instance_id = "${openstack_compute_instance_v2.vm1.id}"
}

  1. Terraform plan , apply and show.

Referneces:

  1. https://www.terraform.io/docs/providers/openstack/index.html