Skip to content

Commit

Permalink
remove file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ford-at-aws committed Jan 20, 2025
1 parent f6aace9 commit cc6e299
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 39 deletions.
37 changes: 8 additions & 29 deletions .tools/test/stacks/images/typescript/image_stack.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import "source-map-support/register";
import * as cdk from 'aws-cdk-lib';
import {
Stack,
StackProps,
aws_ecr as ecr,
aws_iam as iam,
RemovalPolicy
} from "aws-cdk-lib";
import * as cdk from "aws-cdk-lib";
import { Stack, StackProps, aws_ecr as ecr, RemovalPolicy } from "aws-cdk-lib";
import { type Construct } from "constructs";
import { readAccountConfig } from "../../config/targets";
import { readAccountConfig } from "./../../config/types";

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

for (const language of Object.keys(acctConfig)) {
if (acctConfig[language].status === "enabled") {
const repository = new ecr.Repository(this, `${language}-examples`, {
new ecr.Repository(this, `${language}-examples`, {
repositoryName: `${language}`,
imageScanOnPush: true,
removalPolicy: RemovalPolicy.RETAIN,
});

// Add repository policy to allow access from the specified account
repository.addToResourcePolicy(new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
principals: [
new iam.AccountPrincipal(acctConfig[language].account_id)
],
actions: [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability",
"ecr:PutImage",
"ecr:InitiateLayerUpload",
"ecr:UploadLayerPart",
"ecr:CompleteLayerUpload"
]
}));
}
}
}
Expand All @@ -52,7 +32,6 @@ new ImageStack(app, "ImageStack", {
account: process.env.CDK_DEFAULT_ACCOUNT!,
region: process.env.CDK_DEFAULT_REGION!,
},
terminationProtection: true
});

app.synth();
app.synth();
15 changes: 5 additions & 10 deletions .tools/test/stacks/images/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc6e299

Please sign in to comment.