Skip to content

[ISSUE] Issue with databricks_mws_ncc_private_endpoint_rule resource #4623

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

Open
sebastianczech opened this issue Apr 8, 2025 · 1 comment

Comments

@sebastianczech
Copy link

sebastianczech commented Apr 8, 2025

Configuration

terraform import terraform_id azure_resource_id

Expected Behavior

It's expected that existing resource is imported to Terraform state.

For other resources it's implemented by calling function d.SetId():

For databricks_mws_ncc_private_endpoint_rule it's missing here:

Create: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error {
var create settings.CreatePrivateEndpointRuleRequest
common.DataToStructPointer(d, s, &create)
create.NetworkConnectivityConfigId = d.Get("network_connectivity_config_id").(string)
acc, err := c.AccountClient()
if err != nil {
return err
}
rule, err := acc.NetworkConnectivity.CreatePrivateEndpointRule(ctx, create)
if err != nil {
return err
}
common.StructToData(rule, s, d)
p.Pack(d)
return nil

Actual Behavior

Error: The provider returned a resource missing an identifier during ImportResourceState. This is generally a bug in the resource implementation for import. Resource import code should not call d.SetId("") or create an empty ResourceData. If the resource is missing, instead return an error. Please report this to the provider developers.

Terraform and provider versions

Terraform 1.63.0, provider 1.71.0

@sebastianczech
Copy link
Author

I've tested it also in provider 1.74.0 and problem is the same.

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

No branches or pull requests

1 participant