This repository was archived by the owner on Feb 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathreplicate-template.yaml
More file actions
54 lines (52 loc) · 1.82 KB
/
replicate-template.yaml
File metadata and controls
54 lines (52 loc) · 1.82 KB
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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Parameters:
SourceRepositoryName:
Type: String
Description: Enter the CodeCommit repository name to source for replication.
TargetRepositoryName:
Type: String
Description: Enter the CodeCommit repository name to target for replication.
TargetRepositoryRegion:
Type: String
Description: Enter the CodeCommit repository region to target for replication.
Resources:
Replicator:
Type: 'AWS::Serverless::Function'
Properties:
Handler: cwecc.ReplicateRepositoryHandler
Runtime: java8
CodeUri: ./build/distributions/
Description: CodeCommit Replication
MemorySize: 1028
Timeout: 300
Environment:
Variables:
TARGET_REPO_NAME: !Ref TargetRepositoryName
TARGET_REPO_REGION: !Ref TargetRepositoryRegion
Events:
ReferenceCreatedOrUpdated:
Type: CloudWatchEvent
Properties:
Pattern:
source:
- aws.codecommit
resources:
- !Sub 'arn:aws:codecommit:${AWS::Region}:${AWS::AccountId}:${SourceRepositoryName}'
detail:
event:
- referenceCreated
- referenceUpdated
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Resource: !Sub 'arn:aws:codecommit:${AWS::Region}:${AWS::AccountId}:${SourceRepositoryName}'
Action:
- 'codecommit:GetRepository'
- 'codecommit:GitPull'
- Effect: Allow
Resource: !Sub 'arn:aws:codecommit:${TargetRepositoryRegion}:${AWS::AccountId}:${TargetRepositoryName}'
Action:
- 'codecommit:GetRepository'
- 'codecommit:GitPush'