From 090a058e8dfaea8a5909eec49a43e1baf5b6e674 Mon Sep 17 00:00:00 2001 From: Sathiyakumar Ganesan Date: Wed, 24 Jun 2026 09:30:45 +0100 Subject: [PATCH] Add conditional check for AWS role ARN format in assume role step --- azure/components/aws-assume-role.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure/components/aws-assume-role.yml b/azure/components/aws-assume-role.yml index e80e678..0bb3e34 100644 --- a/azure/components/aws-assume-role.yml +++ b/azure/components/aws-assume-role.yml @@ -37,7 +37,9 @@ steps: if [[ "$AWS_ACCOUNT" =~ ^(prod|dev)$ ]]; then echo "account is $AWS_ACCOUNT" account_id="$(aws ssm get-parameter --name /account-ids/$AWS_ACCOUNT --query Parameter.Value --output text)" - aws_role="arn:aws:iam::${account_id}:role/${aws_role}" + if [[ "${aws_role}" != arn:aws:iam:* ]]; then + aws_role="arn:aws:iam::${account_id}:role/${aws_role}" + fi fi if [[ "${aws_role}" != arn:aws:iam:* ]]; then