Skip to content

Instantly share code, notes, and snippets.

@ramsaylanier
Created November 29, 2017 00:19
Show Gist options
  • Select an option

  • Save ramsaylanier/f6f75927b11d926f3a388167996f8f57 to your computer and use it in GitHub Desktop.

Select an option

Save ramsaylanier/f6f75927b11d926f3a388167996f8f57 to your computer and use it in GitHub Desktop.
service: thumbnail-creator
custom:
bucket: <your-website-bucket-name-here>
uploadBucket: <your-upload-bucket-name-here>
provider:
name: aws
runtime: nodejs6.10
resources:
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.uploadBucket}
WebAppS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucket}
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: index.html
WebAppS3BucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: WebAppS3Bucket
PolicyDocument:
Statement:
- Sid: PublicReadGetObject
Effect: Allow
Principal: "*"
Action:
- s3:GetObject
Resource: arn:aws:s3:::${self:custom.bucket}/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment