I'm trying to import an existing bucket with: ```b...
# aws
g
I'm trying to import an existing bucket with:
Copy code
bucket_sse = aws.s3.Bucket.get(
    resource_name = "dev-file-storage-sse",
    id = "arn:aws:s3:::dev-file-storage-sse"
)
Pulumi complaining about the arn though:
Copy code
aws:s3:Bucket (dev-file-storage-sse):
    error: Preview failed: refreshing urn:pulumi:sandbox1::compute::aws:s3/bucket:Bucket::dev-file-storage-sse: 1 error occurred:
    	* error reading S3 Bucket (arn:aws:s3:::dev-file-storage-sse): InvalidARNError: invalid ARN
    caused by: invalid Amazon s3 ARN, unknown resource type, arn:aws:s3:::dev-file-storage-sse
The arn was copied from the console, so it's correct. Am I missing something obvious here? I can access the bucket without issues from the cli using the same user that pulumi is running with.
b
The ID in this case is just the bucket name. So your code should be
Copy code
bucket_sse = aws.s3.Bucket.get(
    resource_name = "dev-file-storage-sse",
    id = "dev-file-storage-sse"
)
g
Oh for * sake! I just assumed "id" meant arn without checking! Thanks!
b
🙂