aws-assume-role icon indicating copy to clipboard operation
aws-assume-role copied to clipboard

Adding new profile does not preserve indentation of existing options

Open alanivey opened this issue 7 years ago • 0 comments

After adding a new profile, I was getting 'str' object has no attribute 'get' errors with all of my aws s3 and aws s3api commands. It turns out that aws-assume-role was not preserving indentation of existing options in $HOME/.aws/config:

Before:

$ head -5 ~/.aws/config
[default]
output = json
region = us-east-1
s3 =
  signature_version = s3v4

Add a new profile:

aws-assume-role \
  configure \
  role \
  -p newname \
  --source-profile sourceprofilename \
  --role-arn arn:aws:iam::123456789012:role/AnOrgRole \
  --role-session-name=heresaname \
  --mfa-serial automatic

After:

$ head -5 ~/.aws/config
[default]
output = json
region = us-east-1
s3 =
signature_version = s3v4

alanivey avatar Dec 21 '17 16:12 alanivey