Skip to content

Commit

Permalink
#7 add new resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanakaryo committed Jun 12, 2024
1 parent 2a80120 commit d4fb09a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "aws_network_interface" "foo" {
subnet_id = aws_subnet.example_subnet.id
private_ips = ["172.16.10.100"]

tags = {
Name = "primary_network_interface"
}
}

resource "aws_instance" "foo" {
ami = "ami-097df8c5fa681defb"
instance_type = "t2.micro"

network_interface {
network_interface_id = aws_network_interface.foo.id
device_index = 0
}

credit_specification {
cpu_credits = "unlimited"
}

tags = {
Name = "Main"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "aws_vpc" "example_vpc" {
cidr_block = "172.16.0.0/16"

tags = {
Name = "Main"
}
}

resource "aws_subnet" "example_subnet" {
vpc_id = aws_vpc.example_vpc.id
cidr_block = "172.16.10.0/24"
availability_zone = "ap-northeast-1a"

tags = {
Name = "Main"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.53.0"
}
}
}

provider "aws" {
region = "ap-northeast-1"
}

resource "aws_vpc" "examplevpc" {
cidr_block = "10.0.0.0/16"
}

0 comments on commit d4fb09a

Please sign in to comment.