CMDB-Server/gitea/demo/demo1/main.tf

23 lines
912 B
HCL

## プロバイダの指定
provider "aws" {
region = "ap-northeast-1" # 東京リージョン
}
# EC2インスタンスの作成(Web1)
resource "aws_instance" "iac_web1" {
ami = "ami-0f75d1a8c9141bd00" # AMIの指定 (AmazonLinux2023)
instance_type = "t3.micro" # インスタンスタイプの指定
availability_zone = "ap-northeast-1a" # アベイラビリティーゾーンの指定
tags = {
Name = "iac_web1" # タグ名の指定
}
}
# EC2インスタンスの作成(Web2)
resource "aws_instance" "iac_web2" {
ami = "ami-0f75d1a8c9141bd00" # AMIの指定 (AmazonLinux2023)
instance_type = "t3.micro" # インスタンスタイプの指定
availability_zone = "ap-northeast-1a" # アベイラビリティーゾーンの指定
tags = {
Name = "iac_web2" # タグ名の指定
}
}