How can I make Pulumi use a custom AWS endpoint's ...
# general
b
How can I make Pulumi use a custom AWS endpoint's with Python? This does not seem to work:
Copy code
from pulumi_aws import provider, s3

aws = provider.Provider("aws", endpoints={"S3": "<http://localstack:4572>"})

web_bucket = s3.Bucket('s3-website-bucket', website={
    "index_document": "index.html",
})
w
b
Ok, that is probably one error but it did not fix my issue. It still seems to connect AWS because I receive 403 error regardless what endpoint I set.
c
Did you try passing the alternate provider via the `Bucket`’s
opts
parameter?
m
You aren’t using the new provider you created in the first step
b
Yes, you're probably right, the documentation is not extensive how to do it so I am asking if you know how to do it, or I need to dig in the code chain to look it up how it suppose to be done.
w
See https://www.pulumi.com/docs/intro/concepts/programming-model/#provider.
Copy code
provider = Provider("provider", region="us-west-2")
vpc = ec2.Vpc("vpc", opts=ResourceOptions(provider=provider))
b
Ok, got to this point:
Copy code
import pulumi
import pulumi_aws as aws

localstack_provider = aws.Provider("localstack",
                          region="eu-central-1",
                          endpoints=[{"s3": "<http://localstack:4572>"}])


web_bucket = aws.s3.Bucket('s3-website-bucket',
                            opts=pulumi.ResourceOptions(provider=localstack_provider),
                            website={"index_document": "index.html"})
However something gets ignored...