January 2019
Intermediate to advanced
520 pages
14h 32m
English
Add a resources section that contains Resources and Outputs maps to declare the necessary resources and output variables. Let's add Resources:
resources: Resources:
Add an S3 bucket declaration, where we place all the assets and set WebsiteConfiguration to set the default index file:
RustSlsBucket: Type: AWS::S3::Bucket Properties: BucketName: rust-sls-aws WebsiteConfiguration: IndexDocument: index.html
We also have to add a policy to allow these files to be read by an external client, such as a browser:
RustSlsBucketPolicy: Type: AWS::S3::BucketPolicy Properties: Bucket: Ref: "RustSlsBucket" PolicyDocument: Statement: - Effect: "Allow" Principal: "*" Action: - "s3:GetObject" Resource: Fn::Join: - "" - - "arn:aws:s3:::" - Ref: "RustSlsBucket" ...
Read now
Unlock full access