Skip to main content
Welcome back, students. This lesson reviews storage patterns for deployment artifacts and application binaries on AWS. We focus on three primary artifact stores used in CI/CD pipelines: AWS CodeArtifact, Amazon S3, and Amazon Elastic Container Registry (ECR). You’ll learn where build outputs typically live, how pipelines connect to artifact stores, and the benefits of each option.
A slide titled "Recap: AWS Services for Artifact Management" showing three service icons and labels: AWS CodeArtifact, Amazon Simple Storage Service (S3), and Amazon Elastic Container Registry (ECR).
What counts as an artifact?
  • 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)
A presentation slide titled "Deployment Artifacts" showing four colored panels: Build Outputs, IaC Templates, Config Files & Binaries, and Container Images, each with a short description. It illustrates the different types of artifacts produced during software deployment.
High-level CI/CD flow
  • 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.
Helpful mapping: pipeline step → AWS service/tool 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.
A diagram titled "IaC Template Storage Pattern" showing AWS services: icons for AWS Lambda, Amazon EC2 and Amazon S3 inside an AWS Cloud box, and a separate S3 + template icon feeding into AWS CloudFormation. It illustrates storing IaC templates in S3 and deploying them with CloudFormation.
Benefits of storing IaC templates in S3
  • 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.
A presentation slide titled "IaC Template Storage Pattern" showing five colorful icons and labels under a "Benefits" header: Consistency across environments, Rollback support, Sharing IaC between teams, Modular infrastructure definitions, and Version control. The layout highlights key benefits of storing infrastructure-as-code templates.
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.
CodeArtifact — package repository for dependencies and artifacts
  • 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.
A slide titled "Code Artifacts Pattern" showing a "Benefits" bar and three colored icons. The icons are labeled "Secure supply chain", "Faster builds (local cache)", and "Dependency version pinning".
Application artifacts — what to store and where
  • 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.
A presentation slide titled "Application Artifacts" showing a two-column table that maps development stacks/languages (Java, .NET, Node.js, Python, Go, Docker, Static Sites) to their common artifact types (e.g., .jar/.war/.ear, .dll/.exe, bundled .js/.zip, .whl/.tar.gz, compiled binaries, Docker images, .html/.css/.js). The slide is branded with "© Copyright KodeKloud."
Block storage and snapshots
  • 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.
A diagram titled "Block Storage Pattern" showing a cloud Region and VPC with two Availability Zones, each containing compute instances and EBS volumes. To the right are stacked bucket icons labeled EBS Snapshots, indicating snapshot storage.
Amazon S3 as a general-purpose artifact store
  • 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.
A presentation slide titled "S3 for Application Artifacts" showing the Amazon S3 bucket icon and three points: single source of truth for artifacts; supports versioning, access control and event triggers; and integrates with CloudFront for global delivery.
Container images and registries
  • 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.
Recommended storage by artifact type 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.
These storage patterns are common in production and on exams covering CI/CD and artifact management. Choosing the right store for each artifact type helps you build repeatable, auditable, and recoverable deployment workflows. Links and references

Watch Video