https://github.com/5a6io/OliveSafety
GitHub - 5a6io/OliveSafety: Cloud Wave 3๊ธฐ ํ๋ก์ ํธ olivesafety
Cloud Wave 3๊ธฐ ํ๋ก์ ํธ olivesafety. Contribute to 5a6io/OliveSafety development by creating an account on GitHub.
github.com
ํ๋ก์ ํธํ ๋ terraform ์ฝ๋๋ก ์ฒ์์ ์์ฑํ์ง ์์์ ๋๋ terraform ์ฝ๋๋ฅผ ๊ฐ๊ณ ์์ง ์๋ค.
๊ทธ๋์ ๋ด๊ฐ ๊ฐ์ธ์ ์ผ๋ก terraform ์ฝ๋๋ฅผ ์์ฑํด๋ณด๋ ค๊ณ ํ๋ค.
ํ๋ก์ ํธ ๋ณด๊ณ ์๊ฐ ์์ด์ ์ด๋ฅผ ๋ณด๊ณ ํ๋ ค๊ณ ํ๋ ๋ชจ๋ ์ ๋ณด๊ฐ ์๋ ๊ฒ์ ์๋๋ผ ํ๋ก์ ํธํ ๋ ์์ฑํ๋ ์ฝ๋์ ๊ฐ์์ง๋ ์ ์ ์๋ค...๊ทธ๋๋ ์ต๋ํ ์ํคํ
์ฒ์ ๋ฐ๋ผ ํ์ํ ๋ฆฌ์์ค๋ฅผ ๋ฐํ์ผ๋ก ์ฝ๋๋ฅผ ์์ฑํ ๊ฒ์ด๋ค.
main.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
required_version = ">= 1.2.0"
}
provider "aws" {
region = "ap-northeast-2"
}
๋ฆฌ์์ค ๋ณ๋ก ์ฝ๋๋ฅผ ์์ฑํ๊ณ ์ main.tf์๋ provider๋ง ์์ฑํ์๋ค.
Network.tf
resource "aws_vpc" "olivesafety-vpc-ap-01" {
cidr_block = "vpc cidr block"
enable_dns_support = true
enable_dns_hostnames = false
instance_tenancy = "default"
}
resource "aws_subnet" "olivesafety-sub-pub-01" {
availability_zone = "ap-northeast-2a"
cidr_block = "subnet cidr block"
vpc_id = "${aws_vpc.olivesafety_vpc.id}"
map_public_ip_on_launch = true
}
resource "aws_subnet" "olivesafety-sub-pri-01" {
availability_zone = "ap-northeast-2a"
cidr_block = "subnet cidr block"
vpc_id = "${aws_vpc.olivesafety_vpc.id}"
}
resource "aws_route_table" "olivesafety-rtb-pub" {
vpc_id = "${aws_vpc.olivesafety-vpc-ap-01.id}"
}
Network.tf๋ ์ฌ์ฉ๋ ๋ฆฌ์์ค ๋ณ๋ก ํ๋์ฉ ์ผ๋ถ๋ง ์์ฑํ์๋ค. ๋ชจ๋ ์ฝ๋๊ฐ ์์ฑ๋๋ฉด ์ถํ์ ๋ ์์ฑํ๊ฒ ๋ค.
'Cloud > AWS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[AWS] AWS EC2๋? (0) | 2025.05.01 |
---|