如何使用Terraform自动缩放创建AWS A记录

时间:2018-12-17 19:26:14

标签: amazon-ec2 terraform amazon-route53 autoscaling

如果您具有以下启动配置

resource "aws_launch_configuration" "provisioning" {
    name                 = "app_balancer"
    image_id             = "${var.ami_id}"
    instance_type        = "${var.instance_type}"
    security_groups      = ["${aws_security_group.def.id}"]
    user_data            = "${file("${var.bootstrap_path}")}"
    associate_public_ip_address = true
    iam_instance_profile        = "${var.iam_instance_profile_id}"
    key_name             = "my_key"

    lifecycle {
      create_before_destroy = true
    }

    provisioner "local-exec" {
      command = "sleep 15"
    }
  }

这有效并根据aws_autoscaling_group和aws_autoscaling_policy启动实例。但是我无法找到一种方法来获取新生成的IP并将此信息添加到route53。

0 个答案:

没有答案