-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
55 lines (49 loc) · 1.39 KB
/
app.py
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
import os
import aws_cdk as cdk
from aws_ecr_test.tn_stacks import SampleDistributionStack
from aws_ecr_test.tn_ecr import RepositoryGrant as Grant
app = cdk.App()
env = cdk.Environment(
account=os.getenv("CDK_DEFAULT_ACCOUNT"), region=os.getenv("CDK_DEFAULT_REGION")
)
github_provider = os.environ["AWS_GITHUB_PROVIDER_ARN"]
SampleDistributionStack(
app,
"SampleImageDevelopment",
env=env,
groups={"Developer": [Grant.READ_IMAGES, Grant.WRITE_IMAGES, Grant.READ_METADATA]},
github={
"provider": github_provider,
"repo": "rr-tom-noble/aws-ecr-test",
"branch": "Development",
"grants": [Grant.READ_IMAGES, Grant.WRITE_IMAGES],
},
)
SampleDistributionStack(
app,
"SampleImageMaster",
env=env,
groups={"Developer": [Grant.READ_IMAGES, Grant.READ_METADATA]},
github={
"provider": github_provider,
"repo": "rr-tom-noble/aws-ecr-test",
"environment": "Master",
"grants": [Grant.WRITE_IMAGES, Grant.WRITE_IMAGES],
},
)
SampleDistributionStack(
app,
"SampleImageRelease",
env=env,
groups={
"Developer": [Grant.READ_IMAGES, Grant.READ_METADATA],
"EndUser": [Grant.READ_IMAGES],
},
github={
"provider": github_provider,
"repo": "rr-tom-noble/aws-ecr-test",
"environment": "Release",
"grants": [Grant.WRITE_IMAGES],
},
)
app.synth()