Skip to content

Commit

Permalink
fix: property mapping for clickhouse_private_endpoint_registration an…
Browse files Browse the repository at this point in the history
…d clickhouse_private_endpoint_attachment
  • Loading branch information
callicles committed Sep 5, 2024
1 parent 0fcf953 commit 9d444c4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ func Provider() tfbridge.ProviderInfo {
"clickhouse_service_private_endpoints_attachment": {
Tok: makeResource("clickhouse_service_private_endpoints_attachment"),
ComputeID: func(ctx context.Context, state resource.PropertyMap) (resource.ID, error) {
serviceId := state["service_id"]
privateEndpointIds := state["private_endpoint_ids"]
serviceId := state["serviceId"]
privateEndpointIds := state["privateEndpointIds"]

if serviceId.IsNull() {
return "", fmt.Errorf("service_id is required")
return "", fmt.Errorf("serviceId is required")
}

if privateEndpointIds.IsNull() || !privateEndpointIds.IsArray() {
return "", fmt.Errorf("private_endpoint_ids must be a non-empty array")
return "", fmt.Errorf("privateEndpointIds must be a non-empty array")
}

idParts := []string{serviceId.StringValue()}
Expand All @@ -194,10 +194,10 @@ func Provider() tfbridge.ProviderInfo {
"clickhouse_private_endpoint_registration": {
Tok: makeResource("clickhouse_private_endpoint_registration"),
ComputeID: func(ctx context.Context, state resource.PropertyMap) (resource.ID, error) {
privateEndpointId := state["private_endpoint_id"]
cloudProvider := state["cloud_provider"]
privateEndpointId := state["privateEndpointId"]
cloudProvider := state["cloudProvider"]
if privateEndpointId.IsNull() || cloudProvider.IsNull() {
return "", fmt.Errorf("cloud_provider and region are required")
return "", fmt.Errorf("cloudProvider and privateEndpointId are required")
}
return resource.ID(fmt.Sprintf("%s-%s", cloudProvider.StringValue(), privateEndpointId.StringValue())), nil
},
Expand Down

0 comments on commit 9d444c4

Please sign in to comment.