terraform - 使用 Terraform 创建 AWS-OPSWORK-STACK 时出错
问题描述
在使用 terraform 和以下代码创建堆栈时出现此错误
错误:加载 /root/terraform-stack-creation/main.tf 时出错:位置 2:10:资源必须紧跟两个字符串,一个类型和一个名称
resource "aws_opsworks_stack" "stack" {
name = "${var.name}"
region = "${var.region}"
service_role_arn = "${var.service_role_arn}"
default_instance_profile_arn = "${var.instance_profile_arn}"
default_os = "Amazon Linux 2018.03"
configuration_manager_version = "11.10"
manage_berkshelf = false
default_root_device_type = "ebs"
use_opsworks_security_groups = false
vpc_id = "vpc-******************"
default_subnet_id = "subnet-*****************"
custom_json = "{}"
}
variable "name" {
type = "string"
description = "Name (Your required stack name)"
}
variable "region" {
type = list(string)
default = ["us-west-1a"]
description = "us-east-1,ap-south-1,ap-southeast-2,eu-central-1 (Give your region)"
}
variable "service_role_arn" {
type = list(string)
default = ["*********************"]
description = "Default IAM role"
}
variable "default_instance_profile_arn"{
type = list(string)
default = ["*************************"]
description = "Default IAM instance profile"
}
variable "default_availability_zone" {
type = "string"
description = "Give your availabity zone"
}
解决方案
推荐阅读
- node.js - 为什么我得到 npm 错误 403
- sql-server - 可以创建表格但不显示在对象资源管理器中,无法选择或删除表格?
- vba - 是否可以使用 VBA 将别名分配给查询的字段以供以后在报表中使用?
- amazon-web-services - Amazon RDS Snapshot 系统是一样的自动备份吗?
- r - 使用 dplyr 在列内创建新组
- sql - 考虑到主列中具有相同值的不同列中的另一个值
- asp.net-core - IDPmetadata url 在 IIS 服务器上给出问题 - ITfoxtec - 没有这样的主机是已知的
- java - 无法从 actionlistener 内部增加变量
- laravel - 队列未在 DigitalOcean 工作人员(AppPlatform)上处理
- javascript - React JS - 无法在尚未安装的组件上调用 setState