Resources:
ECRRepository:
Type: AWS::ECR::Repository
Properties:
RepositoryName: YourRepositoryName
ECRRepositoryRole:
Type: AWS::IAM::Role
Properties:
RoleName: test001
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: ecr.amazonaws.com
Action: sts:AssumeRole
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
RoleName: LambdaExecutionRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: LambdaECRIntegrationPolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- ecr:GetAuthorizationToken
- ecr:GetDownloadUrlForLayer
- ecr:BatchCheckLayerAvailability
- ecr:GetRepositoryPolicy
- ecr:DescribeRepositories
- ecr:ListImages
- ecr:GetLifecyclePolicy
- ecr:GetLifecyclePolicyPreview
- ecr:GetRepositoryPolicy
- ecr:DescribeImages
- ecr:GetImageScanFindings
- ecr:InitiateLayerUpload
- ecr:UploadLayerPart
- ecr:CompleteLayerUpload
- ecr:PutImage
Resource: !GetAtt ECRRepository.Arn
AnotherRole:
Type: AWS::IAM::Role
Properties:
RoleName: AnotherRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com # または必要なサービス
Action: sts:AssumeRole
ECRRepositoryPolicy:
Type: AWS::ECR::RepositoryPolicy
Properties:
RepositoryName: !Ref ECRRepository
PolicyText:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
AWS: !GetAtt AnotherRole.Arn # 別のIAMロールのARNを指定
Action:
- ecr:GetDownloadUrlForLayer
- ecr:BatchCheckLayerAvailability
- ecr:GetRepositoryPolicy
- ecr:DescribeRepositories
- ecr:ListImages
- ecr:GetLifecyclePolicy
- ecr:GetLifecyclePolicyPreview
- ecr:GetRepositoryPolicy
- ecr:DescribeImages
- ecr:GetImageScanFindings
- ecr:InitiateLayerUpload
- ecr:UploadLayerPart
- ecr:CompleteLayerUpload
- ecr:PutImage
XX is ~
XX discribe is ~
example.
XXX = XX + X
[[kiji-template]] * Name * Contents #contents * What's XX XX is ~ * Discribe XX discribe is ~ example. XXX = XX + X * 1. ** 1.1. *** 1.1.1 + ① ++ ② +++ ③ - ・1 -- ・2 --- ・3 | | |h | | | | | | ----