https://pulumi.com logo
#general
Title
# general
m

modern-hospital-96939

03/14/2024, 6:50 PM
Hey guys, We made a framework to define super simple JSON config files and deploy your serverless app. Right now, I'm using AWS Cloud Formation, but we want to migrate to Pulumi. My question is if Pulumi has a TS API for controlling the CLI functionality, like deploy, destroy, and diff. If anyone can send me in the right direction it would be super helpful.
m

miniature-musician-31262

03/14/2024, 9:55 PM
m

modern-hospital-96939

03/15/2024, 7:22 AM
That is amazing. Thanks for info.
I'm trying to deploy a dynamodb table from an InlineProgram with an s3 backend. But I get the following error:
Copy code
error: read ".pulumi/meta.yaml": blob (key ".pulumi/meta.yaml") (code=Unknown): MissingEndpoint: 'Endpoint' configuration is required for this service
Any idea why this is happening ?
m

miniature-musician-31262

03/15/2024, 9:03 PM
Shot in the dark, but are you sure you're configuring the
aws:region
properly?
I think I've seen this error when the region isn't being set
m

modern-hospital-96939

03/16/2024, 10:37 AM
This is what i tried
I think the region is set correctly
m

miniature-musician-31262

03/16/2024, 2:40 PM
Yeah, that looks mostly right -- although I don't think you need that
installPlugin
line anymore (guessing you just got started with a slightly older example). I'm not able to repro with your code even when I force using that older plugin, though. What's in your
.pulumi/meta.yaml
? The error suggests something's wrong there. For reference, mine's just this:
m

modern-hospital-96939

03/17/2024, 12:01 PM
I don't have a .pulumi folder.
I guess it didn't generate any config files.
m

miniature-musician-31262

03/17/2024, 10:04 PM
I just hit this issue myself -- I wonder if the problem is that you don't have access to the bucket you're trying to use as a backend: https://github.com/pulumi/pulumi/issues/15141
Yeah, I'll bet that's it. I can repro this both with a bucket that doesn't exist and with a bucket that does exist, but that I don't have credentials to access. Make sure
aws s3 ls <s3://pulumi-test-aws>
(or whatever the actual name of your bucket is) works, to validate that the bucket exists and that your credentials are set, then try running your program again. Let me know if that helps!
m

modern-hospital-96939

03/18/2024, 8:07 AM
Thats probably it because i didn't specify the aws profile that needs to be used to generate the credentials
Copy code
await stack.setConfig('aws:profile', { value: 'MY_PROFILE' })
My bucket should be available with my personal profile. Should this work?
m

miniature-musician-31262

03/18/2024, 12:43 PM
I suspect so. Did you try it?
m

modern-hospital-96939

03/18/2024, 1:03 PM
ye it didnt work XD
same error
m

miniature-musician-31262

03/18/2024, 1:42 PM
Does the bucket exist?
Does the
aws s3 ls <s3://your-bucket-name>
command I mentioned earlier work?
If that command works but the Pulumi program fails, in the same shell, then we’ll need to look at your actual code and environment, as this all works for me locally, with your code, minus the bucket name.
m

modern-hospital-96939

03/19/2024, 8:40 AM
i'll try again when i have more time.
But i just realized something.
Is it possible to opt out of the automatic stack adding.
I want to be able to define what resource is added to what stack like so:
Copy code
stack.add(resource)
stack2.add(resource2)