CodeDeploy Application and Deployment Groups
What you'll learn: How to organize your deployment targets using CodeDeploy applications and deployment groups as logical containers for your infrastructure.
Core Concept
In CodeDeploy, an Application is simply a logical name that groups everything related to a specific deployment. Think of it as a project folder. Within that application, you create Deployment Groups, which define where your code will be deployed—the actual EC2 instances, Lambda functions, or ECS services that will receive your updates.
The application itself doesn't do anything; it's purely organizational. The deployment group is where the action happens—it specifies the exact targets, deployment configuration, and how CodeDeploy should handle the rollout.
The Two-Tier Structure
Application Layer: A named container that represents your software project. You might have applications named "WebApp," "APIService," or "MobileBackend."
Deployment Group Layer: Within each application, you define one or more deployment groups representing different environments or configurations. For example, your "WebApp" application might have deployment groups called "WebApp-Production" and "WebApp-Staging."
Each deployment group includes:
- Target selection: Tags that identify which EC2 instances, or ARNs for Lambda/ECS
- Deployment configuration: How fast to roll out (all-at-once, one-at-a-time, etc.)
- Service role: IAM permissions for CodeDeploy to access your resources
- Load balancer integration: Optional traffic routing during deployments
Why This Structure Matters
This separation lets you deploy the same application code to different environments with different settings. Your staging group might deploy all-at-once for speed, while production uses a gradual rollout with automatic rollback on errors.
Key Takeaway: CodeDeploy Applications are organizational containers, while Deployment Groups define the actual deployment targets and behavior—together they provide a flexible structure for managing deployments across different environments and infrastructure types.