Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Capture Terraform resource schema version with resource.Terraformed #117

Merged
merged 1 commit into from
Oct 15, 2021

Conversation

ulucinar
Copy link
Collaborator

Description of your changes

Fixes #116

The PR captures the available Terraform resource schema version as part of terrajet's resource.Terraformed. For certain resources, it turns out that the schema version is not 0 and that version info is already available in the native provider. With this PR we should be able to capture the correct schema version without manual configuration.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

I have successfully tested these changes together with crossplane-contrib/provider-jet-azure#64 using the following example manifests:

NAME                                                    READY   SYNCED   EXTERNAL-NAME                                                              AGE
resourcegroup.resource.azure.tf.crossplane.io/example   True    True     /subscriptions/038f2b7c-3265-43b8-8624-c9ad5da610a8/resourceGroups/alper   5m30s

NAME                                                    READY   SYNCED   EXTERNAL-NAME                                                                                                                                   AGE
storageaccount.storage.azure.tf.crossplane.io/example   True    True     /subscriptions/038f2b7c-3265-43b8-8624-c9ad5da610a8/resourceGroups/alper/providers/Microsoft.Storage/storageAccounts/crossplaneexamplestoracc   4m9s

NAME                                                 READY   SYNCED   EXTERNAL-NAME                                                                   AGE
storageblob.storage.azure.tf.crossplane.io/example   True    True     https://crossplaneexamplestoracc.blob.core.windows.net/content/sample_content   4m9s

NAME                                                      READY   SYNCED   EXTERNAL-NAME                                                    AGE
storagecontainer.storage.azure.tf.crossplane.io/example   True    True     https://crossplaneexamplestoracc.blob.core.windows.net/content   4m9s

Also verified resource states on Azure portal.

Copy link
Member

@turkenh turkenh left a comment

Choose a reason for hiding this comment

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

Great finding, thanks @ulucinar!

@ulucinar
Copy link
Collaborator Author

Thank you @turkenh!

@ulucinar ulucinar merged commit 24f186f into crossplane:main Oct 15, 2021
@ulucinar ulucinar deleted the fix-116 branch October 15, 2021 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong Schema Version in Generated Terraform State
2 participants