aminueza / terraform-provider-minio

Terraform provider for managing MinIO S3 buckets and IAM Users.
https://registry.terraform.io/providers/aminueza/minio
GNU Affero General Public License v3.0
233 stars 69 forks source link

[FATAL] putting object failed (): one of source / content / content_base64 is not set #552

Closed 53845714nF closed 5 months ago

53845714nF commented 9 months ago

Description

I get this error even though I have source in my minio_s3_object.

Steps to Reproduce

Part of my TF File:

resource "minio_s3_object" "vite_app_index_html" {
  depends_on   = [null_resource.vite_app_build]
  bucket_name  = minio_s3_bucket.vite_app_bucket.bucket
  object_name  = "index.html"
  source       = "dist/index.html"
  content_type = "text/html"
}

resource "minio_s3_object" "vite_app_js" {
  depends_on = [null_resource.vite_app_build]
  bucket_name = minio_s3_bucket.vite_app_bucket.bucket
  object_name = "assets/main.js"
  source = "dist/assets/index-*.js"
  content_type = "application/javascript"
}

resource "minio_s3_object" "vite_app_css" {
  depends_on = [ null_resource.vite_app_build]
  bucket_name = minio_s3_bucket.vite_app_bucket.bucket
  object_name    = "assets/main.css"
  source = "dist/assets/index-*.css"
  content_type = "text/css"
}

Run: terraform apply

Then i get this Errors:

 Error: [FATAL] putting object failed (): one of source / content / content_base64 is not set
│ 
│   with minio_s3_object.vite_app_index_html,
│   on main.tf line 38, in resource "minio_s3_object" "vite_app_index_html":
│   38: resource "minio_s3_object" "vite_app_index_html" {
│ 
╵
╷
│ Error: [FATAL] putting object failed (): one of source / content / content_base64 is not set
│ 
│   with minio_s3_object.vite_app_js,
│   on main.tf line 46, in resource "minio_s3_object" "vite_app_js":
│   46: resource "minio_s3_object" "vite_app_js" {
│ 
╵
╷
│ Error: [FATAL] putting object failed (): one of source / content / content_base64 is not set
│ 
│   with minio_s3_object.vite_app_css,
│   on main.tf line 54, in resource "minio_s3_object" "vite_app_css":
│   54: resource "minio_s3_object" "vite_app_css" {

Expected behavior: No Error, because source is set.

Actual behavior: Get Error.

Reproduces how often: Always

Versions

terraform -v  
Terraform v1.6.5
on linux_amd64
+ provider registry.terraform.io/aminueza/minio v2.0.1
+ provider registry.terraform.io/hashicorp/null v3.2.2

Additional Information

I build a Vite app locally beforehand. The css and js files have random names. Can understand that he could not find them in the local filesystem. But it should actually find the index.html.