diff options
Diffstat (limited to 'src/fluent-bit/tests/internal/data/aws_credentials/credential_process/aws-credential-process')
-rwxr-xr-x | src/fluent-bit/tests/internal/data/aws_credentials/credential_process/aws-credential-process | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fluent-bit/tests/internal/data/aws_credentials/credential_process/aws-credential-process b/src/fluent-bit/tests/internal/data/aws_credentials/credential_process/aws-credential-process new file mode 100755 index 000000000..45d906505 --- /dev/null +++ b/src/fluent-bit/tests/internal/data/aws_credentials/credential_process/aws-credential-process @@ -0,0 +1,14 @@ +#!/bin/sh + +printf '{"Version":1,"AccessKeyId":"%s","SecretAccessKey":"%s"' "${1}" "${_AWS_SECRET_ACCESS_KEY}" +if [ -n "${_AWS_SESSION_TOKEN}" ]; then + printf ',"SessionToken":"%s"' "${_AWS_SESSION_TOKEN}" +fi +if [ -n "${_AWS_EXPIRATION}" ]; then + printf ',"Expiration":"%s"' "$(/bin/date -d "${_AWS_EXPIRATION}" --utc '+%Y-%m-%dT%H:%M:%SZ')" +fi +printf '}' + +if [ -n "${_AWS_EXIT_CODE}" ]; then + exit "${_AWS_EXIT_CODE}" +fi |