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

early-musician-41645

11/30/2018, 12:24 AM
How can I manage AWS resources in a different region than one set in the config? I tried to get an existing S3 bucket like this:
Copy code
const bucket = aws.s3.Bucket.get('prod-us-west-1',
    'sdp-tsm-prod-uw1-artifacts',
    { region: 'us-west-1' });
But the configured provider is in us-west-2, hence:
Copy code
Diagnostics:
  aws:s3:Bucket (prod-us-west-1):
    error: Preview failed: refreshing urn:pulumi:s3-object-indexer-dev::s3-object-indexer::aws:s3/bucket:Bucket::prod-us-west-1: error reading S3 Bucket (sdp-tsm-prod-uw1-artifacts): BucketRegionError: incorrect region, the bucket is not in 'us-west-2' region
        status code: 301, request id: , host id:
I tried to create a new regional provider but couldn't figure out how to plug it in:
Copy code
let uw1Provider = new aws.Provider("us-west-1-aws-provider", { region: 'us-west-1' });
17 Views