root_block_device
でエラーでたので、記録残しておく。
- v0.11で動いてたコード
resource "aws_instance" "sample" { ami = "ami-0c3fd0f5d33134a76" instance_type = "t3.micro" subnet_id = "subnet-xxxxxxx" root_block_device = { volume_type = "gp2" volume_size = 8 } }下記のエラーで
terraform plan
失敗するError: Unsupported argument on hoge.tf line 5, in resource "aws_instance" "sample": 5: root_block_device = { An argument named "root_block_device" is not expected here. Did you mean to define a block of type "root_block_device"?
- root_block_deviceの
=
をなくすとエラー出なくなった(v0.11でもplanのエラーはでない)
resource "aws_instance" "sample" { ami = "ami-0c3fd0f5d33134a76" instance_type = "t3.micro" subnet_id = "subnet-xxxxxxx" root_block_device { volume_type = "gp2" volume_size = 8 } }逆に
remote_state
は =
ないとエラーでる。謎??
data "terraform_remote_state" "vpc" { backend = "s3" config { bucket = "bucket-name" key = "hogehoge" region = "ap-northeast-1" } }