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

INVS-0: upgrade the provider to v2 SDK. #647

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pdziedzic-sumo
Copy link
Contributor

@pdziedzic-sumo pdziedzic-sumo commented Apr 24, 2024

golang version is updated to 1.22.

Upgrade was performed semi-automatically with the tf-sdk-migrator tool.

Manual changes:

  • Manual changes had to be made afterwards in the provider.go and provider_test.go files per Removal of terraform.ResourceProvider interface section.

  • sumologic/resource_sumologic_cse_entity_normalization_configuration.go - fixed field names (typo)

Other file changes are boiling down to updating module import paths.

The v1 provider SDK is no longer maintained by Terraform.

This upgrade was triggered by the investigation of INVS-2114 showing that v1 SDK has limited capabilities in terms of verifying the plan generated in tests.
V2 SDK has better support for running the tests from IDE + debugging.

V2 plugin SDK will by default print out the plan as seen in user environment:

    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:

      # sumologic_cse_match_list.match_list will be updated in-place
      ~ resource "sumologic_cse_match_list" "match_list" {
            id              = "183"
            name            = "Terraform Test Match List 4d5da4fa-a7e9-4710-9722-66b0d88fff01"
            # (7 unchanged attributes hidden)

          - items {
              - description = "Match List Item Description 0" -> null
              - expiration  = "2122-02-27T04:00:00+00:00" -> null
              - id          = "1ff1de77400538da93f42943881c655f6faeb48c34bb36c2a4846474894e15685465727261666f726d2054657374204d61746368204c6973742034643564613466612d613765392d343731302d393732322d363662306438386666663031" -> null
              - value       = "value 0" -> null
            }
          - items {
              - description = "Match List Item Description 1" -> null
              - expiration  = "2122-02-27T04:00:00+00:00" -> null
              - id          = "1ff1de77400538da93f42943881c655ff979463b0b4e3f91a3cda7ee49c8cb825465727261666f726d2054657374204d61746368204c6973742034643564613466612d613765392d343731302d393732322d363662306438386666663031" -> null
              - value       = "value 1" -> null
            }
          - items {
              - description = "Match List Item Description 2" -> null
              - expiration  = "2122-02-27T04:00:00+00:00" -> null
              - id          = "1ff1de77400538da93f42943881c655fff40575ddd0c39b4b60d9885cd070d325465727261666f726d2054657374204d61746368204c6973742034643564613466612d613765392d343731302d393732322d363662306438386666663031" -> null
              - value       = "value 2" -> null
            }
          + items {
              + description = "Match List Item Description 0"
              + expiration  = "2122-02-27T04:00:00"
              + id          = (known after apply)
              + value       = "value 0"
            }
          + items {
              + description = "Match List Item Description 1"
              + expiration  = "2122-02-27T04:00:00"
              + id          = (known after apply)
              + value       = "value 1"
            }
          + items {
              + description = "Match List Item Description 2"
              + expiration  = "2122-02-27T04:00:00"
              + id          = (known after apply)
              + value       = "value 2"
            }
        }

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

Successfully merging this pull request may close these issues.

1 participant