템플릿 및 스택으로 작업
- 템플릿(json or yaml)을 생성하여 aws 리소스와 해당 속성에 대해 설명하며, 스택 생성할때마다 템플릿에 설명된 리소스를 프로비저닝함
cloudformation → S3 yaml
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
MyBucketName:
Type: String
Description: Enter the bucket name
Default: create-bucket-cfn
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref MyBucketName
# MyBucketPolicy:
# Type: AWS::S3::BucketPolicy
# Properties:
# Bucket: !Ref MyS3Bucket
# PolicyDocument:
# Version: 2012-10-17
# Statement:
# - Effect: Allow
# Principal: "*"
# Action:
# - s3:GetObject
# - s3:PutObject
# - s3:DeleteObject
# - s3:PutBucketPolicy
# Resource: !Join
# - ''
# - - 'arn:aws:s3:::'
# - !Ref MyS3Bucket
# - '/*'
반응형