Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of existing S3 bucket fails #564

Open
steschuser opened this issue May 28, 2024 · 2 comments
Open

Import of existing S3 bucket fails #564

steschuser opened this issue May 28, 2024 · 2 comments

Comments

@steschuser
Copy link

Description

Trying to import an existing bucket fails

Steps to Reproduce

  1. create a bucket outside of terraform
> mc mb juice/foo
Bucket created successfully `juice/foo`.
  1. generate minimal terraform config
# Import Test
resource "minio_s3_bucket" "foo" {
}
  1. try to import
> terraform import minio_s3_bucket.foo foo
minio_s3_bucket.foo: Importing from ID "foo"...
╷
│ Error: error importing Minio S3 bucket policy: The specified bucket does not exist.
│

Expected behavior:
a successfull import :)

Actual behavior:
Throws "bucket does not exist"

Reproduces how often: 100%

Versions

Terraform v1.8.4
on linux_amd64

  • provider registry.terraform.io/aminueza/minio v2.2.1

MinIO VERSION
2024-04-18T19:09:19Z

@steschuser
Copy link
Author

any love?

@lorenzofelletti
Copy link
Contributor

I tried to reproduce your issue on my setup and didn't have any issue.

My code:

resource "minio_s3_bucket" "test" {
  bucket = "test"
}

Command I run: terraform import -var-file="dev.tfvars" 'minio_s3_bucket.test' 'test' (quoting is important when running terraform imports to avoid unexpected behaviour)

Also, your error seems to refer to a S3 bucket policy, not a bucket:
│ Error: error importing Minio S3 bucket policy: The specified bucket does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants