-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose provider credentials to the pulumi program #4821
Comments
Thanks for the suggestion @1oglop1 I think it is an excellent idea. I think it should be in principle possible - the explicit Pulumi provider object could expose a secreted credentials output (or promise), that could then be used in the program to configure the AWS SDK client and continue doing what needs to be done. It sounds like promise would be more convenient, but having an Output would allow continuing to mark the credentials as secret. Another security consideration here is that temporary auto-expiring credentials may be exposed, so that helps in case they do leak somewhere. It is good to think of security here but at a glance it does not appear to be something that needs to block the feature, appropriate documentation can explain to users how to utilize this responsibly. I will get this discussed in our team, in the meanwhile if anyone is seeing this, up-voting the issue helps prioritizing. |
Hey @1oglop1, great idea! I'm curious to learn more about your expected use cases. I can also see this improving usability when using the pulumi-command provider to shell out to the AWS CLI. In certain scenarios, the AWS SDKs transparently fetch credentials. E.g. if you configure I could envision this to look like this: const assumeRoleParams = {
roleArn,
sessionName: "PulumiSession",
externalId: "PulumiApplication",
}
// credentials for the "other account" to use with command provider or dynamic providers
const credsOtherAccount = aws.sts.assumeRoleOutput(assumeRoleParams);
// provider for the "other account" to use with pulumi.aws resources
const providerOtherAccount = new aws.Provider("otherAccount", {
assumeRole: assumeRoleParams,
region: region ?? aws.config.requireRegion(),
skipCredentialsValidation: true,
},
opts
); |
Hello,
I want to discuss if this is possible or if there are any security implications.
Here is my use case:
The problem description
My code needs to follow the same "path" as pulumi providers do and then I have to do the double/tripple work perform the same steps.
Eg.
Say I want to create a dynamic resource calling AWS but in another account that is assumed by role or a different region.
Then in pulumi I can do this.
But then with AWS SDK I have to do multiple steps
Then the code looks something like this for 2 step "hop"
As you can see AWS SDK exposes
credentials
object making it possible to pass it around. So I do not see any problem if pulumi provider could do the same thing.This would unlock workflows with dynamic providers and other integrations.
then inside the code for the dynamic provider could look like:
The text was updated successfully, but these errors were encountered: