Lucky for me I work with legends who have already figured this out so most of the below is based on the work done by Jaco Brink - cheers brother!
The below assumes your AWS CLI is installed and configured.
Note the user will need permissions policies
AWSCloudFormationFullAccess. Hopefully you add these via a user group and not attach directly like a moegoe 😐
Create the Bucket
Cloud formation is the weapon of choice when deploying infrastructure. Its repeatable and then managed by AWS.
The cloud formation template data here is kept in
porky-bucket-website.json because YML hurts my brain.
Now run the cloudformation comand:
aws cloudformation create-stack --stack-name PorkyBucketWebsiteStack --template-body file://./aws-deploy/porky-bucket-website.json --profile infrauser --region ap-southeast-2
You can also run with
update-stack to update.
Now after publishing your code to
./pub deploy it to the bucket.
aws s3 sync './pub' 's3://ums-audits' --acl public-read --profile infrauser --region ap-southeast-2
The DNS is avalible from the AWS Console ->
Amazon S3 ->
Static website hosting
By default this will not have HTTPS.