
- Build outputs and packaged binaries
- Third‑party libraries and pinned dependencies
- Infrastructure-as-code templates (CloudFormation, CDK-generated templates, Terraform artifacts)
- Configuration files, static assets (HTML/CSS/JS), and other file blobs
- Container images (stored in ECR)
- Machine images (AMIs backed by snapshots)

- Pull source from Git (upstream source control).
- Build, test, and package with CodeBuild (or other build service).
- Publish build outputs to the chosen artifact store: S3, CodeArtifact, or ECR.
- Deployment orchestration (CloudFormation, CodeDeploy, ECS/EKS, or other tools) pulls artifacts from the store and deploys them.
CloudFormation templates (including CDK-generated templates) are commonly uploaded to S3 and referenced by CloudFormation using an S3 URL. Pipelines will often upload the template to S3 and then invoke CloudFormation with that S3 template URL.

- Consistency: declared template versions improve environment reproducibility.
- Rollback: keep previous template versions and redeploy known-good states.
- Shareability: teams and accounts can reference identical artifact URLs (StackSets or cross-account access).
- Modularization: split networking, security, and shared services into separate, composable templates.
- Lifecycle & versioning: S3 supports versioning and lifecycle rules to manage template retention.

For source control keep using Git. Use artifact stores (S3, CodeArtifact, ECR) to host build outputs, create immutable versions, attach metadata, and provide optimized retrieval for your deployment tools.
- Use CodeArtifact for hosting language package formats: npm, Maven, PyPI, NuGet, etc.
- Typical flow: build in CodeBuild → publish dependencies or packaged artifacts to CodeArtifact → future builds pull dependencies from CodeArtifact.
- Benefits: secure supply chain, caching for faster builds, repository-style versioning and dependency pinning for reproducible builds.

- CodeArtifact or S3 can host binary artifacts: JARs/WARs, .NET assemblies, Python wheels, Node bundles, compiled Go binaries, and static website assets.
- Container images belong in a container registry (ECR). You can tag images for environment and version control.
- Treat application artifacts like dependencies: version and pin them so deployments reference a specific build.

- Compute instances attach EBS block volumes; those volumes can be snapshotted.
- EBS snapshots are stored in AWS-managed storage built on top of S3; you manage snapshots via the EC2 APIs/console (not by browsing an S3 bucket).
- Snapshots support incremental storage, lifecycle policies, and can be used to restore volumes or build AMIs.
Amazon Machine Images (AMIs) are backed by snapshots stored in AWS-managed storage (implemented on Amazon S3). These snapshot objects are not exposed as normal S3 buckets — manage them through the AMI and snapshot APIs or console.

- Use S3 for file-based artifacts: YAML/JSON templates, static site files, binaries, release artifacts and more.
- Advantages: 11‑9s durability, cost-effective storage classes, native versioning, fine-grained access control (IAM and bucket policies), event notifications (SNS/Lambda/SQS), lifecycle rules, and CloudFront integration for fast global delivery.
- S3 + CloudFront is a common pattern for distributing static assets.

- For containerized workloads, use ECR (Elastic Container Registry): an OCI-compatible image registry.
- ECR features: image tagging, vulnerability scanning (ECR image scanning), repository policies, and lifecycle rules for image pruning.
- Orchestrators (ECS, EKS) pull images from ECR during deployment. CodeBuild can build and push images to ECR as part of the pipeline.
Putting it all together
- Use CodeArtifact when you need a package repository with caching, pinning, and repository features for dependencies and packaged artifacts.
- Use S3 for file-based artifacts, templates, and static assets — leverage versioning, lifecycle management, and event notifications.
- Use ECR for container images; orchestration platforms pull images directly from ECR.
- Typical pipeline flow: build in CodeBuild → push artifacts to the selected store (S3, CodeArtifact, ECR) → deployment service (CloudFormation, CodeDeploy, ECS, or EKS) consumes artifacts and deploys.