UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

338 lines (337 loc) 15.3 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * > Initialize provider with `alias = "mws"`, `host = "https://accounts.cloud.databricks.com"` and use `provider = databricks.mws` * * Enables you to register awsVpcEndpoint resources or gcp vpcEndpoint resources with Databricks such that they can be used as part of a databricks.MwsNetworks configuration. * * It is strongly recommended that customers read the [Enable AWS Private Link](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) or the [Enable GCP Private Service Connect](https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/private-service-connect.html) documentation before trying to leverage this resource. * * ## Example Usage * * ### Databricks on AWS usage * * Before using this resource, you will need to create the necessary VPC Endpoints as per your [VPC endpoint requirements](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html#vpc-endpoint-requirements). You can use the awsVpcEndpoint resource for this, for example: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const workspace = new aws.ec2.VpcEndpoint("workspace", { * vpcId: vpc.vpcId, * serviceName: privateLink.workspaceService, * vpcEndpointType: "Interface", * securityGroupIds: [vpc.defaultSecurityGroupId], * subnetIds: [plSubnet.id], * privateDnsEnabled: true, * }, { * dependsOn: [plSubnet], * }); * const relay = new aws.ec2.VpcEndpoint("relay", { * vpcId: vpc.vpcId, * serviceName: privateLink.relayService, * vpcEndpointType: "Interface", * securityGroupIds: [vpc.defaultSecurityGroupId], * subnetIds: [plSubnet.id], * privateDnsEnabled: true, * }, { * dependsOn: [plSubnet], * }); * ``` * * Depending on your use case, you may need or choose to add VPC Endpoints for the AWS Services Databricks uses. See [Add VPC endpoints for other AWS services (recommended but optional) * ](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html#step-9-add-vpc-endpoints-for-other-aws-services-recommended-but-optional) for more information. For example: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const s3 = new aws.ec2.VpcEndpoint("s3", { * vpcId: vpc.vpcId, * routeTableIds: vpc.privateRouteTableIds, * serviceName: `com.amazonaws.${region}.s3`, * }, { * dependsOn: [vpc], * }); * const sts = new aws.ec2.VpcEndpoint("sts", { * vpcId: vpc.vpcId, * serviceName: `com.amazonaws.${region}.sts`, * vpcEndpointType: "Interface", * subnetIds: vpc.privateSubnets, * securityGroupIds: [vpc.defaultSecurityGroupId], * privateDnsEnabled: true, * }, { * dependsOn: [vpc], * }); * const kinesis_streams = new aws.ec2.VpcEndpoint("kinesis-streams", { * vpcId: vpc.vpcId, * serviceName: `com.amazonaws.${region}.kinesis-streams`, * vpcEndpointType: "Interface", * subnetIds: vpc.privateSubnets, * securityGroupIds: [vpc.defaultSecurityGroupId], * }, { * dependsOn: [vpc], * }); * ``` * * Once you have created the necessary endpoints, you need to register each of them via *this* Pulumi resource, which calls out to the [Databricks Account API](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html#step-3-register-your-vpc-endpoint-ids-with-the-account-api)): * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const workspace = new databricks.MwsVpcEndpoint("workspace", { * accountId: databricksAccountId, * awsVpcEndpointId: workspaceAwsVpcEndpoint.id, * vpcEndpointName: `VPC Relay for ${vpc.vpcId}`, * region: region, * }, { * dependsOn: [workspaceAwsVpcEndpoint], * }); * const relay = new databricks.MwsVpcEndpoint("relay", { * accountId: databricksAccountId, * awsVpcEndpointId: relayAwsVpcEndpoint.id, * vpcEndpointName: `VPC Relay for ${vpc.vpcId}`, * region: region, * }, { * dependsOn: [relayAwsVpcEndpoint], * }); * ``` * * Typically the next steps after this would be to create a databricks.MwsPrivateAccessSettings and databricks.MwsNetworks configuration, before passing the `databricks_mws_private_access_settings.pas.private_access_settings_id` and `databricks_mws_networks.this.network_id` into a databricks.MwsWorkspaces resource: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.MwsWorkspaces("this", { * accountId: databricksAccountId, * awsRegion: region, * workspaceName: prefix, * credentialsId: thisDatabricksMwsCredentials.credentialsId, * storageConfigurationId: thisDatabricksMwsStorageConfigurations.storageConfigurationId, * networkId: thisDatabricksMwsNetworks.networkId, * privateAccessSettingsId: pas.privateAccessSettingsId, * pricingTier: "ENTERPRISE", * }, { * dependsOn: [thisDatabricksMwsNetworks], * }); * ``` * * ### Databricks on GCP usage * * Before using this resource, you will need to create the necessary Private Service Connect (PSC) connections on your Google Cloud VPC networks. You can see [Enable Private Service Connect for your workspace](https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/private-service-connect.html) for more details. * * Once you have created the necessary PSC connections, you need to register each of them via *this* Pulumi resource, which calls out to the Databricks Account API. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const config = new pulumi.Config(); * // Account Id that could be found in https://accounts.gcp.databricks.com/ * const databricksAccountId = config.requireObject("databricksAccountId"); * const databricksGoogleServiceAccount = config.requireObject("databricksGoogleServiceAccount"); * const googleProject = config.requireObject("googleProject"); * const subnetRegion = config.requireObject("subnetRegion"); * const workspace = new databricks.MwsVpcEndpoint("workspace", { * accountId: databricksAccountId, * vpcEndpointName: "PSC Rest API endpoint", * gcpVpcEndpointInfo: { * projectId: googleProject, * pscEndpointName: "PSC Rest API endpoint", * endpointRegion: subnetRegion, * }, * }); * const relay = new databricks.MwsVpcEndpoint("relay", { * accountId: databricksAccountId, * vpcEndpointName: "PSC Relay endpoint", * gcpVpcEndpointInfo: { * projectId: googleProject, * pscEndpointName: "PSC Relay endpoint", * endpointRegion: subnetRegion, * }, * }); * ``` * * Typically the next steps after this would be to create a databricks.MwsPrivateAccessSettings and databricks.MwsNetworks configuration, before passing the `databricks_mws_private_access_settings.pas.private_access_settings_id` and `databricks_mws_networks.this.network_id` into a databricks.MwsWorkspaces resource: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.MwsWorkspaces("this", { * accountId: databricksAccountId, * workspaceName: "gcp workspace", * location: subnetRegion, * cloudResourceContainer: { * gcp: { * projectId: googleProject, * }, * }, * gkeConfig: { * connectivityType: "PRIVATE_NODE_PUBLIC_MASTER", * masterIpRange: "10.3.0.0/28", * }, * networkId: thisDatabricksMwsNetworks.networkId, * privateAccessSettingsId: pas.privateAccessSettingsId, * pricingTier: "PREMIUM", * }, { * dependsOn: [thisDatabricksMwsNetworks], * }); * ``` * * ## Related Resources * * The following resources are used in the same context: * * * Provisioning Databricks on AWS guide. * * Provisioning Databricks on AWS with Private Link guide. * * Provisioning AWS Databricks workspaces with a Hub & Spoke firewall for data exfiltration protection guide. * * Provisioning Databricks workspaces on GCP with Private Service Connect guide. * * databricks.MwsNetworks to [configure VPC](https://docs.databricks.com/administration-guide/cloud-configurations/aws/customer-managed-vpc.html) & subnets for new workspaces within AWS. * * databricks.MwsPrivateAccessSettings to create a [Private Access Setting](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html#step-5-create-a-private-access-settings-configuration-using-the-databricks-account-api) that can be used as part of a databricks.MwsWorkspaces resource to create a [Databricks Workspace that leverages AWS Private Link](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html). * * databricks.MwsWorkspaces to set up [AWS and GCP workspaces](https://docs.databricks.com/getting-started/overview.html#e2-architecture-1). * * ## Import * * -> Importing this resource is not currently supported. */ export declare class MwsVpcEndpoint extends pulumi.CustomResource { /** * Get an existing MwsVpcEndpoint resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MwsVpcEndpointState, opts?: pulumi.CustomResourceOptions): MwsVpcEndpoint; /** * Returns true if the given object is an instance of MwsVpcEndpoint. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is MwsVpcEndpoint; /** * Account Id that could be found in the Accounts Console for [AWS](https://accounts.cloud.databricks.com/) or [GCP](https://accounts.gcp.databricks.com/) */ readonly accountId: pulumi.Output<string | undefined>; readonly awsAccountId: pulumi.Output<string>; /** * (AWS Only) The ID of the Databricks endpoint service that this VPC endpoint is connected to. Please find the list of endpoint service IDs for each supported region in the [Databricks PrivateLink documentation](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) */ readonly awsEndpointServiceId: pulumi.Output<string>; /** * ID of configured aws_vpc_endpoint */ readonly awsVpcEndpointId: pulumi.Output<string | undefined>; /** * a block consists of Google Cloud specific information for this PSC endpoint. It has the following fields: */ readonly gcpVpcEndpointInfo: pulumi.Output<outputs.MwsVpcEndpointGcpVpcEndpointInfo | undefined>; /** * Region of AWS VPC */ readonly region: pulumi.Output<string | undefined>; /** * (AWS Only) State of VPC Endpoint */ readonly state: pulumi.Output<string>; readonly useCase: pulumi.Output<string>; /** * Canonical unique identifier of VPC Endpoint in Databricks Account */ readonly vpcEndpointId: pulumi.Output<string>; /** * Name of VPC Endpoint in Databricks Account */ readonly vpcEndpointName: pulumi.Output<string>; /** * Create a MwsVpcEndpoint resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: MwsVpcEndpointArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MwsVpcEndpoint resources. */ export interface MwsVpcEndpointState { /** * Account Id that could be found in the Accounts Console for [AWS](https://accounts.cloud.databricks.com/) or [GCP](https://accounts.gcp.databricks.com/) */ accountId?: pulumi.Input<string>; awsAccountId?: pulumi.Input<string>; /** * (AWS Only) The ID of the Databricks endpoint service that this VPC endpoint is connected to. Please find the list of endpoint service IDs for each supported region in the [Databricks PrivateLink documentation](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) */ awsEndpointServiceId?: pulumi.Input<string>; /** * ID of configured aws_vpc_endpoint */ awsVpcEndpointId?: pulumi.Input<string>; /** * a block consists of Google Cloud specific information for this PSC endpoint. It has the following fields: */ gcpVpcEndpointInfo?: pulumi.Input<inputs.MwsVpcEndpointGcpVpcEndpointInfo>; /** * Region of AWS VPC */ region?: pulumi.Input<string>; /** * (AWS Only) State of VPC Endpoint */ state?: pulumi.Input<string>; useCase?: pulumi.Input<string>; /** * Canonical unique identifier of VPC Endpoint in Databricks Account */ vpcEndpointId?: pulumi.Input<string>; /** * Name of VPC Endpoint in Databricks Account */ vpcEndpointName?: pulumi.Input<string>; } /** * The set of arguments for constructing a MwsVpcEndpoint resource. */ export interface MwsVpcEndpointArgs { /** * Account Id that could be found in the Accounts Console for [AWS](https://accounts.cloud.databricks.com/) or [GCP](https://accounts.gcp.databricks.com/) */ accountId?: pulumi.Input<string>; awsAccountId?: pulumi.Input<string>; /** * (AWS Only) The ID of the Databricks endpoint service that this VPC endpoint is connected to. Please find the list of endpoint service IDs for each supported region in the [Databricks PrivateLink documentation](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) */ awsEndpointServiceId?: pulumi.Input<string>; /** * ID of configured aws_vpc_endpoint */ awsVpcEndpointId?: pulumi.Input<string>; /** * a block consists of Google Cloud specific information for this PSC endpoint. It has the following fields: */ gcpVpcEndpointInfo?: pulumi.Input<inputs.MwsVpcEndpointGcpVpcEndpointInfo>; /** * Region of AWS VPC */ region?: pulumi.Input<string>; /** * (AWS Only) State of VPC Endpoint */ state?: pulumi.Input<string>; useCase?: pulumi.Input<string>; /** * Canonical unique identifier of VPC Endpoint in Databricks Account */ vpcEndpointId?: pulumi.Input<string>; /** * Name of VPC Endpoint in Databricks Account */ vpcEndpointName: pulumi.Input<string>; }