Skip to content

Instantly share code, notes, and snippets.

@overnew
overnew / web_userdata.sh
Created April 21, 2024 13:49
web_userdata
#!/bin/bash
# Nginx 설치
apt update
apt install -y nginx
index_file="/var/www/html/index.html"
cat <<EOF > $index_file
@overnew
overnew / latest_ec2.tf
Created April 17, 2024 01:33
latest ec2 terraform example
# 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 = {
@overnew
overnew / ec2.tf
Created April 17, 2024 01:13
terraform ec2 example
provider "aws" {
region = "ap-northeast-2"
}
resource "aws_instance" "example" {
ami = "ami-050a4617492ff5822"
instance_type = "t2.micro"
}
@overnew
overnew / lake_role.json
Created April 1, 2024 04:58
lake_role.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
@overnew
overnew / vpc_s3enpoint_policy.json
Created March 28, 2024 01:06
vpc_s3enpoint_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:List*",
"Resource": "arn:aws:s3:::*"
},
{
@overnew
overnew / s3_cloudFront.yaml
Created March 26, 2024 04:18
s3_cloudFront.yaml
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFrontServicePrincipalReadOnly",
"Effect": "Allow",
"Principal": {
#cloudFront를 대상으로 아래의 action을 허용
"Service": "cloudfront.amazonaws.com"
},
@overnew
overnew / cloudFormation output.yaml
Created March 25, 2024 04:44
cloudFormation output.yaml
Outputs: # 결과로 제공할 데이터를
VPC:
Description: VPC
Value: !Ref VPC
AZ1:
Description: Availability Zone 1
Value: !GetAtt
- PublicSubnet
- AvailabilityZone
@overnew
overnew / CloudFormation.yaml
Created March 25, 2024 04:35
CloudFormation.yaml
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는 함수로, 리전 내의 가용 영역을 검색
@overnew
overnew / AWS cloudformation IGW.yaml
Created March 25, 2024 04:27
AWS cloudformation IGW
AWSTemplateFormatVersion: 2010-09-09
Description: Deploy VPC
Resources:
InternetGateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: Name
Value: Internet Gateway
@overnew
overnew / AWS_VPC.yaml
Last active March 25, 2024 04:21
AWS_VPC yaml example
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