S3 Replication Guide: don't include provider configuration in Terraform modules · Issue #738 · nitrictech/docs · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the bucket is deployed then later deleted from the stack the module is removed, which in turn removes the provider configuration. However, that provider configuration is needed to destroy the bucket, so the terraform plan or terraform apply fails with the error:
Error: Provider configuration not present
Why the provider information isn't persisted in the stack state and used for the deletion is unclear.
Then, given we use CDKTF, we'll need to include code changes in the guide, not just changes to the modules since the root module is essentially the Go code.
The text was updated successfully, but these errors were encountered:
Bug Report
Issue
https://nitric.io/docs/guides/terraform/s3-replicate includes instructions to add provider configuration in the existing S3 bucket module Nitric uses:
This provider configuration is needed to have Terraform deploy the replication bucket to a specific region.
Unfortunately, Terraform has a known limitation that means including provider configuration in modules is not recommended. https://support.hashicorp.com/hc/en-us/articles/1500000332721-Error-Provider-configuration-not-present?utm_source=chatgpt.com
If the bucket is deployed then later deleted from the stack the module is removed, which in turn removes the provider configuration. However, that provider configuration is needed to destroy the bucket, so the
terraform plan
orterraform apply
fails with the error:Error: Provider configuration not present
Why the provider information isn't persisted in the stack state and used for the deletion is unclear.
Steps
Steps to reproduce the behavior:
See https://discord.com/channels/955259353043173427/1366842570810068992 for steps and example code to replicate the issue.
Expected
Work around this limitation by including all provider configuration in the root module, then passing it down to other modules as needed.
Challenges
Given these limitations, region can't be passed into a bucket module as a variable. It must be done using providers.
Recommended patterns often include multiple module to work around these challenges/limitations, for example:
It may also be possible to use a single module, with multiple aliased providers (tbd):
In the module:
Then, given we use CDKTF, we'll need to include code changes in the guide, not just changes to the modules since the root module is essentially the Go code.
The text was updated successfully, but these errors were encountered: