Are there is any ways to generate sdk client from ...
# general
d
Are there is any ways to generate sdk client from aws provider?
l
Do you mean the AWS SDK client? There's a wrapper for it, but it doesn't "create" the client. Onesec I'll find it.
It's just
aws.sdk
. Used thus:
Copy code
import * as aws from "@pulumi/aws";
const ec2Client = new aws.sdk.EC2();
d
Oh nice. Thanks a lot.
Follow up. question. I was thinking to use sdk directly to pull data from AWS SSM. I have background mechanism on ec2 that eventually setting the state of the SSM params. Are there is anything better? Is it save to run while loop in the component?
l
Not sure I understand. You want to populate SSM parameters from values that become available after deployment completes? This isn't possible within a single Pulumi project. You could do it via automation-api or simply running
up
on two projects in sequence, but I wouldn't recommend it. It is best to think of Pulumi as a resource creation / maintenance tool. Using the created resources is not within Pulumi's domain.
d
yea I understand it.
Follow up then. Can I extract credentials from pulumi aws provider?
l
No. Providers are intended to be black boxes. Ideally you shouldn't ever need the credentials again, after creating the providers. But if you do need them, then you'll have to store them yourself, or load them again from env or profiles.