thomasmichaelwallace / serverless-better-credentials

Better AWS credentials resolution plugin for serverless
MIT License
54 stars 9 forks source link

feat: support Role profile with SSO profile as a source profile #10

Closed MarcinKasprowicz closed 12 months ago

MarcinKasprowicz commented 1 year ago

Solution for https://github.com/thomasmichaelwallace/serverless-better-credentials/issues/9

# ~/.aws/config file

[profile payment-suite-pro]
sso_start_url = https://xxx.awsapps.com/start
sso_region = eu-north-1
sso_account_id = 99999999999
sso_role_name = FullAccess

[profile spt-payment-dev]
role_arn = arn:aws:iam::111111111:role/AssumableAdmin
source_profile = payment-suite-pro
➜ export AWS_PROFILE="spt-payment-dev"
➜ npx sls info

> liberate-lambda@1.0.0 deploy:info:order-service /Users/marcin.kasprowicz@schibsted.com/dev/schibsted/payments/liberate-lambda
> sls info

[serverless-better-credentials]

Attempting to automatically open the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:

https://device.sso.eu-north-1.amazonaws.com/

Then enter the code:

XVRL-XMWP

✔ serverless-better-credentials: credentials resolved from config sso profile: AWS_PROFILE (spt-payment-dev)

service: liberate-lambda
stage: dev
region: eu-west-1
stack: liberate-data-order-service
functions:
  liberateData: liberate-data-order-service
thomasmichaelwallace commented 12 months ago

Mostly my fault, but this PR is now quite far behind main, so I'm going to close it. Feel free to discuss in issues though.