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

Pulumi requires databrick's managed resource group to exist while Azure requires the opposite #3643

Closed
thiDucTran opened this issue Oct 12, 2024 · 1 comment
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@thiDucTran
Copy link

What happened?

according to https://www.pulumi.com/registry/packages/azure-native/api-docs/databricks/workspace/#managedresourcegroupid_go , it is implied that the input of managed resource is required and also said resource group must exist ..but creating databricks would fail with the message in Azure

"statusMessage": "{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"ApplianceProvisioningFailed\",\"message\":\"The managed resource group '/subscriptions/foo/resourceGroups/mrg-bar' already exists. Please specify a new non-existent managed resource group\"}]}}",

Example

    	createManagedResourceGroup, _ := resources.NewResourceGroup(ctx, "managedResourceGroup", &resources.ResourceGroupArgs{
			Location:          pulumi.String(location),
			ResourceGroupName: pulumi.String("m"+resourceGroupName),
		},pulumi.DependsOn([]pulumi.Resource{createResourceGroup}))
		_ , err := databricks.NewWorkspace(ctx, "databricks", &databricks.WorkspaceArgs{
			Location:               pulumi.String(location),
			ManagedResourceGroupId: createManagedResourceGroup.ID(),
			ResourceGroupName: pulumi.String(resourceGroupName),
			WorkspaceName: pulumi.String("databricks-dev"),
			RequiredNsgRules: pulumi.String("AllRules"),
			Sku: &databricks.SkuArgs{
				Name: pulumi.String("premium"),
			},
			Parameters: &databricks.WorkspaceCustomParametersArgs{
				CustomPrivateSubnetName: &databricks.WorkspaceCustomStringParameterArgs{
					Value: pulumi.String("databricks-container-subnet"),
				},
				CustomPublicSubnetName: &databricks.WorkspaceCustomStringParameterArgs{
					Value: pulumi.String("databricks-host-subnet"),
				},
				CustomVirtualNetworkId: &databricks.WorkspaceCustomStringParameterArgs{
					Value: createVnet.ID(),
				},
				EnableNoPublicIp: &databricks.WorkspaceCustomBooleanParameterArgs{
					Value: pulumi.Bool(true),
				},
			},
		},pulumi.DependsOn([]pulumi.Resource{createVnet}),pulumi.DependsOn([]pulumi.Resource{createHostSubnet}),pulumi.DependsOn([]pulumi.Resource{createContainerSubnet}))
		if err != nil {
			return err
		}

Output of pulumi about

CLI
Version      3.136.1
Go Version   go1.23.2
Go Compiler  gc

Plugins
KIND      NAME          VERSION
resource  azure-native  2.64.2
resource  azure-native  2.64.2
resource  azure-native  2.64.2
resource  azure-native  2.42.1
resource  azure-native  2.42.1
language  go            unknown

Host
OS       ubuntu
Version  22.04
Arch     x86_64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@thiDucTran thiDucTran added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 12, 2024
@thiDucTran
Copy link
Author

pulumi does not require the managed resource group to be pre-existing before creating databricks..which makes sense..I just have the wrong assumption since the input https://www.pulumi.com/registry/packages/azure-native/api-docs/databricks/workspace/#managedresourcegroupid_go needs to be provided in Azure's resource ID format.

TLDR: dont create the managed resource group..only provide its name in the format like below
ManagedResourceGroupId: pulumi.String("/subscriptions/"+subscription+"/resourceGroups/m"+resourceGroupName),

@thomas11 thomas11 removed the needs-triage Needs attention from the triage team label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants