From a269f833bc3db287b57a63fb1f925b320ad22004 Mon Sep 17 00:00:00 2001 From: Ammar Qaffaf Date: Tue, 8 Jul 2025 12:44:10 +0300 Subject: [PATCH] Updates ECR repository handling to import existing repo --- infrastructure/stack.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/infrastructure/stack.ts b/infrastructure/stack.ts index ee9fa27..4f8c6a2 100644 --- a/infrastructure/stack.ts +++ b/infrastructure/stack.ts @@ -117,12 +117,8 @@ export class BackendStack extends cdk.Stack { removalPolicy: cdk.RemovalPolicy.DESTROY, }); - // ECR Repository for Docker images - ensure it's in the correct region - const ecrRepository = new ecr.Repository(this, 'SyncrowBackendRepo', { - repositoryName: 'syncrow-backend', - removalPolicy: cdk.RemovalPolicy.DESTROY, - emptyOnDelete: true, - }); + // ECR Repository for Docker images - import existing repository + const ecrRepository = ecr.Repository.fromRepositoryName(this, 'SyncrowBackendRepo', 'syncrow-backend'); // Output the correct ECR URI for this region new cdk.CfnOutput(this, 'EcrRepositoryUriRegional', {