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
I noticed this when importing an existing influx database that had the default retention policy defined.
This behavior makes sense in the case when we want to create a database and have the default retention policy automatically created (and not tracked in terraform), but it causes issues when we want to modify that default retention policy down the road.
Perhaps we can add a boolean parameter to this method (ie ignoreDefaultRetentionPolicy), and set this to false when we detect a desired retention policy that has default = true and name = "autogen". I believe that would fix the issue and not cause breaking changes.
Workaround
It seems like currently, the only workaround is to manually modify the retention policy, such that the DeepEqual call fails. Modifying the retention or replication seems most viable.
Example workaround:
ALTER RETENTION POLICY autogen ON "database-name" REPLICATION 2
The text was updated successfully, but these errors were encountered:
After the default retention policy on a
influxdb_database
is created, it cannot be managed using this provider.Terraform Version
Though this issue applies to any version of terraform and all versions of this provider so far.
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Create a database:
Modify the retention policy, in this case updating the duration
Expected Behavior
The existing retention policy should be updated to reflect the desired changes.
Actual Behavior
The DB retention policy is not modified, and there is perpetual drift after applies.
Steps to Reproduce
terraform apply
with the "Create a database" HCL aboveterraform apply
with the "Modify the retention policy" HCL aboveNotes
I believe this issue is caused by the provider explicitly ignoring the default retention policy in the
readRetentionPolicies
method:terraform-provider-influxdb/influxdb/resource_database.go
Lines 208 to 210 in dd7445d
I noticed this when importing an existing influx database that had the default retention policy defined.
This behavior makes sense in the case when we want to create a database and have the default retention policy automatically created (and not tracked in terraform), but it causes issues when we want to modify that default retention policy down the road.
Perhaps we can add a boolean parameter to this method (ie
ignoreDefaultRetentionPolicy
), and set this tofalse
when we detect a desired retention policy that hasdefault = true
andname = "autogen"
. I believe that would fix the issue and not cause breaking changes.Workaround
It seems like currently, the only workaround is to manually modify the retention policy, such that the
DeepEqual
call fails. Modifying theretention
orreplication
seems most viable.Example workaround:
The text was updated successfully, but these errors were encountered: