mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-03 16:38:35 +08:00
We were escaping the command arguments with double quotes. It works with bash4.3+. However, AWS CloudShell has bash 4.2 which: > > zz. When using the pattern substitution word expansion, bash now runs the > replacement string through quote removal, since it allows quotes in that > string to act as escape characters. This is not backwards compatible, so > it can be disabled by setting the bash compatibility mode to 4.2. http://tiswww.case.edu/php/chet/bash/CHANGES When running this script in bash 4.2, the arguments end up being `"xyz"` instead of `xyz`. So, errors like this happen: ``` ERROR: operation error STS: GetCallerIdentity, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sts.\"us-east-1\".amazonaws.com/": dial tcp: lookup sts."us-east-1".amazonaws.com: no such host ``` Removing the quotes means it will work on older and newer bash versions: Demo: ``` > ./bin/teleport integration configure deployservice-iam --cluster=kimlisa.cloud.gravitational.io --name=r0mant --aws-region=us-east-1 --role=r0mant-oidc --task-role=Test+1=2,3.4@5-6_7 2023/07/07 08:04:05 TaskRole: Boundary Policy "Test+1=2,3.4@5-6_7Boundary" created. 2023/07/07 08:04:05 TaskRole: Role "Test+1=2,3.4@5-6_7" created with Boundary "arn:aws:iam::278576220453:policy/Test+1=2,3.4@5-6_7Boundary". 2023/07/07 08:04:05 TaskRole: IAM Policy "Test+1=2,3.4@5-6_7" added to Role "Test+1=2,3.4@5-6_7". 2023/07/07 08:04:05 IntegrationRole: IAM Policy "DeployService" added to Role "r0mant-oidc" ```