com.pulumi.gcp.dataproc.kotlin.MetastoreFederation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.dataproc.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.dataproc.kotlin.outputs.MetastoreFederationBackendMetastore
import com.pulumi.gcp.dataproc.kotlin.outputs.MetastoreFederationBackendMetastore.Companion.toKotlin
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
/**
* Builder for [MetastoreFederation].
*/
@PulumiTagMarker
public class MetastoreFederationResourceBuilder internal constructor() {
public var name: String? = null
public var args: MetastoreFederationArgs = MetastoreFederationArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend MetastoreFederationArgsBuilder.() -> Unit) {
val builder = MetastoreFederationArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): MetastoreFederation {
val builtJavaResource = com.pulumi.gcp.dataproc.MetastoreFederation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return MetastoreFederation(builtJavaResource)
}
}
/**
* A managed metastore federation.
* ## Example Usage
* ### Dataproc Metastore Federation Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const defaultMetastoreService = new gcp.dataproc.MetastoreService("default", {
* serviceId: "",
* location: "us-central1",
* tier: "DEVELOPER",
* hiveMetastoreConfig: {
* version: "3.1.2",
* endpointProtocol: "GRPC",
* },
* });
* const _default = new gcp.dataproc.MetastoreFederation("default", {
* location: "us-central1",
* federationId: "",
* version: "3.1.2",
* backendMetastores: [{
* rank: "1",
* name: defaultMetastoreService.id,
* metastoreType: "DATAPROC_METASTORE",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default_metastore_service = gcp.dataproc.MetastoreService("default",
* service_id="",
* location="us-central1",
* tier="DEVELOPER",
* hive_metastore_config=gcp.dataproc.MetastoreServiceHiveMetastoreConfigArgs(
* version="3.1.2",
* endpoint_protocol="GRPC",
* ))
* default = gcp.dataproc.MetastoreFederation("default",
* location="us-central1",
* federation_id="",
* version="3.1.2",
* backend_metastores=[gcp.dataproc.MetastoreFederationBackendMetastoreArgs(
* rank="1",
* name=default_metastore_service.id,
* metastore_type="DATAPROC_METASTORE",
* )])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var defaultMetastoreService = new Gcp.Dataproc.MetastoreService("default", new()
* {
* ServiceId = "",
* Location = "us-central1",
* Tier = "DEVELOPER",
* HiveMetastoreConfig = new Gcp.Dataproc.Inputs.MetastoreServiceHiveMetastoreConfigArgs
* {
* Version = "3.1.2",
* EndpointProtocol = "GRPC",
* },
* });
* var @default = new Gcp.Dataproc.MetastoreFederation("default", new()
* {
* Location = "us-central1",
* FederationId = "",
* Version = "3.1.2",
* BackendMetastores = new[]
* {
* new Gcp.Dataproc.Inputs.MetastoreFederationBackendMetastoreArgs
* {
* Rank = "1",
* Name = defaultMetastoreService.Id,
* MetastoreType = "DATAPROC_METASTORE",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dataproc"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* defaultMetastoreService, err := dataproc.NewMetastoreService(ctx, "default", &dataproc.MetastoreServiceArgs{
* ServiceId: pulumi.String(""),
* Location: pulumi.String("us-central1"),
* Tier: pulumi.String("DEVELOPER"),
* HiveMetastoreConfig: &dataproc.MetastoreServiceHiveMetastoreConfigArgs{
* Version: pulumi.String("3.1.2"),
* EndpointProtocol: pulumi.String("GRPC"),
* },
* })
* if err != nil {
* return err
* }
* _, err = dataproc.NewMetastoreFederation(ctx, "default", &dataproc.MetastoreFederationArgs{
* Location: pulumi.String("us-central1"),
* FederationId: pulumi.String(""),
* Version: pulumi.String("3.1.2"),
* BackendMetastores: dataproc.MetastoreFederationBackendMetastoreArray{
* &dataproc.MetastoreFederationBackendMetastoreArgs{
* Rank: pulumi.String("1"),
* Name: defaultMetastoreService.ID(),
* MetastoreType: pulumi.String("DATAPROC_METASTORE"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.dataproc.MetastoreService;
* import com.pulumi.gcp.dataproc.MetastoreServiceArgs;
* import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs;
* import com.pulumi.gcp.dataproc.MetastoreFederation;
* import com.pulumi.gcp.dataproc.MetastoreFederationArgs;
* import com.pulumi.gcp.dataproc.inputs.MetastoreFederationBackendMetastoreArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var defaultMetastoreService = new MetastoreService("defaultMetastoreService", MetastoreServiceArgs.builder()
* .serviceId("")
* .location("us-central1")
* .tier("DEVELOPER")
* .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder()
* .version("3.1.2")
* .endpointProtocol("GRPC")
* .build())
* .build());
* var default_ = new MetastoreFederation("default", MetastoreFederationArgs.builder()
* .location("us-central1")
* .federationId("")
* .version("3.1.2")
* .backendMetastores(MetastoreFederationBackendMetastoreArgs.builder()
* .rank("1")
* .name(defaultMetastoreService.id())
* .metastoreType("DATAPROC_METASTORE")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:dataproc:MetastoreFederation
* properties:
* location: us-central1
* federationId:
* version: 3.1.2
* backendMetastores:
* - rank: '1'
* name: ${defaultMetastoreService.id}
* metastoreType: DATAPROC_METASTORE
* defaultMetastoreService:
* type: gcp:dataproc:MetastoreService
* name: default
* properties:
* serviceId:
* location: us-central1
* tier: DEVELOPER
* hiveMetastoreConfig:
* version: 3.1.2
* endpointProtocol: GRPC
* ```
*
* ### Dataproc Metastore Federation Bigquery
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const defaultMetastoreService = new gcp.dataproc.MetastoreService("default", {
* serviceId: "",
* location: "us-central1",
* tier: "DEVELOPER",
* hiveMetastoreConfig: {
* version: "3.1.2",
* endpointProtocol: "GRPC",
* },
* });
* const project = gcp.organizations.getProject({});
* const _default = new gcp.dataproc.MetastoreFederation("default", {
* location: "us-central1",
* federationId: "",
* version: "3.1.2",
* backendMetastores: [
* {
* rank: "2",
* name: project.then(project => project.id),
* metastoreType: "BIGQUERY",
* },
* {
* rank: "1",
* name: defaultMetastoreService.id,
* metastoreType: "DATAPROC_METASTORE",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default_metastore_service = gcp.dataproc.MetastoreService("default",
* service_id="",
* location="us-central1",
* tier="DEVELOPER",
* hive_metastore_config=gcp.dataproc.MetastoreServiceHiveMetastoreConfigArgs(
* version="3.1.2",
* endpoint_protocol="GRPC",
* ))
* project = gcp.organizations.get_project()
* default = gcp.dataproc.MetastoreFederation("default",
* location="us-central1",
* federation_id="",
* version="3.1.2",
* backend_metastores=[
* gcp.dataproc.MetastoreFederationBackendMetastoreArgs(
* rank="2",
* name=project.id,
* metastore_type="BIGQUERY",
* ),
* gcp.dataproc.MetastoreFederationBackendMetastoreArgs(
* rank="1",
* name=default_metastore_service.id,
* metastore_type="DATAPROC_METASTORE",
* ),
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var defaultMetastoreService = new Gcp.Dataproc.MetastoreService("default", new()
* {
* ServiceId = "",
* Location = "us-central1",
* Tier = "DEVELOPER",
* HiveMetastoreConfig = new Gcp.Dataproc.Inputs.MetastoreServiceHiveMetastoreConfigArgs
* {
* Version = "3.1.2",
* EndpointProtocol = "GRPC",
* },
* });
* var project = Gcp.Organizations.GetProject.Invoke();
* var @default = new Gcp.Dataproc.MetastoreFederation("default", new()
* {
* Location = "us-central1",
* FederationId = "",
* Version = "3.1.2",
* BackendMetastores = new[]
* {
* new Gcp.Dataproc.Inputs.MetastoreFederationBackendMetastoreArgs
* {
* Rank = "2",
* Name = project.Apply(getProjectResult => getProjectResult.Id),
* MetastoreType = "BIGQUERY",
* },
* new Gcp.Dataproc.Inputs.MetastoreFederationBackendMetastoreArgs
* {
* Rank = "1",
* Name = defaultMetastoreService.Id,
* MetastoreType = "DATAPROC_METASTORE",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dataproc"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* defaultMetastoreService, err := dataproc.NewMetastoreService(ctx, "default", &dataproc.MetastoreServiceArgs{
* ServiceId: pulumi.String(""),
* Location: pulumi.String("us-central1"),
* Tier: pulumi.String("DEVELOPER"),
* HiveMetastoreConfig: &dataproc.MetastoreServiceHiveMetastoreConfigArgs{
* Version: pulumi.String("3.1.2"),
* EndpointProtocol: pulumi.String("GRPC"),
* },
* })
* if err != nil {
* return err
* }
* project, err := organizations.LookupProject(ctx, nil, nil)
* if err != nil {
* return err
* }
* _, err = dataproc.NewMetastoreFederation(ctx, "default", &dataproc.MetastoreFederationArgs{
* Location: pulumi.String("us-central1"),
* FederationId: pulumi.String(""),
* Version: pulumi.String("3.1.2"),
* BackendMetastores: dataproc.MetastoreFederationBackendMetastoreArray{
* &dataproc.MetastoreFederationBackendMetastoreArgs{
* Rank: pulumi.String("2"),
* Name: pulumi.String(project.Id),
* MetastoreType: pulumi.String("BIGQUERY"),
* },
* &dataproc.MetastoreFederationBackendMetastoreArgs{
* Rank: pulumi.String("1"),
* Name: defaultMetastoreService.ID(),
* MetastoreType: pulumi.String("DATAPROC_METASTORE"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.dataproc.MetastoreService;
* import com.pulumi.gcp.dataproc.MetastoreServiceArgs;
* import com.pulumi.gcp.dataproc.inputs.MetastoreServiceHiveMetastoreConfigArgs;
* import com.pulumi.gcp.organizations.OrganizationsFunctions;
* import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
* import com.pulumi.gcp.dataproc.MetastoreFederation;
* import com.pulumi.gcp.dataproc.MetastoreFederationArgs;
* import com.pulumi.gcp.dataproc.inputs.MetastoreFederationBackendMetastoreArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var defaultMetastoreService = new MetastoreService("defaultMetastoreService", MetastoreServiceArgs.builder()
* .serviceId("")
* .location("us-central1")
* .tier("DEVELOPER")
* .hiveMetastoreConfig(MetastoreServiceHiveMetastoreConfigArgs.builder()
* .version("3.1.2")
* .endpointProtocol("GRPC")
* .build())
* .build());
* final var project = OrganizationsFunctions.getProject();
* var default_ = new MetastoreFederation("default", MetastoreFederationArgs.builder()
* .location("us-central1")
* .federationId("")
* .version("3.1.2")
* .backendMetastores(
* MetastoreFederationBackendMetastoreArgs.builder()
* .rank("2")
* .name(project.applyValue(getProjectResult -> getProjectResult.id()))
* .metastoreType("BIGQUERY")
* .build(),
* MetastoreFederationBackendMetastoreArgs.builder()
* .rank("1")
* .name(defaultMetastoreService.id())
* .metastoreType("DATAPROC_METASTORE")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:dataproc:MetastoreFederation
* properties:
* location: us-central1
* federationId:
* version: 3.1.2
* backendMetastores:
* - rank: '2'
* name: ${project.id}
* metastoreType: BIGQUERY
* - rank: '1'
* name: ${defaultMetastoreService.id}
* metastoreType: DATAPROC_METASTORE
* defaultMetastoreService:
* type: gcp:dataproc:MetastoreService
* name: default
* properties:
* serviceId:
* location: us-central1
* tier: DEVELOPER
* hiveMetastoreConfig:
* version: 3.1.2
* endpointProtocol: GRPC
* variables:
* project:
* fn::invoke:
* Function: gcp:organizations:getProject
* Arguments: {}
* ```
*
* ## Import
* Federation can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/federations/{{federation_id}}`
* * `{{project}}/{{location}}/{{federation_id}}`
* * `{{location}}/{{federation_id}}`
* When using the `pulumi import` command, Federation can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:dataproc/metastoreFederation:MetastoreFederation default projects/{{project}}/locations/{{location}}/federations/{{federation_id}}
* ```
* ```sh
* $ pulumi import gcp:dataproc/metastoreFederation:MetastoreFederation default {{project}}/{{location}}/{{federation_id}}
* ```
* ```sh
* $ pulumi import gcp:dataproc/metastoreFederation:MetastoreFederation default {{location}}/{{federation_id}}
* ```
*/
public class MetastoreFederation internal constructor(
override val javaResource: com.pulumi.gcp.dataproc.MetastoreFederation,
) : KotlinCustomResource(javaResource, MetastoreFederationMapper) {
/**
* A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
* Structure is documented below.
*/
public val backendMetastores: Output>
get() = javaResource.backendMetastores().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
})
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy