Table of Contents

S3

Changelog

  • 2026-01-12: Init

2026-03-24 Tuesday

As it turns out, creating a budget is extremely straightforward:

Screenshot

Storage class comparison (updated from the old comparison), for us-east-1, as of 24 March (to two significant figures) and excluding tiered pricing:

Storage class Min storage (days) Storage (¢/GB/mth) PUTs (¢/'000) GETs (¢/'000) Lifecycle transfer (¢/'000) Transfer out (¢/GB)
Standard 0 2.3 0.5 0.04 0 9.0
Standard-IA 30 1.3 1.0 0.1 1.0
Glacier IR 90 0.4 2.0 1.0 2.0
Glacier Deep Archive 180 0.1 5.0 0.04 5.0

Calculator to put all these into action: https://calculator.aws/#/createCalculator/S3

Suppose 1TB/mth worth of data split across approximately 20MB blobs.

Storage class Total (excluding transfer out) Storage PUTs GETs Lifecycle transfer Transfer out
Standard 23 23 0.25 0.01 0 27
Standard-IA 14 13 0.5 0.02 0.5
Glacier IR 6 4 1 0.15 1
Glacier Deep Archive 6 1 + 0.01 (metadata) 2.5 0.01 2.5 27 + 0.38 (requests) + 0.75 (retrieval)

2026-03-23 Monday

Looks like the deploy keyword is intended more for serverless deploy. Use create-stack instead, with the --parameters argument to supply parameters.

# Create stack
aws cloudformation create-stack \
    --stack-name teststack \
    --template-body file://template.yaml \
    --capabilities CAPABILITY_IAM \
    --parameters ParameterKey=EnableVersioning,ParameterValue=Enabled
 
# Monitor stack status and view parameters
aws cloudformation describe-stacks --stack-name teststack \
    | yq '.Stacks[0].StackStatus'
 
# Delete stack
aws cloudformation delete-stack --stack-name teststack

CloudFormation policy so far

2026-03-22 Sunday

Going through the cfn best-practices page now, some hints:

Other miscellaneous things:

See templates at sample templates.

---

cfn templates allow the following root sections:

Other sections are intended for policy checks, i.e. Metadata, Rules, Conditions, Transform. The template reference is here.

---

Relevant resource policies for S3 are DeletionPolicy (whether resource should be retained when stack is deleted) and UpdateReplacePolicy (whether resource should be retained during replacement as part of stack update). Both are Delete by default. Can be assigned to Retain.

Pseudo-parameters: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html

---

Outputs:

Outputs:
  BucketName:
    Description: Name of S3 Bucket
    Value: !Ref S3Bucket  # defaults to bucket name
    Export:
      Name: !Sub '${AWS::StackName}-BucketName'

2026-03-14 Saturday

Using AWS CloudFormation for IaC. Documentation here. Summary of key points:

CloudFormation policies

Specific to S3 buckets: here is a 'Hello World' policy:

# helloworld.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: "Hello World"
Resources:
  S3Bucket:
    Type: "AWS::S3::Bucket"

Configure AWS CLI to reference the target region:

user:~$ aws configure
AWS Access Key ID [********************]: 
AWS Secret Access Key [********************]: 
Default region name [ap-southeast-1]: 
Default output format [yaml]:

Run a deploy:

user:~$ aws cloudformation deploy --stack-name teststack --template-file helloworld.yaml

Then find the stack initialized within the region in CloudFormation, e.g. ap-southeast-1. As well as in the respective service page.

Screenshots

Delete stack:

user:~$ aws cloudformation delete-stack --stack-name teststack

2026-01-12 Monday

Creating an S3 bucket... a couple of TODOs:

  1. IAM:
    • Create a user group: Name, Users, Permission policies.
    • Create a user: Name, Permissions.
    • A specific permission policy can be created as well, under Policies.

Some comments: