Skip to content

Publish

Progress checklist

demo.sh publish uploads a file to the Sydney primary under demo/ with aws s3 cp, then polls Auckland until the same key shows up (CRR).

  • Default: writes a small text file to a temp path, uploads it, deletes the temp file. Key looks like demo/see-<UTC-timestamp>.txt.
  • Optional argument: ./scripts/demo.sh publish /path/to/file uploads that file instead (same demo/see-<timestamp>.txt key naming).

Body is plain text (Content-Type: text/plain). The key lands in .lab-state.json as demo_key for prove.

Publish uploads under demo/ then CRR copies to Auckland demo.sh publish uploads a text object under demo/ on the Sydney primary and waits until the same key appears on the Auckland replica. publish: upload demo/ then wait for CRR Publisher aws s3 cp ap-southeast-2 S3 primary demo/see-....txt ReplicationStatus COMPLETED CRR demo/ prefix ap-southeast-6 S3 replica same key ReplicationStatus REPLICA Default: generated temp text file | optional: ./scripts/demo.sh publish /path/to/file
  1. Publish (generated demo object):

    Terminal window
    export AWS_PROFILE=sandbox
    ./scripts/demo.sh publish

    Lab run:

    upload: /tmp/... to s3://ps3a-artifacts-**ACCOUNT**-syd/demo/see-20260904T205809Z.txt
    waiting for CRR to ps3a-artifacts-**ACCOUNT**-akl ...
    replicated: s3://ps3a-artifacts-**ACCOUNT**-akl/demo/see-20260904T205809Z.txt

Set once:

Terminal window
PRIMARY="$(jq -r .primary_bucket .lab-state.json)"
REPLICA="$(jq -r .replica_bucket .lab-state.json)"
KEY="$(jq -r .demo_key .lab-state.json)"
  1. Confirm state recorded the key:

    Terminal window
    jq '{demo_key, primary_bucket, replica_bucket}' .lab-state.json
    {
    "demo_key": "demo/see-20260904T205809Z.txt",
    "primary_bucket": "ps3a-artifacts-**ACCOUNT**-syd",
    "replica_bucket": "ps3a-artifacts-**ACCOUNT**-akl"
    }
  2. Head the primary object:

    Terminal window
    aws s3api head-object --bucket "$PRIMARY" --key "$KEY" --region ap-southeast-2 \
    --query '{ContentLength:ContentLength,ContentType:ContentType,ReplicationStatus:ReplicationStatus}' \
    --output json
    {
    "ContentLength": 144,
    "ContentType": "text/plain",
    "ReplicationStatus": "COMPLETED"
    }
  3. Read the primary body:

    Terminal window
    aws s3 cp "s3://${PRIMARY}/${KEY}" - --region ap-southeast-2
    private-s3-artifact-store demo object
    created_utc=20260904T205809Z
    primary_bucket=ps3a-artifacts-**ACCOUNT**-syd
    primary_region=ap-southeast-2
  4. Head the replica object:

    Terminal window
    aws s3api head-object --bucket "$REPLICA" --key "$KEY" --region ap-southeast-6 \
    --query '{ContentLength:ContentLength,ContentType:ContentType,ReplicationStatus:ReplicationStatus}' \
    --output json
    {
    "ContentLength": 144,
    "ContentType": "text/plain",
    "ReplicationStatus": "REPLICA"
    }
  5. Read the replica body (same content):

    Terminal window
    aws s3 cp "s3://${REPLICA}/${KEY}" - --region ap-southeast-6
    private-s3-artifact-store demo object
    created_utc=20260904T205809Z
    primary_bucket=ps3a-artifacts-**ACCOUNT**-syd
    primary_region=ap-southeast-2
  6. Replication status query used by the short check:

    Terminal window
    aws s3api head-object --bucket "$REPLICA" --key "$KEY" \
    --region ap-southeast-6 --query ReplicationStatus --output text
    REPLICA

Prove