All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.vertex.kotlin.AiFeatureGroupArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.vertex.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.vertex.AiFeatureGroupArgs.builder
import com.pulumi.gcp.vertex.kotlin.inputs.AiFeatureGroupBigQueryArgs
import com.pulumi.gcp.vertex.kotlin.inputs.AiFeatureGroupBigQueryArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Vertex AI Feature Group.
 * To get more information about FeatureGroup, see:
 * * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.featureGroups)
 * * How-to Guides
 *     * [Creating a Feature Group](https://cloud.google.com/vertex-ai/docs/featurestore/latest/create-featuregroup)
 * ## Example Usage
 * ### Vertex Ai Feature Group
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const sampleDataset = new gcp.bigquery.Dataset("sample_dataset", {
 *     datasetId: "job_load_dataset",
 *     friendlyName: "test",
 *     description: "This is a test description",
 *     location: "US",
 * });
 * const sampleTable = new gcp.bigquery.Table("sample_table", {
 *     deletionProtection: false,
 *     datasetId: sampleDataset.datasetId,
 *     tableId: "job_load_table",
 *     schema: `[
 *     {
 *         "name": "feature_id",
 *         "type": "STRING",
 *         "mode": "NULLABLE"
 *     },
 *     {
 *         "name": "feature_timestamp",
 *         "type": "TIMESTAMP",
 *         "mode": "NULLABLE"
 *     }
 * ]
 * `,
 * });
 * const featureGroup = new gcp.vertex.AiFeatureGroup("feature_group", {
 *     name: "example_feature_group",
 *     description: "A sample feature group",
 *     region: "us-central1",
 *     labels: {
 *         "label-one": "value-one",
 *     },
 *     bigQuery: {
 *         bigQuerySource: {
 *             inputUri: pulumi.interpolate`bq://${sampleTable.project}.${sampleTable.datasetId}.${sampleTable.tableId}`,
 *         },
 *         entityIdColumns: ["feature_id"],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * sample_dataset = gcp.bigquery.Dataset("sample_dataset",
 *     dataset_id="job_load_dataset",
 *     friendly_name="test",
 *     description="This is a test description",
 *     location="US")
 * sample_table = gcp.bigquery.Table("sample_table",
 *     deletion_protection=False,
 *     dataset_id=sample_dataset.dataset_id,
 *     table_id="job_load_table",
 *     schema="""[
 *     {
 *         "name": "feature_id",
 *         "type": "STRING",
 *         "mode": "NULLABLE"
 *     },
 *     {
 *         "name": "feature_timestamp",
 *         "type": "TIMESTAMP",
 *         "mode": "NULLABLE"
 *     }
 * ]
 * """)
 * feature_group = gcp.vertex.AiFeatureGroup("feature_group",
 *     name="example_feature_group",
 *     description="A sample feature group",
 *     region="us-central1",
 *     labels={
 *         "label-one": "value-one",
 *     },
 *     big_query={
 *         "big_query_source": {
 *             "input_uri": pulumi.Output.all(
 *                 project=sample_table.project,
 *                 dataset_id=sample_table.dataset_id,
 *                 table_id=sample_table.table_id
 * ).apply(lambda resolved_outputs: f"bq://{resolved_outputs['project']}.{resolved_outputs['dataset_id']}.{resolved_outputs['table_id']}")
 * ,
 *         },
 *         "entity_id_columns": ["feature_id"],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var sampleDataset = new Gcp.BigQuery.Dataset("sample_dataset", new()
 *     {
 *         DatasetId = "job_load_dataset",
 *         FriendlyName = "test",
 *         Description = "This is a test description",
 *         Location = "US",
 *     });
 *     var sampleTable = new Gcp.BigQuery.Table("sample_table", new()
 *     {
 *         DeletionProtection = false,
 *         DatasetId = sampleDataset.DatasetId,
 *         TableId = "job_load_table",
 *         Schema = @"[
 *     {
 *         ""name"": ""feature_id"",
 *         ""type"": ""STRING"",
 *         ""mode"": ""NULLABLE""
 *     },
 *     {
 *         ""name"": ""feature_timestamp"",
 *         ""type"": ""TIMESTAMP"",
 *         ""mode"": ""NULLABLE""
 *     }
 * ]
 * ",
 *     });
 *     var featureGroup = new Gcp.Vertex.AiFeatureGroup("feature_group", new()
 *     {
 *         Name = "example_feature_group",
 *         Description = "A sample feature group",
 *         Region = "us-central1",
 *         Labels =
 *         {
 *             { "label-one", "value-one" },
 *         },
 *         BigQuery = new Gcp.Vertex.Inputs.AiFeatureGroupBigQueryArgs
 *         {
 *             BigQuerySource = new Gcp.Vertex.Inputs.AiFeatureGroupBigQueryBigQuerySourceArgs
 *             {
 *                 InputUri = Output.Tuple(sampleTable.Project, sampleTable.DatasetId, sampleTable.TableId).Apply(values =>
 *                 {
 *                     var project = values.Item1;
 *                     var datasetId = values.Item2;
 *                     var tableId = values.Item3;
 *                     return $"bq://{project}.{datasetId}.{tableId}";
 *                 }),
 *             },
 *             EntityIdColumns = new[]
 *             {
 *                 "feature_id",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vertex"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		sampleDataset, err := bigquery.NewDataset(ctx, "sample_dataset", &bigquery.DatasetArgs{
 * 			DatasetId:    pulumi.String("job_load_dataset"),
 * 			FriendlyName: pulumi.String("test"),
 * 			Description:  pulumi.String("This is a test description"),
 * 			Location:     pulumi.String("US"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		sampleTable, err := bigquery.NewTable(ctx, "sample_table", &bigquery.TableArgs{
 * 			DeletionProtection: pulumi.Bool(false),
 * 			DatasetId:          sampleDataset.DatasetId,
 * 			TableId:            pulumi.String("job_load_table"),
 * 			Schema: pulumi.String(`[
 *     {
 *         "name": "feature_id",
 *         "type": "STRING",
 *         "mode": "NULLABLE"
 *     },
 *     {
 *         "name": "feature_timestamp",
 *         "type": "TIMESTAMP",
 *         "mode": "NULLABLE"
 *     }
 * ]
 * `),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vertex.NewAiFeatureGroup(ctx, "feature_group", &vertex.AiFeatureGroupArgs{
 * 			Name:        pulumi.String("example_feature_group"),
 * 			Description: pulumi.String("A sample feature group"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Labels: pulumi.StringMap{
 * 				"label-one": pulumi.String("value-one"),
 * 			},
 * 			BigQuery: &vertex.AiFeatureGroupBigQueryArgs{
 * 				BigQuerySource: &vertex.AiFeatureGroupBigQueryBigQuerySourceArgs{
 * 					InputUri: pulumi.All(sampleTable.Project, sampleTable.DatasetId, sampleTable.TableId).ApplyT(func(_args []interface{}) (string, error) {
 * 						project := _args[0].(string)
 * 						datasetId := _args[1].(string)
 * 						tableId := _args[2].(string)
 * 						return fmt.Sprintf("bq://%v.%v.%v", project, datasetId, tableId), nil
 * 					}).(pulumi.StringOutput),
 * 				},
 * 				EntityIdColumns: pulumi.StringArray{
 * 					pulumi.String("feature_id"),
 * 				},
 * 			},
 * 		})
 * 		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.bigquery.Dataset;
 * import com.pulumi.gcp.bigquery.DatasetArgs;
 * import com.pulumi.gcp.bigquery.Table;
 * import com.pulumi.gcp.bigquery.TableArgs;
 * import com.pulumi.gcp.vertex.AiFeatureGroup;
 * import com.pulumi.gcp.vertex.AiFeatureGroupArgs;
 * import com.pulumi.gcp.vertex.inputs.AiFeatureGroupBigQueryArgs;
 * import com.pulumi.gcp.vertex.inputs.AiFeatureGroupBigQueryBigQuerySourceArgs;
 * 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 sampleDataset = new Dataset("sampleDataset", DatasetArgs.builder()
 *             .datasetId("job_load_dataset")
 *             .friendlyName("test")
 *             .description("This is a test description")
 *             .location("US")
 *             .build());
 *         var sampleTable = new Table("sampleTable", TableArgs.builder()
 *             .deletionProtection(false)
 *             .datasetId(sampleDataset.datasetId())
 *             .tableId("job_load_table")
 *             .schema("""
 * [
 *     {
 *         "name": "feature_id",
 *         "type": "STRING",
 *         "mode": "NULLABLE"
 *     },
 *     {
 *         "name": "feature_timestamp",
 *         "type": "TIMESTAMP",
 *         "mode": "NULLABLE"
 *     }
 * ]
 *             """)
 *             .build());
 *         var featureGroup = new AiFeatureGroup("featureGroup", AiFeatureGroupArgs.builder()
 *             .name("example_feature_group")
 *             .description("A sample feature group")
 *             .region("us-central1")
 *             .labels(Map.of("label-one", "value-one"))
 *             .bigQuery(AiFeatureGroupBigQueryArgs.builder()
 *                 .bigQuerySource(AiFeatureGroupBigQueryBigQuerySourceArgs.builder()
 *                     .inputUri(Output.tuple(sampleTable.project(), sampleTable.datasetId(), sampleTable.tableId()).applyValue(values -> {
 *                         var project = values.t1;
 *                         var datasetId = values.t2;
 *                         var tableId = values.t3;
 *                         return String.format("bq://%s.%s.%s", project,datasetId,tableId);
 *                     }))
 *                     .build())
 *                 .entityIdColumns("feature_id")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   featureGroup:
 *     type: gcp:vertex:AiFeatureGroup
 *     name: feature_group
 *     properties:
 *       name: example_feature_group
 *       description: A sample feature group
 *       region: us-central1
 *       labels:
 *         label-one: value-one
 *       bigQuery:
 *         bigQuerySource:
 *           inputUri: bq://${sampleTable.project}.${sampleTable.datasetId}.${sampleTable.tableId}
 *         entityIdColumns:
 *           - feature_id
 *   sampleDataset:
 *     type: gcp:bigquery:Dataset
 *     name: sample_dataset
 *     properties:
 *       datasetId: job_load_dataset
 *       friendlyName: test
 *       description: This is a test description
 *       location: US
 *   sampleTable:
 *     type: gcp:bigquery:Table
 *     name: sample_table
 *     properties:
 *       deletionProtection: false
 *       datasetId: ${sampleDataset.datasetId}
 *       tableId: job_load_table
 *       schema: |
 *         [
 *             {
 *                 "name": "feature_id",
 *                 "type": "STRING",
 *                 "mode": "NULLABLE"
 *             },
 *             {
 *                 "name": "feature_timestamp",
 *                 "type": "TIMESTAMP",
 *                 "mode": "NULLABLE"
 *             }
 *         ]
 * ```
 * 
 * ## Import
 * FeatureGroup can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{region}}/featureGroups/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, FeatureGroup can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:vertex/aiFeatureGroup:AiFeatureGroup default projects/{{project}}/locations/{{region}}/featureGroups/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vertex/aiFeatureGroup:AiFeatureGroup default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vertex/aiFeatureGroup:AiFeatureGroup default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vertex/aiFeatureGroup:AiFeatureGroup default {{name}}
 * ```
 * @property bigQuery Indicates that features for this group come from BigQuery Table/View. By default treats the source as a sparse time series source, which is required to have an entityId and a feature_timestamp column in the source.
 * Structure is documented below.
 * @property description The description of the FeatureGroup.
 * @property labels The labels with user-defined metadata to organize your FeatureGroup.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property name The resource name of the Feature Group.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property region The region of feature group. eg us-central1
 */
public data class AiFeatureGroupArgs(
    public val bigQuery: Output? = null,
    public val description: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.vertex.AiFeatureGroupArgs =
        com.pulumi.gcp.vertex.AiFeatureGroupArgs.builder()
            .bigQuery(bigQuery?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AiFeatureGroupArgs].
 */
@PulumiTagMarker
public class AiFeatureGroupArgsBuilder internal constructor() {
    private var bigQuery: Output? = null

    private var description: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    /**
     * @param value Indicates that features for this group come from BigQuery Table/View. By default treats the source as a sparse time series source, which is required to have an entityId and a feature_timestamp column in the source.
     * Structure is documented below.
     */
    @JvmName("xuymbrbalahtuwth")
    public suspend fun bigQuery(`value`: Output) {
        this.bigQuery = value
    }

    /**
     * @param value The description of the FeatureGroup.
     */
    @JvmName("qiwiiotqqrkppnve")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The labels with user-defined metadata to organize your FeatureGroup.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("oaimnhmxifpybqfu")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The resource name of the Feature Group.
     */
    @JvmName("rqsksvaffstbtabf")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("hgxjyytwvkqhljfp")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The region of feature group. eg us-central1
     */
    @JvmName("cewvgbrlosqtxtpc")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value Indicates that features for this group come from BigQuery Table/View. By default treats the source as a sparse time series source, which is required to have an entityId and a feature_timestamp column in the source.
     * Structure is documented below.
     */
    @JvmName("sqgqttrtkpvadbnq")
    public suspend fun bigQuery(`value`: AiFeatureGroupBigQueryArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bigQuery = mapped
    }

    /**
     * @param argument Indicates that features for this group come from BigQuery Table/View. By default treats the source as a sparse time series source, which is required to have an entityId and a feature_timestamp column in the source.
     * Structure is documented below.
     */
    @JvmName("vckcnvhaxbijendc")
    public suspend fun bigQuery(argument: suspend AiFeatureGroupBigQueryArgsBuilder.() -> Unit) {
        val toBeMapped = AiFeatureGroupBigQueryArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.bigQuery = mapped
    }

    /**
     * @param value The description of the FeatureGroup.
     */
    @JvmName("ldjqjhsmpubebuqs")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The labels with user-defined metadata to organize your FeatureGroup.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("hciciilpgplpobnr")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values The labels with user-defined metadata to organize your FeatureGroup.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("fscykojlsidjfigi")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The resource name of the Feature Group.
     */
    @JvmName("qcaadeypmtutdauf")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("ldlfmuqkblieaivd")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The region of feature group. eg us-central1
     */
    @JvmName("anghoeeovphdroxi")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    internal fun build(): AiFeatureGroupArgs = AiFeatureGroupArgs(
        bigQuery = bigQuery,
        description = description,
        labels = labels,
        name = name,
        project = project,
        region = region,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy