Create S3 Bucket

Create S3 Bucket

In this section, we will use CloudFormation to create resources for the lab. CloudFormation stack will create service resources like EC2 instance, SNS Topic, and Lambda Function

The first step we need to download template CloudFormation and Lambda Function

  1. After downloading template CloudFormation and Lambda Function

    • We will create a S3 bucket to store the source.
    • Go to AWS Management Console, find and select S3

AWS Backup

  1. In the S3 interface, select Create bucket

AWS Backup

  1. In the Create bucket interface

    • Enter Bucket name must enter a unique name, you can choose arbitrarily (If the match will lead to an error and cannot initialize the bucket)

AWS Backup

  1. Preserve the configuration.

AWS Backup

  1. Select Create bucket

AWS Backup

  1. Finish creating S3 bucket

AWS Backup

  1. Make an archive folder

AWS Backup

  1. In the interface create a folder

    • Enter the name Folder name
    • Select Create folder

AWS Backup

  1. Finish creating a folder

AWS Backup

  1. In the folder just created, execute Upload the downloaded and unzipped files.

AWS Backup

  1. In the Upload section

    • Select Add files
    • Select the files you want to upload.
    • Select Upload

AWS Backup

  1. Finish downloading files

AWS Backup

  1. Configure Permissions for S3 bucket

    • For Block public access (bucket settings)

AWS Backup

  1. Uncheck *Block all public access

    • Then, select Save changes

AWS Backup

  1. Confirm with confirm and select Confirm

AWS Backup

  1. Then configure Bucket policy

    • Select Edit

AWS Backup

  1. In the Edit bucket policy interface

    • Enter the following code and replace it with your Bucket ARN.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resources": [
                "arn:aws:s3:::Bucket-Name/*"
            ]
        }
    ]
}

AWS Backup

  1. Select Save changes

AWS Backup

  1. Check Permissions Public

AWS Backup

  1. Copy the path information of lambda_function.zip

AWS Backup

  1. Copy the Object URL information of the file backup-lab.yaml

AWS Backup