-
Notifications
You must be signed in to change notification settings - Fork 0
/
mobile-notifications-shared-resources.yaml
82 lines (80 loc) · 3.06 KB
/
mobile-notifications-shared-resources.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
AWSTemplateFormatVersion: '2010-09-09'
Description: Mobile notification content shared resources
Parameters:
CapiAccountId:
Description: Account ID of the gu capi account which
Type: String
Default: 308506855511
Resources:
ContentLambdaContainerRepository:
Type: AWS::ECR::Repository
Properties:
ImageScanningConfiguration: { ScanOnPush: true }
RepositoryName: mobile-notifications-content
ImageTagMutability: IMMUTABLE
LiveblogsLambdaContainerRepository:
Type: AWS::ECR::Repository
Properties:
ImageScanningConfiguration: { ScanOnPush: true }
RepositoryName: mobile-notifications-liveblogs
ImageTagMutability: IMMUTABLE
CIRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Federated:
- !Sub arn:aws:iam::${CapiAccountId}:oidc-provider/token.actions.githubusercontent.com
Action:
- sts:AssumeRoleWithWebIdentity
Condition:
StringEquals:
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
StringLike:
"token.actions.githubusercontent.com:sub": "repo:guardian/mobile-notifications-content:*"
Path: /
Policies:
- PolicyName: ecr-token
PolicyDocument:
Statement:
Effect: Allow
Action:
- ecr:GetAuthorizationToken
Resource: "*"
- PolicyName: ecr-upload
PolicyDocument:
Statement:
Effect: Allow
Action:
- ecr:CompleteLayerUpload
- ecr:UploadLayerPart
- ecr:InitiateLayerUpload
- ecr:BatchCheckLayerAvailability
- ecr:PutImage
Resource:
- !GetAtt ContentLambdaContainerRepository.Arn
- !GetAtt LiveblogsLambdaContainerRepository.Arn
Outputs:
ContentLambdaContainerRepositoryUri:
Description: "Uri of the ECR repository for the content notification lambda"
Value: !GetAtt ContentLambdaContainerRepository.RepositoryUri
Export:
Name: !Sub ${AWS::StackName}-ContentLambdaContainerRepositoryUri
ContentLambdaContainerRepositoryArn:
Description: "ARN of the ECR repository for the content notification lambda"
Value: !GetAtt ContentLambdaContainerRepository.Arn
Export:
Name: !Sub ${AWS::StackName}-ContentLambdaContainerRepositoryArn
LiveblogsLambdaContainerRepositoryUri:
Description: "Uri of the ECR repository for the liveblogs notification lambda"
Value: !GetAtt LiveblogsLambdaContainerRepository.RepositoryUri
Export:
Name: !Sub ${AWS::StackName}-LiveblogsLambdaContainerRepositoryUri
LiveblogsLambdaContainerRepositoryArn:
Description: "ARN of the ECR repository for the liveblogs notification lambda"
Value: !GetAtt LiveblogsLambdaContainerRepository.Arn
Export:
Name: !Sub ${AWS::StackName}-LiveblogsLambdaContainerRepositoryArn