pulumi / pulumi-databricks

Apache License 2.0
15 stars 8 forks source link

Issue when creating VPC endpoint with MwsVpcEndpoint #336

Closed ruaraikirkds closed 2 weeks ago

ruaraikirkds commented 9 months ago

What happened?

Hello team!

I am running into an unexpected error when creating a Databricks VPC Endpoint using MwsVpcEndpoint from the @pulumi/databricks npm package as suggested in the reference docs.

The error is quite vague so hoping for a little clarity as to whether this is a bug or an issue on my end. Please see below for simplified code for explanation.

Thanks!

Example

import * as aws from '@pulumi/aws';
import * as databricks from '@pulumi/databricks';
...

       const vpcEndpoint = new aws.ec2.VpcEndpoint(
            'vpc-endpoint',
            {
                privateDnsEnabled: true,
                securityGroupIds: ['some-group-id'],
                serviceName: 'some-name',
                subnetIds: ['some-subnet-id'],
                tags: {
                    Name: 'vpc-endpoint',
                },
                vpcEndpointType: 'Interface',
                vpcId: 'some-vpc-id',
            },
            {
                provider: awsProvider,
            },
        );

        const workspaceVpcEndpoint = new databricks.MwsVpcEndpoint(
            'workspace-vpc-endpoint',
            {
                accountId: 'my-account-id',
                awsAccountId: 'my-aws-account-id',
                awsVpcEndpointId: vpcEndpoint.id, // The identifier of the VPC endpoint.
                region: 'us-east-1',
                vpcEndpointName: 'workspace-vpc-endpoint',
            },
            {
                provider: databricksProvider,
            },
        );

When running pulumi up, the following error is returned:

databricks:index:MwsVpcEndpoint (workspace-vpc-endpoint):
    error: 1 error occurred:
        * cannot create mws vpc endpoint: Invalid endpoint

The AWS resource is created and passes a valid id to MwsVpcEndpoint, and I have created a VPC endpoint in the Databricks UI with the AWS VPC endpoint id and it creates fine.

For instance, when i manually created a VPC endpoint, then ran pulumi up I get the following:

Diagnostics:
  databricks:index:MwsVpcEndpoint (workspace-rest-apis-endpoint):
    error: 1 error occurred:
        * cannot create mws vpc endpoint: MALFORMED_REQUEST: A VPCEndpoint with aws_vpc_endpoint_id vpce-iwebfipuwerbfpiuwebfiuwebfwiu already exists.

Output of pulumi about

CLI
Version 3.93.0 Go Version go1.21.3 Go Compiler gc

Plugins NAME VERSION nodejs unknown

Host
OS darwin Version 14.3 Arch arm64

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).

t0yv0 commented 9 months ago

Thank you for reporting this @ruaraikirkds , I am sorry the error message is not informative. I'm going to keep this in the backlog for our team to pick up as capacity permits.

I cannot spot the issue at a glance, but in the meanwhile perhaps you can try getting a working starting example the might help avoid the error.

Unfortunately it looks like the Pulumi documentation page does not list examples for this resource at the moment: https://www.pulumi.com/registry/packages/databricks/api-docs/mwsvpcendpoint/

But there are some examples that could potentially be translated from the TF reference page: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_vpc_endpoint

There is also Pulumi AI that sometimes is a good source of example code.

mjeffryes commented 1 month ago

Unfortunately, it looks like this issue hasn't seen any updates in a while. If you're still encountering this problem, could you leave a quick comment to let us know so we can prioritize it? (Commenting will bump it back into our triage queue.)