terraform:如何使用查找bitnami kafka ami id

2g32fytz  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(531)

我想知道如何列出所有尺寸的比特纳米Kafkaami id?

1rhkuytd

1rhkuytd1#

你可以试试这个 aws_ami_ids 数据源https://www.terraform.io/docs/providers/aws/d/ami_ids.html:

provider "aws" {
  region = "us-east-1"
}

data "aws_ami_ids" "bitnami_kafka" {
  owners = ["979382823631"] # bitnami

  filter {
    name   = "name"
    values = ["bitnami-kafka-*"]
  }
}

output "bitnami_kafka_ids" {
  value = "${data.aws_ami_ids.bitnami_kafka.ids}"
}

这与执行以下操作大致相同: aws ec2 describe-images --owners 979382823631 --filters "Name=name,Values=bitnami-kafka-*" ,但对于terraform,它只返回ami id。

相关问题