https://pulumi.com logo
Title
d

dry-potato-52542

09/07/2022, 9:18 PM
Are there is any ways to generate sdk client from aws provider?
l

little-cartoon-10569

09/07/2022, 9:22 PM
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:
import * as aws from "@pulumi/aws";
const ec2Client = new aws.sdk.EC2();
d

dry-potato-52542

09/07/2022, 9:27 PM
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

little-cartoon-10569

09/07/2022, 9:34 PM
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

dry-potato-52542

09/08/2022, 3:29 PM
yea I understand it.
Follow up then. Can I extract credentials from pulumi aws provider?
l

little-cartoon-10569

09/08/2022, 9:07 PM
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.