我的s3资源在terraform中具有配置:
locals {
bucket_count = "${length(var.s3_config["bucket_names"])}"
}
resource "aws_s3_bucket" "s3_bucket" {
count = "${local.bucket_count}"
bucket = "${format("%s-%s", element(var.s3_config["bucket_names"], count.index), var.region)}"
acl = "private"
region = "${var.region}"
tags {
Name = "${format("%s-%s", element(var.s3_config["bucket_names"], count.index), var.region)}"
}
}
并且我想为所有创建的存储段设置输出变量,因此我创建了带有内容的文件名output.tf
output "buckets" {
value = "${aws_s3_bucket.s3_bucket.*.bucket}"
}
output "buckets_arns" {
value = "${aws_s3_bucket.s3_bucket.*.arn}"
}
当我应用配置时,可以,我在terraform.tfstate文件中看到输出,但是当我调用terraform输出时,我看到没有输出或输出为空的信息,我该怎么办?
答案 0 :(得分:2)
尝试一下:
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.fragment_menu_items, menu);
}