aws-samples / iam-identity-center-team

Open-source temporary elevated access solution for AWS IAM Identity Center.
https://aws-samples.github.io/iam-identity-center-team/
MIT No Attribution
295 stars 67 forks source link

Region is not being added to a number of the aws cli commands causing issues #199

Closed reidca closed 4 months ago

reidca commented 6 months ago

Describe the bug The parameters.sh file accepts a region parameter however this parameter is not always used in all of the aws cli commands causing errors in various places.

Examples:

deployment /cognito.sh

amplifyAppId=`aws amplify list-apps --output json | jq -r '.apps[] | select(.name=="TEAM-IDC-APP") | .appId'`
amplifyDomain=`aws amplify list-apps --output json | jq -r '.apps[] | select(.name=="TEAM-IDC-APP") | .defaultDomain'`
...
amplifyCustomDomains=`aws amplify list-domain-associations --app-id $amplifyAppId --output json`

iam-identity-center-team/deployment /integration.sh

amplifyAppId=`aws amplify list-apps --output json | jq -r '.apps[] | select(.name=="TEAM-IDC-APP") | .appId'`
amplifyDomain=`aws amplify list-apps --output json | jq -r '.apps[] | select(.name=="TEAM-IDC-APP") | .defaultDomain'`
...
amplifyCustomDomains=`aws amplify list-domain-associations --app-id $amplifyAppId --output json`

This means that the cli will use the default region associated with the profile which is not always correct. The result is that the correct amplify app is not found. What makes this worse is the error is silent leading to a misconfiguration.

github-actions[bot] commented 4 months ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 7 days it will automatically be closed.

reidca commented 4 months ago

Before the issue is closed is anyone from the maintainers going to comment? @tawoyinfa ?

tawoyinfa commented 4 months ago

@rekejarikre can you help with this ?