pulumi-aws
pulumi-aws copied to clipboard
Pulumi adds s3/bucket without import when bucket already exists in us-east-1
What happened?
This was fixed in terraform but does not seem to work in pulumi https://github.com/hashicorp/terraform-provider-aws/issues/13587
Due to legacy backwards compatibility, AWS returns a 200 when creating a bucket that you already own in us-east-1 (see "BucketAlreadyOwnedByYou"). Pulumi thinks that it's state file owns this bucket without ever having ran an import, resulting in multiple stacks controlling the same bucket.
Example
Create a stack with a bucket
new aws.s3.Bucket(`randomBucketA`, {
bucket: `some-random-bucket-name`,
})
then create another stack and create the same bucket. Instead of an error, the bucket will be tracked in both stacks
Output of pulumi about
CLI Version 3.80.0 Go Version go1.21.0 Go Compiler gc
Plugins NAME VERSION aws 5.42.0 aws 5.42.0 datadog 4.22.0 nodejs unknown
Host OS darwin Version 12.6.8 Arch arm64
This project is written in nodejs: executable='/Users/.asdf/shims/node' version='v18.12.1'
Backend Name pulumi.com User tscully
Dependencies: NAME VERSION @pulumi/aws 5.42.0 @pulumi/datadog 4.22.0 @pulumi/pulumi 3.83.0 eslint 8.49.0
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).