From b242de2d3971c26e84763bae139327ad69369845 Mon Sep 17 00:00:00 2001 From: JustFiesta Date: Tue, 21 May 2024 13:35:13 +0200 Subject: [PATCH] Fixup: ECR does not have the --tag-specifications. Used ecr tag-resource instead --- prepare_aws_enviroment.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prepare_aws_enviroment.sh b/prepare_aws_enviroment.sh index 5e7b89d14..572dba9ea 100644 --- a/prepare_aws_enviroment.sh +++ b/prepare_aws_enviroment.sh @@ -69,7 +69,6 @@ echo "Creating Elastic Container Registry (ECR)..." ECR_REPO_JSON=$(aws ecr create-repository \ --repository-name "$ECR_NAME" \ --region "$REGION" \ - --tag-specifications 'ResourceType=repository,Tags=[{Key=Name,Value='"$VPC_NAME"'},{Key=Owner,Value='"$OWNER"'},{Key=Project,Value='"$PROJECT"'}]' \ --query 'repository' \ --output json) ECR_REPO_URI=$(echo "$ECR_REPO_JSON" | jq -r '.repositoryUri') @@ -81,6 +80,11 @@ if [ -z "$ECR_REPO_URI" ] || [ -z "$ECR_REPO_ARN" ]; then fi echo "ECR repository created: $ECR_REPO_URI" +# Adding tags to the ECR repository +aws ecr tag-resource \ + --resource-arn "$ECR_REPO_ARN" \ + --tags Key=Name,Value="$ECR_NAME" Key=Owner,Value="$OWNER" Key=Project,Value="$PROJECT" + echo "Tags added to ECR repository."