terraform main.tf
file:main.tf
# Version of Terraform terraform { required_version = "= 0.12.20" } provider "aws" { version = "= 2.18.0" access_key = "*" secret_key = "*" region = "us-west-2" } data aws_ssm_parameter amzn2_ami { name = "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" } resource aws_instance demo1 { ami = data.aws_ssm_parameter.amzn2_ami.value instance_type = "t2.micro" key_name = "利用するキー名" tags = { Name = "testEC2I01" } vpc_security_group_ids = [ "sg-1234abcd", # default security group-id "sg-12345678abcdefghi" # custom security group-id ] }