gatsby-uc / gatsby-plugin-s3

Deploy your gatsby site to a S3 bucket.
https://gatsby-plugin-s3.jari.io/
MIT License
210 stars 110 forks source link

Add support to assume an AWS role during deployment #93

Open Nessworthy opened 5 years ago

Nessworthy commented 5 years ago

Due to aws/aws-sdk-js#1916, AWS profiles from a shared ini configuration can't be used when the profile uses a credential source (in my case, from EC2InstanceMetadata). In my case, I have an instance in account A which handles the gatsby deployment pipline, with an instance role that allows it to assume a role in account B, where the deployment bucket lives.

I've worked around this for now by granting cross-account write access to the bucket using its bucket policy, but it would be much nicer if support could be added to assume a role based on the current AWS profile in use, by passing a role ARN in config.

If I have time, I might be able to draw up a PR for this.

(Alternatively, if there's a way to manually configure / supply the AWS configuration / object from userland, that would also be cool)

YoshiWalsh commented 5 years ago

A PR for this would be welcome. I don't think any of the project maintainers here have enough bandwidth to work on this at the moment.