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

acceptable-army-69872

10/02/2019, 5:48 PM
I'm trying to do an import on an s3 bucket, and it wants to change the name of the resource, which causes a warning.
Copy code
aws:s3:Bucket (bucketName):
  warning: inputs to import do not match the existing resource; importing this resource will fail

This is the change: 
~ bucket: "bucketName" => "bucketName-8c54a03"
code
Copy code
const config = new pulumi.Config();
const sb: string = config.require("sourceBucket")

const sourceBucket = new aws.s3.Bucket(sb,
                                      {},
                                      { import: sb });
b

broad-dog-22463

10/02/2019, 5:49 PM
You need to overrive the bucket name
Copy code
const sourceBucket = new aws.s3.Bucket(sb,
                                      {
bucket: "bucketName-8c54a03"},
                                      { import: sb });
By default, pulumi appends a random string to resources
a

acceptable-army-69872

10/02/2019, 5:49 PM
That was incredibly fast. Thank you!
b

broad-dog-22463

10/02/2019, 5:50 PM
👍
a

acceptable-army-69872

10/02/2019, 5:51 PM
I'm basically swiping this: https://github.com/pulumi/examples/tree/master/aws-ts-s3-lambda-copyzip which was super helpful.
so thanks to maria where ever she is for the easy to follow code.
b

broad-dog-22463

10/02/2019, 5:51 PM
I will pass it on 🙂