This message was deleted.
# general
s
This message was deleted.
p
I'm very new to using Pulumi.. Tried working in my local Python interpreter but I keep running into an error telling me to use the Pulumi CLI.
I appreciate any help!
l
You're only importing
export
and
FileAsset
from pulumi. You need to import everything, or at least
ResourceOptions
.
😏 1
p
thank you, sir
that fixed it
👍 1
@little-cartoon-10569 - any chance I could get you to assist with one more thing?.. please.. For some reason Pulumi output is saying it's expecting an object and not a string. 😕
l
Where? Usually that sort of thing is related to using raw values instead of pulumi.input or pulumi.output..
p
it's the same code. The error is: Diagnostics: awss3Bucket (jon-pulumi-localstack-bucket): error: could not validate provider configuration: 1 error occurred: * endpoints.0: expected object, got string
I can send you the rest of the code if that helps? I'm wanting to overwrite the default S3 endpoint because I'm demoing testing a deploy of Pulumi against a LocalStack environment
creating an S3 bucket seemed to be a pretty "simple" test
l
I'm not familiar with the Python SDK. Where are the docs for the
Provider
class? It looks like you're passing in the wrong type for
endpoints
, but I don't know what the right type is.
Onesec I'll check the source on github.
l
That's a
ProviderResource
? The object you're instantiating is a
Provider
?
p
Yeah, I am instantiating
Provider
.
ProviderResource
seemed like the right thing but I'm probably way off
l
Yep found it. In TypeScript and in the Python examples I've created, I haven't needed to specify a Provider: it's created for me by Pulumi. You probably don't need to create one unless you're working in two clouds or two regions at the same time. But if you do need a manually-instantiated Provider, then the endpoints parameter is described in the code you linked. It needs to be a pulumi.input, not a string.
Most of the time, you don't need to use a generic ProviderResource or a Provider. You can use the resource classes provided by the SDK (e.g. pulumi.aws.Bucket), and the provider created by Pulumi from your AWS_PROFILE or other AWS credentials.
p
gotcha.. hmm okay.. So I was doing:
Copy code
pulumi config set aws:region us-east-1
and same for my access key and secret key id
are you saying that I would need to do the same but for the endpoints? So..
Copy code
pulumi config set aws:endpoints <http://localhost:4566>
I can create a new AWS profile in my credentials file if I need to, I just want to make sure I don't deploy to one of my actual environments.. I could make a backup of my AWS credentials file then just wipe everything from it. That's fine since this is just for a demo