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

azurerm_spring_cloud_connection, azurerm_app_service_connection: fix inaccurate storage blob resource id #18699

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

jiaweitao001
Copy link
Contributor

  • When target resource type is storage blob, we need to cast the default blob id since it's not referenceable.
  • Test results:
=== RUN   TestAccServiceConnectorSpringCloudStorageBlob_basic
=== PAUSE TestAccServiceConnectorSpringCloudStorageBlob_basic
=== CONT  TestAccServiceConnectorSpringCloudStorageBlob_basic
--- PASS: TestAccServiceConnectorSpringCloudStorageBlob_basic (894.98s)
PASS
=== RUN   TestAccServiceConnectorAppServiceStorageBlob_basic
=== PAUSE TestAccServiceConnectorAppServiceStorageBlob_basic
=== CONT  TestAccServiceConnectorAppServiceStorageBlob_basic
--- PASS: TestAccServiceConnectorAppServiceStorageBlob_basic (352.76s)
PASS

}
}

return targetServiceId
}

func validateStorageBlob(input string) (*StorageBlobId, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn'y an ID + vlaidators for a storage blob not already exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @katbyte , the existing validator is not for this default storage blob comes with the account. Using the existing one will cause error because the format of the resource id is different.

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 - could we generate it in resourcesids.go? ie like:

//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=WebApp -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Replaced with generated code.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

other then 1 comment inline LGTM 🧾

Comment on lines 24 to 28
type StorageBlobId struct {
SubscriptionId string
ResourceGroup string
Name string
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is now unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Removed. Thanks!

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

LGTM 🐈

@katbyte katbyte merged commit 0ab4862 into hashicorp:main Oct 13, 2022
@github-actions github-actions bot added this to the v3.27.0 milestone Oct 13, 2022
katbyte added a commit that referenced this pull request Oct 13, 2022
@github-actions
Copy link

This functionality has been released in v3.27.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants