This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure the AWS Provider | |
provider "aws" { | |
region = "ap-northeast-2" | |
} | |
# resource - instanace | |
resource "aws_instance" "mymymi_ubuntu" { | |
ami = data.aws_ami.ubuntu.id | |
instance_type = "t2.micro" | |
tags = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "ap-northeast-2" | |
} | |
resource "aws_instance" "example" { | |
ami = "ami-050a4617492ff5822" | |
instance_type = "t2.micro" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:PutObject", | |
"s3:GetObject", | |
"s3:DeleteObject" | |
], | |
"Resource": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:List*", | |
"Resource": "arn:aws:s3:::*" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowCloudFrontServicePrincipalReadOnly", | |
"Effect": "Allow", | |
"Principal": { | |
#cloudFront를 대상으로 아래의 action을 허용 | |
"Service": "cloudfront.amazonaws.com" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Outputs: # 결과로 제공할 데이터를 | |
VPC: | |
Description: VPC | |
Value: !Ref VPC | |
AZ1: | |
Description: Availability Zone 1 | |
Value: !GetAtt | |
- PublicSubnet | |
- AvailabilityZone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Deploy VPC | |
Resources: | |
PublicSubnet: | |
Type: AWS::EC2::Subnet | |
Properties: | |
VpcId: !Ref VPC #VPC의 ID를 참조 | |
CidrBlock: 10.0.0.0/24 #VPC 네트워크 내의 CIDR 주소를 선택 | |
AvailabilityZone: !Select #!Select는 함수로, 리전 내의 가용 영역을 검색 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Deploy VPC | |
Resources: | |
InternetGateway: | |
Type: AWS::EC2::InternetGateway | |
Properties: | |
Tags: | |
- Key: Name | |
Value: Internet Gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Deploy VPC | |
Resources: | |
VPC: | |
Type: AWS::EC2::VPC | |
Properties: | |
CidrBlock: 10.0.0.0/16 # CIDR 범위를 하드 코딩, 입력 값으로 받을 수도 있다. | |
EnableDnsHostnames: true # DNS를 할당하도록 활성화 | |
Tags: #태깅 작업 | |
- Key: Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowS3ReadAccess", #s3의 읽기 권한 부여 | |
"Effect": "Allow", | |
#Principal은 리소스 기반에서만 사용, 특정 계정의 특정 role만 허용 시킴 | |
"Principal": { | |
"AWS": "arn:aws:iam::<account ID>:role/<대상 role 이름>" | |
}, |