Skip to content

How can I attach an EIP to an ECS using the terraform provider? #2442

Closed Answered by artem-lifshits
TobiWo asked this question in Q&A
Discussion options

You must be logged in to vote

Here's example config:

resource "opentelekomcloud_networking_floatingip_v2" "this" {
  pool = "admin_external_net"
}

resource "opentelekomcloud_ecs_instance_v1" "instance_1" {
  name     = "server_1"
  image_id = var.image_id
  flavor   = "s2.medium.1"
  vpc_id   = var.vpc_id

  nics {
    network_id = var.network_id
  }

  data_disks {
    size = 10
    type = "SSD"
  }

  password                    = "Password@123"
  security_groups             = [var.security_group_id]
  availability_zone           = "eu-de-01"
  auto_recovery               = false
  delete_disks_on_termination = true
}

resource "opentelekomcloud_networking_floatingip_associate_v2" "this" {
  floating_ip = opentelek…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by anton-sidelnikov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants