3.1.3 Repositories

Source Code Repositories

Git Providers cho AWS

ProviderIntegrationAuth
GitHubCodeStar ConnectionsOAuth, PAT
GitLabCodeStar ConnectionsOAuth
BitbucketCodeStar ConnectionsOAuth
CodeCommitNative (deprecated for new users)IAM, SSH, HTTPS

AWS CodeCommit không còn nhận new customers (July 2024). AWS khuyến nghị dùng third-party Git providers với CodeStar Connections.

CodeStar Connections

GitHub/GitLab/Bitbucket → CodeStar Connection → CodePipeline
  • One-time setup: Authorize AWS to access repo
  • Automatic webhook: Trigger pipeline on push
  • Cross-account: Share connections via RAM

ECR (Elastic Container Registry)

# Login to ECR
aws ecr get-login-password --region us-east-1 | \
  docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com

# Build, tag, push
docker build -t my-app .
docker tag my-app:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:latest
FeatureECR PublicECR Private
AccessAnyoneIAM-controlled
ScanningBasicBasic + Enhanced (Inspector)
Lifecycle
Cross-account✅ (resource policy)

S3 as Source

  • CodePipeline can use S3 bucket as source
  • Upload ZIP → trigger pipeline
  • Versioning required on bucket

Exam Tip: CodeStar Connections cho GitHub/GitLab integration. ECR cho container images. S3 as source cần versioning enabled.