CloudFormation scripts to run on Amazon Web Services, to create a static webiste using S3 Bucket and CloudFront distribution.
Here are some of the requirements, to run these scripts on your local machine:
- Download a text editor like Microsoft Visual Studio Code. Link to download Microsoft Visual Studio Code: https://code.visualstudio.com/
- Set up an Amazon Web Services account. Here's link to create your AWS account: https://portal.aws.amazon.com/billing/signup#/start
- Set AWS Command Line Interface on your device. Download AWS CLI tool using the link: https://aws.amazon.com/cli/.
- Use the following command in your command prompt or terminal of your VS Code to set-up your AWS account.
$ aws configure
- Follow the steps to create Access Key and Secret Access Key in IAM, using the following link: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#cli-quick-configuration
- Open VS Studio code, and open the repository containing all the file for of scripts.
- Run the following command to create the stack to create S3 bucket:
$ ./create <stack-name> bucket.yml bucket.json
- (Optional) Run the following command to update the cloudformation stack:
$ ./update <stack-name> bucket.yml bucket.json
- Open Cloud Formation in AWS console to check if stack was created or updated successfully.
- Upload index.html to S3 bucket. (Alert! Deployments.yml won't work to deploy cloudfront distribution. So, to create cloudfront distribution, use AWS management console.)