-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathds_shared_ecr.yaml
77 lines (73 loc) · 2.61 KB
/
ds_shared_ecr.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
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
Description: |
Create a shared service ECR repository.
Parameters:
SharedServiceStackSetName:
Type: String
Description: Common root name used across shared service cloudformation resources
ECRRepositoryName:
Type: String
AllowedPattern: '(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*'
Description: Shared ECR Repository name for data science projects, see Amazon ECR documentation for details on allow patterns for name
Outputs:
DSECRRepositoryName:
Description: The name of the Data Science Shared ECR Repository
Value: !Ref ECRRepositoryName
Export:
Name: !Sub 'ds-shared-ecr-repository-${SharedServiceStackSetName}'
Resources:
DSECRRepository:
Type: 'AWS::ECR::Repository'
Properties:
EncryptionConfiguration:
EncryptionType: 'KMS'
ImageScanningConfiguration:
ScanOnPush: "true"
ImageTagMutability: 'MUTABLE'
RepositoryName: !Ref ECRRepositoryName
# RepositoryPolicyText: |
# {
# "Version":"2012-10-17",
# "Statement":
# [
# {
# "Sid": "FullECRAdminToDSAdmin",
# "Effect": "Allow",
# "Principal": {
# "AWS": [
# { "Fn::Sub": "arn:aws:iam::${AWS::AccountId}:role/ds-admin-role*" }
# ]
# },
# "Action": [
# "ecr:*"
# ]
# },
# {
# "Sid": "AllowPullToDataScientist",
# "Effect": "Allow",
# "Principal": {
# "AWS": [
# { "Fn::Sub": "arn:aws:iam::${AWS::AccountId}:role/service-role/ds-notebook-role*" },
# { "Fn::Sub": "arn:aws:iam::${AWS::AccountId}:role/ds-user-role*" }
# ]
# },
# "Action": [
# "ecr:BatchCheckLayerAvailability",
# "ecr:GetDownloadUrlForLayer",
# "ecr:GetRepositoryPolicy",
# "ecr:DescribeRepositories",
# "ecr:DescribeImages",
# "ecr:ListImages",
# "ecr:BatchGetImage",
# "ecr:GetLifecyclePolicy",
# "ecr:GetLifecyclePolicyPreview",
# "ecr:ListTagsForResource",
# "ecr:DescribeImageScanFindings"
# ]
# }
# ]
# }
Tags:
- Key: SharedServiceStackSetName
Value: !Ref SharedServiceStackSetName