Skip to content

Commit cc6e299

Browse files
committed
remove file changes
1 parent f6aace9 commit cc6e299

File tree

2 files changed

+13
-39
lines changed

2 files changed

+13
-39
lines changed
Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
import "source-map-support/register";
2-
import * as cdk from 'aws-cdk-lib';
3-
import {
4-
Stack,
5-
StackProps,
6-
aws_ecr as ecr,
7-
aws_iam as iam,
8-
RemovalPolicy
9-
} from "aws-cdk-lib";
5+
import * as cdk from "aws-cdk-lib";
6+
import { Stack, StackProps, aws_ecr as ecr, RemovalPolicy } from "aws-cdk-lib";
107
import { type Construct } from "constructs";
11-
import { readAccountConfig } from "../../config/targets";
8+
import { readAccountConfig } from "./../../config/types";
129

1310
class ImageStack extends Stack {
1411
constructor(scope: Construct, id: string, props?: StackProps) {
@@ -18,28 +15,11 @@ class ImageStack extends Stack {
1815

1916
for (const language of Object.keys(acctConfig)) {
2017
if (acctConfig[language].status === "enabled") {
21-
const repository = new ecr.Repository(this, `${language}-examples`, {
18+
new ecr.Repository(this, `${language}-examples`, {
2219
repositoryName: `${language}`,
2320
imageScanOnPush: true,
2421
removalPolicy: RemovalPolicy.RETAIN,
2522
});
26-
27-
// Add repository policy to allow access from the specified account
28-
repository.addToResourcePolicy(new iam.PolicyStatement({
29-
effect: iam.Effect.ALLOW,
30-
principals: [
31-
new iam.AccountPrincipal(acctConfig[language].account_id)
32-
],
33-
actions: [
34-
"ecr:GetDownloadUrlForLayer",
35-
"ecr:BatchGetImage",
36-
"ecr:BatchCheckLayerAvailability",
37-
"ecr:PutImage",
38-
"ecr:InitiateLayerUpload",
39-
"ecr:UploadLayerPart",
40-
"ecr:CompleteLayerUpload"
41-
]
42-
}));
4323
}
4424
}
4525
}
@@ -52,7 +32,6 @@ new ImageStack(app, "ImageStack", {
5232
account: process.env.CDK_DEFAULT_ACCOUNT!,
5333
region: process.env.CDK_DEFAULT_REGION!,
5434
},
55-
terminationProtection: true
5635
});
5736

58-
app.synth();
37+
app.synth();

.tools/test/stacks/images/typescript/package-lock.json

Lines changed: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)