LoginSignup
0
0

More than 1 year has passed since last update.

【AWS】S3をCloudFormationで作成してみました

Last updated at Posted at 2021-08-05

はじめに

S3をCloudFormationで簡単に作成してみました。
ざっくりでは下記が設定項目となっております。
S3のバケットポリシーなどは、今回は入れておりません。

項目 設定
デフォルトの暗号化(SSE-S3) 有効
バージョニング機能 有効
ブロックパブリックアクセス(バケット設定) 有効

テンプレート

CloudFormation のテンプレートは下記となります。
BucketName欄に、ご希望のS3バケット名を入れ替えて入力してください。

AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template for S3 Bucket
Resources:
  S3Bucket:
    Type: AWS::S3::Bucket
    Properties: 
      BucketName:  <バケット名>
      VersioningConfiguration:
        Status: Enabled
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: AES256
      PublicAccessBlockConfiguration:
        BlockPublicAcls: True
        BlockPublicPolicy: True
        IgnorePublicAcls: True
        RestrictPublicBuckets: True

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0