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

broad-church-78931

02/06/2020, 5:28 AM
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

white-balloon-205

02/06/2020, 5:33 AM
b

broad-church-78931

02/06/2020, 6:07 AM
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

colossal-ram-89482

02/06/2020, 11:14 AM
Did you try passing the alternate provider via the `Bucket`’s
opts
parameter?
m

many-garden-84306

02/06/2020, 5:49 PM
You aren’t using the new provider you created in the first step
b

broad-church-78931

02/06/2020, 9:09 PM
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

white-balloon-205

02/06/2020, 9:16 PM
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

broad-church-78931

02/07/2020, 12:22 PM
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...
9 Views