docs(aws): fix STS job exit code handling

What does this MR do and why?

This fixes incorrect exit code handling of an example STS job in the AWS integration documentation. The bug was that the job always succeeded, no matter what the AWS CLI exit code was.

How to set up and validate locally

Demonstrating the bug, having the aws sts command replaced with false to force a failed result:

$ export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" $(false))
$ echo $?
0

The exit code should be non-zero in this failure example.

Demonstrating that this change fixes the issue:

$ aws_sts_output=$(false)
$ echo $?
1

Demonstrating that the happy flow still works, having the aws sts command replaced with a command that outputs test credentials:

$ aws_sts_output=$(echo "TEST_KEY_ID TEST_KEY TEST_TOKEN")
$ export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" $aws_sts_output)
$ env | grep ^AWS_
AWS_SECRET_ACCESS_KEY=TEST_KEY
AWS_ACCESS_KEY_ID=TEST_KEY_ID
AWS_SESSION_TOKEN=TEST_TOKEN
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading