-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporarily remove all steps from Dockerfile to speed up ECR debugging
- Loading branch information
1 parent
8f54f8e
commit 7826a4f
Showing
4 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
import type { GuStackProps} from "@guardian/cdk/lib/constructs/core"; | ||
import {GuStack} from "@guardian/cdk/lib/constructs/core"; | ||
import type {GuStackProps} from "@guardian/cdk/lib/constructs/core"; | ||
import {GuStack, GuStringParameter} from "@guardian/cdk/lib/constructs/core"; | ||
import type {App} from "aws-cdk-lib"; | ||
import { RemovalPolicy} from "aws-cdk-lib"; | ||
import {RemovalPolicy} from "aws-cdk-lib"; | ||
import {Repository, TagMutability} from "aws-cdk-lib/aws-ecr"; | ||
import {ArnPrincipal, Effect, PolicyStatement} from "aws-cdk-lib/aws-iam"; | ||
|
||
export class TranscriptionServiceRepository extends GuStack { | ||
constructor(scope: App, id: string, props: GuStackProps) { | ||
super(scope, id, props); | ||
new Repository(this, "TranscriptionServiceRepository", { | ||
const githubActionsIAMRoleArn = new GuStringParameter(this, "GithubActionsIAMRoleArn", { | ||
description: "IAM role for role used by github actions workflows" | ||
}) | ||
const repository = new Repository(this, "TranscriptionServiceRepository", { | ||
repositoryName: `transcription-service`, | ||
lifecycleRules: [{ | ||
maxImageCount: 5 | ||
}], | ||
imageTagMutability: TagMutability.IMMUTABLE, | ||
removalPolicy: RemovalPolicy.DESTROY, | ||
imageScanOnPush: true | ||
imageScanOnPush: true, | ||
}) | ||
repository.addToResourcePolicy(new PolicyStatement({ | ||
principals: [new ArnPrincipal(githubActionsIAMRoleArn.valueAsString)], | ||
actions: [ | ||
"ecr:GetAuthorizationToken", | ||
"ecr:BatchCheckLayerAvailability", | ||
"ecr:GetDownloadUrlForLayer", | ||
"ecr:GetRepositoryPolicy", | ||
"ecr:DescribeRepositories", | ||
"ecr:ListImages", | ||
"ecr:DescribeImages", | ||
"ecr:BatchGetImage", | ||
"ecr:InitiateLayerUpload", | ||
"ecr:UploadLayerPart", | ||
"ecr:CompleteLayerUpload", | ||
"ecr:PutImage" | ||
], | ||
effect: Effect.ALLOW | ||
})) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters