Skip to content

Commit

Permalink
fix(service): v3 to v4 migration cloud_name field (#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-savciuc authored Dec 27, 2023
1 parent ae3bd41 commit e24b69c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ nav_order: 1
- Add support for the `aiven_organization_user_group_member` resource, allowing the association of groups with the users. Please note that this resource is in the beta stage, and to use it, you would need to set the environment variable PROVIDER_AIVEN_ENABLE_BETA to a non-zero value.
- Retry kafka topic creation error `Cluster only has N broker(s), cannot set replication factor to M`
- Fix Kafka Topic migration issues from V3 to V4.
- Fix V3 to V4 migration issue related to cloud_name diff.

## [4.9.4] - 2023-12-13

Expand Down
8 changes: 8 additions & 0 deletions internal/schemautil/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ func ServiceCommonSchema() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
Description: "Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These are documented on each Cloud provider's own support articles, like [here for Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).",
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
// This is a workaround for a bug when migrating from V3 to V4 Aiven Provider.
// The bug is that the cloud_name is not set in the state file, but it is set
// on the API side. This causes a diff during plan, and it will not disappear
// even after consequent applies. This is because the state is not updated
// with the cloud_name value.
return new == ""
},
},
"plan": {
Type: schema.TypeString,
Expand Down

0 comments on commit e24b69c

Please sign in to comment.