Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escl 4868 : Failing Delphix Terraform DCT provider updates #83

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

ankit-patil-hubs
Copy link
Contributor

@ankit-patil-hubs ankit-patil-hubs commented Mar 26, 2024

Problem:

in release 3.2.0 we introduced 2 new schema variables in dsource resource , the intention was to use these for a new polling logic where based on these 2 variables we poll for snapshot creation to be completed ,post dsource job polling is completed .

"wait_time": {
    Type:     schema.TypeInt,
    Default:  3,
    Optional: true,
},
"skip_wait_for_snapshot_creation": {
    Type:     schema.TypeBool,
    Default:  false,
    Optional: true,
},

for the user in case of an upgrade from 3.1.0 -> 3.2.0 "wait_time" is getting added to the state file and identified as a changed attribute which caused the drift and hence the failure, since we have defined "wait_time" as int with "Default: 3", terraform first adds the value as 0 and then later updates it to 3 which has caused this drift, we don't this drift for "skip_wait_for_snapshot_creation" because it is of type boolean .

Solution:

removed the default from "wait_time" i.e it will be assigned to 0 by default and no attribute change will be detected by terraform

Testing

upgrade to 3.2.0

delphix_appdata_dsource.test_app_data_dsource_second: Refreshing state... [id=13-APPDATA_CONTAINER-160]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # delphix_appdata_dsource.test_app_data_dsource_second will be updated in-place
  ~ resource "delphix_appdata_dsource" "test_app_data_dsource_second" {
        id                              = "13-APPDATA_CONTAINER-160"
        name                            = "appdata_dsource_second_new"
      ~ wait_time                       = 0 -> 3
        # (23 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.


upgrade to 3.2.1 resolves this

ankit.patil@Ankit-Patils-MacBook-Pro postgresql % terraform plan          
delphix_appdata_dsource.test_app_data_dsource_second: Refreshing state... [id=13-APPDATA_CONTAINER-160]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
ankit.patil@Ankit-Patils-MacBook-Pro postgresql % terraform apply
delphix_appdata_dsource.test_app_data_dsource_second: Refreshing state... [id=13-APPDATA_CONTAINER-160]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Manually tested

@elima-sugunan elima-sugunan merged commit b0b3872 into develop Mar 26, 2024
2 checks passed
Copy link
Contributor

@sunnyx4 sunnyx4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the issue we see upgrading from 3.1.0 to 3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants