terraform-provider-minio
terraform-provider-minio copied to clipboard
[FATAL] unable to read policy: The canned policy does not exist
Prerequisites
- Be sure that theres no open issue already.
Description
We use terraform-provider-minio to provision MinIO policies using the minio_iam_policy
resource. Whenever the policy gets manually deleted on the MinIO server and another terraform apply
is issued, terraform-provider-minio fails with the error message:
❯ terraform plan
Acquiring state lock. This may take a few moments...
data.local_file.tenants: Reading...
minio_iam_policy.policy1: Refreshing state... [id=policy1]
minio_iam_policy.policy2: Refreshing state... [id=policy2]
minio_iam_policy.policy3: Refreshing state... [id=policy3]
minio_iam_policy.policy4: Refreshing state... [id=policy4]
data.local_file.tenants: Read complete after 0s [id=97d170e1550eee4afc0af065b78cda302a97674c]
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: [FATAL] unable to read policy (policy4): The canned policy does not exist. (Specified canned policy does not exist)
│
│ with minio_iam_policy.policy4,
│ on policies.tf line 11, in resource "minio_iam_policy" "policy4":
│ 11: resource "minio_iam_policy" "policy4" {
│
╵
Releasing state lock. This may take a few moments...
Steps to Reproduce
- Create a policy using the
minio_iam_policy
resource - Delete the created policy on the MinIO server
- Rerun a
terraform plan
orterraform apply
Expected behavior: terraform-provider-minio recreates the policy unless it wasn't deleted from the terraform definition as well
Actual behavior: terraform-provider-minio fails with the above described error message instead of recreating the policy
Reproduces how often: 100%
Versions
terraform-provider-minio v2.0.1
Additional Information
Let me know if you need any additional information.