feat(cicd): enable S3-triggered CodePipeline and align IAM/ECR integration

- enable EventBridge notifications on source S3 bucket
- trigger CodePipeline execution on source.zip updates
- fix artifact bucket ARN substitutions
- extend CodePipeline role permissions for S3, CodeBuild, and approvals
- allow Lambda to pull images from ECR via repository policy
- export ECR repository URI and reference it from Lambda
This commit is contained in:
Daisuke Nakahara 2026-01-01 11:18:26 +09:00
parent 0c9a8feb9f
commit 621b9f006e
4 changed files with 97 additions and 15 deletions

View file

@ -14,8 +14,21 @@ Resources:
RepositoryName: !Ref RepositoryName
ImageScanningConfiguration:
ScanOnPush: true
RepositoryPolicyText:
Version: "2012-10-17"
Statement:
- Sid: AllowLambdaPullImage
Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action:
- ecr:BatchGetImage
- ecr:BatchCheckLayerAvailability
- ecr:GetDownloadUrlForLayer
Outputs:
RepositoryUri:
Description: URI of the ECR repository
Value: !GetAtt Repository.RepositoryUri
Export:
Name: BlogDeployment-RepositoryUri