Update ProceduresΒΆ
Procedures for safely updating the S3 Provisioner tool and maintaining deployed infrastructure.
Table of ContentsΒΆ
Version StrategyΒΆ
Semantic VersioningΒΆ
We follow Semantic Versioning 2.0.0:
MAJOR (1.x.x): Breaking changes, incompatible configuration format changes
MINOR (x.1.x): New features, new actions, backward compatible
PATCH (x.x.1): Bug fixes, backward compatible
Example: 1.2.3 β Major: 1, Minor: 2, Patch: 3
Pre-Update ChecklistΒΆ
Before updating:
Review RELEASE_NOTES.md for breaking changes
Backup current configuration files
Document current image version:
docker images s3-provisionerTest new version against a non-production config first
Schedule maintenance window for production updates
Notify stakeholders
Prepare rollback plan (keep previous image tag)
Updating the Docker ImageΒΆ
Pull New VersionΒΆ
# Pull latest from AWS Marketplace registry
docker pull public.ecr.aws/<marketplace-id>/s3-provisioner:latest
# Or pull specific version
docker pull public.ecr.aws/<marketplace-id>/s3-provisioner:1.2.3
# Tag locally
docker tag public.ecr.aws/<marketplace-id>/s3-provisioner:latest s3-provisioner:latest
Note: Replace <marketplace-id> with the actual registry path from your AWS Marketplace subscription.
Verify New VersionΒΆ
# Check image details
docker images s3-provisioner
# Verify tool runs
docker run --rm s3-provisioner:latest --help
# Validate existing config against new version
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config your-config.yaml \
--action validate-config
Test Before ProductionΒΆ
Run a test deployment with the new image to verify compatibility:
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config your-config.yaml \
--action test-deploy \
--solution master-solution
This creates an isolated test stack with a random suffix β no impact on production resources. Delete the test stack when done:
aws cloudformation delete-stack \
--stack-name <test-stack-name> \
--region us-west-1
Rollback ProceduresΒΆ
Quick RollbackΒΆ
If the new version causes issues, revert to the previous image:
# Re-tag previous version
docker tag public.ecr.aws/<marketplace-id>/s3-provisioner:1.2.2 s3-provisioner:latest
# Verify rollback
docker run --rm s3-provisioner:latest --help
# Validate config with previous version
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config your-config.yaml \
--action validate-config
Keep Multiple VersionsΒΆ
Tag versions explicitly so you can switch between them:
docker tag public.ecr.aws/<marketplace-id>/s3-provisioner:1.2.2 s3-provisioner:1.2.2
docker tag public.ecr.aws/<marketplace-id>/s3-provisioner:1.2.3 s3-provisioner:1.2.3
# Use specific version
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:1.2.2 \
--config your-config.yaml \
--action validate-config
Configuration UpdatesΒΆ
Modifying an Existing ConfigurationΒΆ
When you need to change bucket settings (versioning, lifecycle policy, tags):
# 1. Edit configuration file
vi configs/edge-prod-b001-us-west-1-s3.yaml
# 2. Validate changes
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action validate-config
# 3. Regenerate CloudFormation template
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/templates:/app/templates \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action create-prov-template \
--solution master-solution
# 4. Validate the template
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/templates:/app/templates \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action validate-prov-template \
--solution master-solution
# 5. Preview what will change
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/templates:/app/templates \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action show-changes \
--solution master-solution
# 6. Regenerate IAM policy (if permissions changed)
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/policies:/app/policies \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action create-policy
Changing Lifecycle PolicyΒΆ
# Before
s3:
lifecycle_policy: development
# After
s3:
lifecycle_policy: ml-optimized
After changing, regenerate the template and preview changes with show-changes before applying.
Infrastructure MaintenanceΒΆ
Drift DetectionΒΆ
Check if deployed infrastructure has been modified outside of CloudFormation:
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action check-drift
If drift is detected, review the changes and decide whether to:
Update the configuration to match the current state
Redeploy to restore the intended state
Uploading Updated TemplatesΒΆ
After regenerating a template, upload it to S3 for reference:
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/templates:/app/templates \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action upload-template \
--solution master-solution
Replacing a DeploymentΒΆ
To fully replace an existing deployment:
# 1. Tear down existing infrastructure
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action tear-down \
--force
# 2. Redeploy with updated configuration
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/templates:/app/templates \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action prep-master \
--solution master-solution \
--force
Warning: tear-down deletes the bucket and all its contents. Ensure you have backups before proceeding.
Adding Solutions to Existing BucketsΒΆ
Pattern B: Dedicated BucketΒΆ
Create a new config file for the new solution and deploy:
# 1. Create config with bucket_name_override
# configs/edge-prod-b001-us-west-1-recommendation-engine-s3.yaml
# 2. Validate
docker run --rm \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-recommendation-engine-s3.yaml \
--action validate-config
# 3. Deploy
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/templates:/app/templates \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-recommendation-engine-s3.yaml \
--action create-bucket \
--solution recommendation-engine \
--force
Monitoring After UpdateΒΆ
Verify Deployed InfrastructureΒΆ
# Check CloudFormation stack status
aws cloudformation describe-stacks \
--stack-name edge-prod-b001-us-west-1-s3-stack \
--region us-west-1 \
--query 'Stacks[0].StackStatus'
# Check bucket exists
aws s3 ls s3://edge-prod-b001-us-west-1-s3/
# List solution folders
aws s3 ls s3://edge-prod-b001-us-west-1-s3/solutions/
# Run drift detection
docker run --rm \
-v ~/.aws:/home/s3user/.aws:ro \
-v $(pwd)/s3/configs:/app/configs:ro \
-v $(pwd)/s3/reports:/app/reports \
s3-provisioner:latest \
--config edge-prod-b001-us-west-1-s3.yaml \
--action check-drift
Review LogsΒΆ
# Check recent execution logs
ls -lt reports/*.log | head -5
# Check for errors in logs
grep -i error reports/*.log
Update ScheduleΒΆ
Recommended ScheduleΒΆ
Security patches: Within 24 hours of release
Bug fixes: Within 1 week
Minor updates: Monthly
Major updates: Quarterly (after thorough testing)
Maintenance WindowsΒΆ
Development: Anytime
Staging: Business hours (for immediate feedback)
Production: Scheduled maintenance window with stakeholder notification
Copyright Β© 2025 Axon Tech Labs All rights reserved.
See LICENSE.txt for terms and conditions.