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

com.pulumi.gcp.datastream.kotlin.ConnectionProfile.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.datastream.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileBigqueryProfile
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileForwardSshConnectivity
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileGcsProfile
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileMysqlProfile
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileOracleProfile
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfilePostgresqlProfile
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfilePrivateConnectivity
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileSqlServerProfile
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.Map
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileBigqueryProfile.Companion.toKotlin as connectionProfileBigqueryProfileToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileForwardSshConnectivity.Companion.toKotlin as connectionProfileForwardSshConnectivityToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileGcsProfile.Companion.toKotlin as connectionProfileGcsProfileToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileMysqlProfile.Companion.toKotlin as connectionProfileMysqlProfileToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileOracleProfile.Companion.toKotlin as connectionProfileOracleProfileToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfilePostgresqlProfile.Companion.toKotlin as connectionProfilePostgresqlProfileToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfilePrivateConnectivity.Companion.toKotlin as connectionProfilePrivateConnectivityToKotlin
import com.pulumi.gcp.datastream.kotlin.outputs.ConnectionProfileSqlServerProfile.Companion.toKotlin as connectionProfileSqlServerProfileToKotlin

/**
 * Builder for [ConnectionProfile].
 */
@PulumiTagMarker
public class ConnectionProfileResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ConnectionProfileArgs = ConnectionProfileArgs()

    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 ConnectionProfileArgsBuilder.() -> Unit) {
        val builder = ConnectionProfileArgsBuilder()
        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(): ConnectionProfile {
        val builtJavaResource = com.pulumi.gcp.datastream.ConnectionProfile(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ConnectionProfile(builtJavaResource)
    }
}

/**
 * A set of reusable connection configurations to be used as a source or destination for a stream.
 * To get more information about ConnectionProfile, see:
 * * [API documentation](https://cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.connectionProfiles)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/datastream/docs/create-connection-profiles)
 * ## Example Usage
 * ### Datastream Connection Profile Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.datastream.ConnectionProfile("default", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     connectionProfileId: "my-profile",
 *     gcsProfile: {
 *         bucket: "my-bucket",
 *         rootPath: "/path",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.datastream.ConnectionProfile("default",
 *     display_name="Connection profile",
 *     location="us-central1",
 *     connection_profile_id="my-profile",
 *     gcs_profile={
 *         "bucket": "my-bucket",
 *         "root_path": "/path",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Datastream.ConnectionProfile("default", new()
 *     {
 *         DisplayName = "Connection profile",
 *         Location = "us-central1",
 *         ConnectionProfileId = "my-profile",
 *         GcsProfile = new Gcp.Datastream.Inputs.ConnectionProfileGcsProfileArgs
 *         {
 *             Bucket = "my-bucket",
 *             RootPath = "/path",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastream"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := datastream.NewConnectionProfile(ctx, "default", &datastream.ConnectionProfileArgs{
 * 			DisplayName:         pulumi.String("Connection profile"),
 * 			Location:            pulumi.String("us-central1"),
 * 			ConnectionProfileId: pulumi.String("my-profile"),
 * 			GcsProfile: &datastream.ConnectionProfileGcsProfileArgs{
 * 				Bucket:   pulumi.String("my-bucket"),
 * 				RootPath: pulumi.String("/path"),
 * 			},
 * 		})
 * 		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.datastream.ConnectionProfile;
 * import com.pulumi.gcp.datastream.ConnectionProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfileGcsProfileArgs;
 * 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 default_ = new ConnectionProfile("default", ConnectionProfileArgs.builder()
 *             .displayName("Connection profile")
 *             .location("us-central1")
 *             .connectionProfileId("my-profile")
 *             .gcsProfile(ConnectionProfileGcsProfileArgs.builder()
 *                 .bucket("my-bucket")
 *                 .rootPath("/path")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:datastream:ConnectionProfile
 *     properties:
 *       displayName: Connection profile
 *       location: us-central1
 *       connectionProfileId: my-profile
 *       gcsProfile:
 *         bucket: my-bucket
 *         rootPath: /path
 * ```
 * 
 * ### Datastream Connection Profile Postgresql Private Connection
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as random from "@pulumi/random";
 * const _default = new gcp.compute.Network("default", {name: "my-network"});
 * const privateConnection = new gcp.datastream.PrivateConnection("private_connection", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     privateConnectionId: "my-connection",
 *     labels: {
 *         key: "value",
 *     },
 *     vpcPeeringConfig: {
 *         vpc: _default.id,
 *         subnet: "10.0.0.0/29",
 *     },
 * });
 * const instance = new gcp.sql.DatabaseInstance("instance", {
 *     name: "my-instance",
 *     databaseVersion: "POSTGRES_14",
 *     region: "us-central1",
 *     settings: {
 *         tier: "db-f1-micro",
 *         ipConfiguration: {
 *             authorizedNetworks: [
 *                 {
 *                     value: "34.71.242.81",
 *                 },
 *                 {
 *                     value: "34.72.28.29",
 *                 },
 *                 {
 *                     value: "34.67.6.157",
 *                 },
 *                 {
 *                     value: "34.67.234.134",
 *                 },
 *                 {
 *                     value: "34.72.239.218",
 *                 },
 *             ],
 *         },
 *     },
 *     deletionProtection: true,
 * });
 * const db = new gcp.sql.Database("db", {
 *     instance: instance.name,
 *     name: "db",
 * });
 * const pwd = new random.RandomPassword("pwd", {
 *     length: 16,
 *     special: false,
 * });
 * const user = new gcp.sql.User("user", {
 *     name: "user",
 *     instance: instance.name,
 *     password: pwd.result,
 * });
 * const defaultConnectionProfile = new gcp.datastream.ConnectionProfile("default", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     connectionProfileId: "my-profile",
 *     postgresqlProfile: {
 *         hostname: instance.publicIpAddress,
 *         username: user.name,
 *         password: user.password,
 *         database: db.name,
 *     },
 *     privateConnectivity: {
 *         privateConnection: privateConnection.id,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_random as random
 * default = gcp.compute.Network("default", name="my-network")
 * private_connection = gcp.datastream.PrivateConnection("private_connection",
 *     display_name="Connection profile",
 *     location="us-central1",
 *     private_connection_id="my-connection",
 *     labels={
 *         "key": "value",
 *     },
 *     vpc_peering_config={
 *         "vpc": default.id,
 *         "subnet": "10.0.0.0/29",
 *     })
 * instance = gcp.sql.DatabaseInstance("instance",
 *     name="my-instance",
 *     database_version="POSTGRES_14",
 *     region="us-central1",
 *     settings={
 *         "tier": "db-f1-micro",
 *         "ip_configuration": {
 *             "authorized_networks": [
 *                 {
 *                     "value": "34.71.242.81",
 *                 },
 *                 {
 *                     "value": "34.72.28.29",
 *                 },
 *                 {
 *                     "value": "34.67.6.157",
 *                 },
 *                 {
 *                     "value": "34.67.234.134",
 *                 },
 *                 {
 *                     "value": "34.72.239.218",
 *                 },
 *             ],
 *         },
 *     },
 *     deletion_protection=True)
 * db = gcp.sql.Database("db",
 *     instance=instance.name,
 *     name="db")
 * pwd = random.RandomPassword("pwd",
 *     length=16,
 *     special=False)
 * user = gcp.sql.User("user",
 *     name="user",
 *     instance=instance.name,
 *     password=pwd.result)
 * default_connection_profile = gcp.datastream.ConnectionProfile("default",
 *     display_name="Connection profile",
 *     location="us-central1",
 *     connection_profile_id="my-profile",
 *     postgresql_profile={
 *         "hostname": instance.public_ip_address,
 *         "username": user.name,
 *         "password": user.password,
 *         "database": db.name,
 *     },
 *     private_connectivity={
 *         "private_connection": private_connection.id,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Compute.Network("default", new()
 *     {
 *         Name = "my-network",
 *     });
 *     var privateConnection = new Gcp.Datastream.PrivateConnection("private_connection", new()
 *     {
 *         DisplayName = "Connection profile",
 *         Location = "us-central1",
 *         PrivateConnectionId = "my-connection",
 *         Labels =
 *         {
 *             { "key", "value" },
 *         },
 *         VpcPeeringConfig = new Gcp.Datastream.Inputs.PrivateConnectionVpcPeeringConfigArgs
 *         {
 *             Vpc = @default.Id,
 *             Subnet = "10.0.0.0/29",
 *         },
 *     });
 *     var instance = new Gcp.Sql.DatabaseInstance("instance", new()
 *     {
 *         Name = "my-instance",
 *         DatabaseVersion = "POSTGRES_14",
 *         Region = "us-central1",
 *         Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
 *         {
 *             Tier = "db-f1-micro",
 *             IpConfiguration = new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationArgs
 *             {
 *                 AuthorizedNetworks = new[]
 *                 {
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.71.242.81",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.72.28.29",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.67.6.157",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.67.234.134",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.72.239.218",
 *                     },
 *                 },
 *             },
 *         },
 *         DeletionProtection = true,
 *     });
 *     var db = new Gcp.Sql.Database("db", new()
 *     {
 *         Instance = instance.Name,
 *         Name = "db",
 *     });
 *     var pwd = new Random.RandomPassword("pwd", new()
 *     {
 *         Length = 16,
 *         Special = false,
 *     });
 *     var user = new Gcp.Sql.User("user", new()
 *     {
 *         Name = "user",
 *         Instance = instance.Name,
 *         Password = pwd.Result,
 *     });
 *     var defaultConnectionProfile = new Gcp.Datastream.ConnectionProfile("default", new()
 *     {
 *         DisplayName = "Connection profile",
 *         Location = "us-central1",
 *         ConnectionProfileId = "my-profile",
 *         PostgresqlProfile = new Gcp.Datastream.Inputs.ConnectionProfilePostgresqlProfileArgs
 *         {
 *             Hostname = instance.PublicIpAddress,
 *             Username = user.Name,
 *             Password = user.Password,
 *             Database = db.Name,
 *         },
 *         PrivateConnectivity = new Gcp.Datastream.Inputs.ConnectionProfilePrivateConnectivityArgs
 *         {
 *             PrivateConnection = privateConnection.Id,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastream"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/sql"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
 * 			Name: pulumi.String("my-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		privateConnection, err := datastream.NewPrivateConnection(ctx, "private_connection", &datastream.PrivateConnectionArgs{
 * 			DisplayName:         pulumi.String("Connection profile"),
 * 			Location:            pulumi.String("us-central1"),
 * 			PrivateConnectionId: pulumi.String("my-connection"),
 * 			Labels: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 			VpcPeeringConfig: &datastream.PrivateConnectionVpcPeeringConfigArgs{
 * 				Vpc:    _default.ID(),
 * 				Subnet: pulumi.String("10.0.0.0/29"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		instance, err := sql.NewDatabaseInstance(ctx, "instance", &sql.DatabaseInstanceArgs{
 * 			Name:            pulumi.String("my-instance"),
 * 			DatabaseVersion: pulumi.String("POSTGRES_14"),
 * 			Region:          pulumi.String("us-central1"),
 * 			Settings: &sql.DatabaseInstanceSettingsArgs{
 * 				Tier: pulumi.String("db-f1-micro"),
 * 				IpConfiguration: &sql.DatabaseInstanceSettingsIpConfigurationArgs{
 * 					AuthorizedNetworks: sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArray{
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.71.242.81"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.72.28.29"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.67.6.157"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.67.234.134"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.72.239.218"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 			DeletionProtection: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		db, err := sql.NewDatabase(ctx, "db", &sql.DatabaseArgs{
 * 			Instance: instance.Name,
 * 			Name:     pulumi.String("db"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		pwd, err := random.NewRandomPassword(ctx, "pwd", &random.RandomPasswordArgs{
 * 			Length:  pulumi.Int(16),
 * 			Special: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		user, err := sql.NewUser(ctx, "user", &sql.UserArgs{
 * 			Name:     pulumi.String("user"),
 * 			Instance: instance.Name,
 * 			Password: pwd.Result,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datastream.NewConnectionProfile(ctx, "default", &datastream.ConnectionProfileArgs{
 * 			DisplayName:         pulumi.String("Connection profile"),
 * 			Location:            pulumi.String("us-central1"),
 * 			ConnectionProfileId: pulumi.String("my-profile"),
 * 			PostgresqlProfile: &datastream.ConnectionProfilePostgresqlProfileArgs{
 * 				Hostname: instance.PublicIpAddress,
 * 				Username: user.Name,
 * 				Password: user.Password,
 * 				Database: db.Name,
 * 			},
 * 			PrivateConnectivity: &datastream.ConnectionProfilePrivateConnectivityArgs{
 * 				PrivateConnection: privateConnection.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.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.datastream.PrivateConnection;
 * import com.pulumi.gcp.datastream.PrivateConnectionArgs;
 * import com.pulumi.gcp.datastream.inputs.PrivateConnectionVpcPeeringConfigArgs;
 * import com.pulumi.gcp.sql.DatabaseInstance;
 * import com.pulumi.gcp.sql.DatabaseInstanceArgs;
 * import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
 * import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsIpConfigurationArgs;
 * import com.pulumi.gcp.sql.Database;
 * import com.pulumi.gcp.sql.DatabaseArgs;
 * import com.pulumi.random.RandomPassword;
 * import com.pulumi.random.RandomPasswordArgs;
 * import com.pulumi.gcp.sql.User;
 * import com.pulumi.gcp.sql.UserArgs;
 * import com.pulumi.gcp.datastream.ConnectionProfile;
 * import com.pulumi.gcp.datastream.ConnectionProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfilePostgresqlProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfilePrivateConnectivityArgs;
 * 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 default_ = new Network("default", NetworkArgs.builder()
 *             .name("my-network")
 *             .build());
 *         var privateConnection = new PrivateConnection("privateConnection", PrivateConnectionArgs.builder()
 *             .displayName("Connection profile")
 *             .location("us-central1")
 *             .privateConnectionId("my-connection")
 *             .labels(Map.of("key", "value"))
 *             .vpcPeeringConfig(PrivateConnectionVpcPeeringConfigArgs.builder()
 *                 .vpc(default_.id())
 *                 .subnet("10.0.0.0/29")
 *                 .build())
 *             .build());
 *         var instance = new DatabaseInstance("instance", DatabaseInstanceArgs.builder()
 *             .name("my-instance")
 *             .databaseVersion("POSTGRES_14")
 *             .region("us-central1")
 *             .settings(DatabaseInstanceSettingsArgs.builder()
 *                 .tier("db-f1-micro")
 *                 .ipConfiguration(DatabaseInstanceSettingsIpConfigurationArgs.builder()
 *                     .authorizedNetworks(
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.71.242.81")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.72.28.29")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.67.6.157")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.67.234.134")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.72.239.218")
 *                             .build())
 *                     .build())
 *                 .build())
 *             .deletionProtection("true")
 *             .build());
 *         var db = new Database("db", DatabaseArgs.builder()
 *             .instance(instance.name())
 *             .name("db")
 *             .build());
 *         var pwd = new RandomPassword("pwd", RandomPasswordArgs.builder()
 *             .length(16)
 *             .special(false)
 *             .build());
 *         var user = new User("user", UserArgs.builder()
 *             .name("user")
 *             .instance(instance.name())
 *             .password(pwd.result())
 *             .build());
 *         var defaultConnectionProfile = new ConnectionProfile("defaultConnectionProfile", ConnectionProfileArgs.builder()
 *             .displayName("Connection profile")
 *             .location("us-central1")
 *             .connectionProfileId("my-profile")
 *             .postgresqlProfile(ConnectionProfilePostgresqlProfileArgs.builder()
 *                 .hostname(instance.publicIpAddress())
 *                 .username(user.name())
 *                 .password(user.password())
 *                 .database(db.name())
 *                 .build())
 *             .privateConnectivity(ConnectionProfilePrivateConnectivityArgs.builder()
 *                 .privateConnection(privateConnection.id())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   privateConnection:
 *     type: gcp:datastream:PrivateConnection
 *     name: private_connection
 *     properties:
 *       displayName: Connection profile
 *       location: us-central1
 *       privateConnectionId: my-connection
 *       labels:
 *         key: value
 *       vpcPeeringConfig:
 *         vpc: ${default.id}
 *         subnet: 10.0.0.0/29
 *   default:
 *     type: gcp:compute:Network
 *     properties:
 *       name: my-network
 *   instance:
 *     type: gcp:sql:DatabaseInstance
 *     properties:
 *       name: my-instance
 *       databaseVersion: POSTGRES_14
 *       region: us-central1
 *       settings:
 *         tier: db-f1-micro
 *         ipConfiguration:
 *           authorizedNetworks:
 *             - value: 34.71.242.81
 *             - value: 34.72.28.29
 *             - value: 34.67.6.157
 *             - value: 34.67.234.134
 *             - value: 34.72.239.218
 *       deletionProtection: 'true'
 *   db:
 *     type: gcp:sql:Database
 *     properties:
 *       instance: ${instance.name}
 *       name: db
 *   pwd:
 *     type: random:RandomPassword
 *     properties:
 *       length: 16
 *       special: false
 *   user:
 *     type: gcp:sql:User
 *     properties:
 *       name: user
 *       instance: ${instance.name}
 *       password: ${pwd.result}
 *   defaultConnectionProfile:
 *     type: gcp:datastream:ConnectionProfile
 *     name: default
 *     properties:
 *       displayName: Connection profile
 *       location: us-central1
 *       connectionProfileId: my-profile
 *       postgresqlProfile:
 *         hostname: ${instance.publicIpAddress}
 *         username: ${user.name}
 *         password: ${user.password}
 *         database: ${db.name}
 *       privateConnectivity:
 *         privateConnection: ${privateConnection.id}
 * ```
 * 
 * ### Datastream Connection Profile Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.datastream.ConnectionProfile("default", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     connectionProfileId: "my-profile",
 *     gcsProfile: {
 *         bucket: "my-bucket",
 *         rootPath: "/path",
 *     },
 *     forwardSshConnectivity: {
 *         hostname: "google.com",
 *         username: "my-user",
 *         port: 8022,
 *         password: "swordfish",
 *     },
 *     labels: {
 *         key: "value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.datastream.ConnectionProfile("default",
 *     display_name="Connection profile",
 *     location="us-central1",
 *     connection_profile_id="my-profile",
 *     gcs_profile={
 *         "bucket": "my-bucket",
 *         "root_path": "/path",
 *     },
 *     forward_ssh_connectivity={
 *         "hostname": "google.com",
 *         "username": "my-user",
 *         "port": 8022,
 *         "password": "swordfish",
 *     },
 *     labels={
 *         "key": "value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Datastream.ConnectionProfile("default", new()
 *     {
 *         DisplayName = "Connection profile",
 *         Location = "us-central1",
 *         ConnectionProfileId = "my-profile",
 *         GcsProfile = new Gcp.Datastream.Inputs.ConnectionProfileGcsProfileArgs
 *         {
 *             Bucket = "my-bucket",
 *             RootPath = "/path",
 *         },
 *         ForwardSshConnectivity = new Gcp.Datastream.Inputs.ConnectionProfileForwardSshConnectivityArgs
 *         {
 *             Hostname = "google.com",
 *             Username = "my-user",
 *             Port = 8022,
 *             Password = "swordfish",
 *         },
 *         Labels =
 *         {
 *             { "key", "value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastream"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := datastream.NewConnectionProfile(ctx, "default", &datastream.ConnectionProfileArgs{
 * 			DisplayName:         pulumi.String("Connection profile"),
 * 			Location:            pulumi.String("us-central1"),
 * 			ConnectionProfileId: pulumi.String("my-profile"),
 * 			GcsProfile: &datastream.ConnectionProfileGcsProfileArgs{
 * 				Bucket:   pulumi.String("my-bucket"),
 * 				RootPath: pulumi.String("/path"),
 * 			},
 * 			ForwardSshConnectivity: &datastream.ConnectionProfileForwardSshConnectivityArgs{
 * 				Hostname: pulumi.String("google.com"),
 * 				Username: pulumi.String("my-user"),
 * 				Port:     pulumi.Int(8022),
 * 				Password: pulumi.String("swordfish"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 		})
 * 		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.datastream.ConnectionProfile;
 * import com.pulumi.gcp.datastream.ConnectionProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfileGcsProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfileForwardSshConnectivityArgs;
 * 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 default_ = new ConnectionProfile("default", ConnectionProfileArgs.builder()
 *             .displayName("Connection profile")
 *             .location("us-central1")
 *             .connectionProfileId("my-profile")
 *             .gcsProfile(ConnectionProfileGcsProfileArgs.builder()
 *                 .bucket("my-bucket")
 *                 .rootPath("/path")
 *                 .build())
 *             .forwardSshConnectivity(ConnectionProfileForwardSshConnectivityArgs.builder()
 *                 .hostname("google.com")
 *                 .username("my-user")
 *                 .port(8022)
 *                 .password("swordfish")
 *                 .build())
 *             .labels(Map.of("key", "value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:datastream:ConnectionProfile
 *     properties:
 *       displayName: Connection profile
 *       location: us-central1
 *       connectionProfileId: my-profile
 *       gcsProfile:
 *         bucket: my-bucket
 *         rootPath: /path
 *       forwardSshConnectivity:
 *         hostname: google.com
 *         username: my-user
 *         port: 8022
 *         password: swordfish
 *       labels:
 *         key: value
 * ```
 * 
 * ### Datastream Connection Profile Postgres
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as random from "@pulumi/random";
 * const instance = new gcp.sql.DatabaseInstance("instance", {
 *     name: "my-instance",
 *     databaseVersion: "POSTGRES_14",
 *     region: "us-central1",
 *     settings: {
 *         tier: "db-f1-micro",
 *         ipConfiguration: {
 *             authorizedNetworks: [
 *                 {
 *                     value: "34.71.242.81",
 *                 },
 *                 {
 *                     value: "34.72.28.29",
 *                 },
 *                 {
 *                     value: "34.67.6.157",
 *                 },
 *                 {
 *                     value: "34.67.234.134",
 *                 },
 *                 {
 *                     value: "34.72.239.218",
 *                 },
 *             ],
 *         },
 *     },
 *     deletionProtection: true,
 * });
 * const db = new gcp.sql.Database("db", {
 *     instance: instance.name,
 *     name: "db",
 * });
 * const pwd = new random.RandomPassword("pwd", {
 *     length: 16,
 *     special: false,
 * });
 * const user = new gcp.sql.User("user", {
 *     name: "user",
 *     instance: instance.name,
 *     password: pwd.result,
 * });
 * const _default = new gcp.datastream.ConnectionProfile("default", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     connectionProfileId: "my-profile",
 *     postgresqlProfile: {
 *         hostname: instance.publicIpAddress,
 *         username: user.name,
 *         password: user.password,
 *         database: db.name,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_random as random
 * instance = gcp.sql.DatabaseInstance("instance",
 *     name="my-instance",
 *     database_version="POSTGRES_14",
 *     region="us-central1",
 *     settings={
 *         "tier": "db-f1-micro",
 *         "ip_configuration": {
 *             "authorized_networks": [
 *                 {
 *                     "value": "34.71.242.81",
 *                 },
 *                 {
 *                     "value": "34.72.28.29",
 *                 },
 *                 {
 *                     "value": "34.67.6.157",
 *                 },
 *                 {
 *                     "value": "34.67.234.134",
 *                 },
 *                 {
 *                     "value": "34.72.239.218",
 *                 },
 *             ],
 *         },
 *     },
 *     deletion_protection=True)
 * db = gcp.sql.Database("db",
 *     instance=instance.name,
 *     name="db")
 * pwd = random.RandomPassword("pwd",
 *     length=16,
 *     special=False)
 * user = gcp.sql.User("user",
 *     name="user",
 *     instance=instance.name,
 *     password=pwd.result)
 * default = gcp.datastream.ConnectionProfile("default",
 *     display_name="Connection profile",
 *     location="us-central1",
 *     connection_profile_id="my-profile",
 *     postgresql_profile={
 *         "hostname": instance.public_ip_address,
 *         "username": user.name,
 *         "password": user.password,
 *         "database": db.name,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.Sql.DatabaseInstance("instance", new()
 *     {
 *         Name = "my-instance",
 *         DatabaseVersion = "POSTGRES_14",
 *         Region = "us-central1",
 *         Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
 *         {
 *             Tier = "db-f1-micro",
 *             IpConfiguration = new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationArgs
 *             {
 *                 AuthorizedNetworks = new[]
 *                 {
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.71.242.81",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.72.28.29",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.67.6.157",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.67.234.134",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.72.239.218",
 *                     },
 *                 },
 *             },
 *         },
 *         DeletionProtection = true,
 *     });
 *     var db = new Gcp.Sql.Database("db", new()
 *     {
 *         Instance = instance.Name,
 *         Name = "db",
 *     });
 *     var pwd = new Random.RandomPassword("pwd", new()
 *     {
 *         Length = 16,
 *         Special = false,
 *     });
 *     var user = new Gcp.Sql.User("user", new()
 *     {
 *         Name = "user",
 *         Instance = instance.Name,
 *         Password = pwd.Result,
 *     });
 *     var @default = new Gcp.Datastream.ConnectionProfile("default", new()
 *     {
 *         DisplayName = "Connection profile",
 *         Location = "us-central1",
 *         ConnectionProfileId = "my-profile",
 *         PostgresqlProfile = new Gcp.Datastream.Inputs.ConnectionProfilePostgresqlProfileArgs
 *         {
 *             Hostname = instance.PublicIpAddress,
 *             Username = user.Name,
 *             Password = user.Password,
 *             Database = db.Name,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastream"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/sql"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		instance, err := sql.NewDatabaseInstance(ctx, "instance", &sql.DatabaseInstanceArgs{
 * 			Name:            pulumi.String("my-instance"),
 * 			DatabaseVersion: pulumi.String("POSTGRES_14"),
 * 			Region:          pulumi.String("us-central1"),
 * 			Settings: &sql.DatabaseInstanceSettingsArgs{
 * 				Tier: pulumi.String("db-f1-micro"),
 * 				IpConfiguration: &sql.DatabaseInstanceSettingsIpConfigurationArgs{
 * 					AuthorizedNetworks: sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArray{
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.71.242.81"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.72.28.29"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.67.6.157"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.67.234.134"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.72.239.218"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 			DeletionProtection: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		db, err := sql.NewDatabase(ctx, "db", &sql.DatabaseArgs{
 * 			Instance: instance.Name,
 * 			Name:     pulumi.String("db"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		pwd, err := random.NewRandomPassword(ctx, "pwd", &random.RandomPasswordArgs{
 * 			Length:  pulumi.Int(16),
 * 			Special: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		user, err := sql.NewUser(ctx, "user", &sql.UserArgs{
 * 			Name:     pulumi.String("user"),
 * 			Instance: instance.Name,
 * 			Password: pwd.Result,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datastream.NewConnectionProfile(ctx, "default", &datastream.ConnectionProfileArgs{
 * 			DisplayName:         pulumi.String("Connection profile"),
 * 			Location:            pulumi.String("us-central1"),
 * 			ConnectionProfileId: pulumi.String("my-profile"),
 * 			PostgresqlProfile: &datastream.ConnectionProfilePostgresqlProfileArgs{
 * 				Hostname: instance.PublicIpAddress,
 * 				Username: user.Name,
 * 				Password: user.Password,
 * 				Database: db.Name,
 * 			},
 * 		})
 * 		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.sql.DatabaseInstance;
 * import com.pulumi.gcp.sql.DatabaseInstanceArgs;
 * import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
 * import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsIpConfigurationArgs;
 * import com.pulumi.gcp.sql.Database;
 * import com.pulumi.gcp.sql.DatabaseArgs;
 * import com.pulumi.random.RandomPassword;
 * import com.pulumi.random.RandomPasswordArgs;
 * import com.pulumi.gcp.sql.User;
 * import com.pulumi.gcp.sql.UserArgs;
 * import com.pulumi.gcp.datastream.ConnectionProfile;
 * import com.pulumi.gcp.datastream.ConnectionProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfilePostgresqlProfileArgs;
 * 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 instance = new DatabaseInstance("instance", DatabaseInstanceArgs.builder()
 *             .name("my-instance")
 *             .databaseVersion("POSTGRES_14")
 *             .region("us-central1")
 *             .settings(DatabaseInstanceSettingsArgs.builder()
 *                 .tier("db-f1-micro")
 *                 .ipConfiguration(DatabaseInstanceSettingsIpConfigurationArgs.builder()
 *                     .authorizedNetworks(
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.71.242.81")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.72.28.29")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.67.6.157")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.67.234.134")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.72.239.218")
 *                             .build())
 *                     .build())
 *                 .build())
 *             .deletionProtection("true")
 *             .build());
 *         var db = new Database("db", DatabaseArgs.builder()
 *             .instance(instance.name())
 *             .name("db")
 *             .build());
 *         var pwd = new RandomPassword("pwd", RandomPasswordArgs.builder()
 *             .length(16)
 *             .special(false)
 *             .build());
 *         var user = new User("user", UserArgs.builder()
 *             .name("user")
 *             .instance(instance.name())
 *             .password(pwd.result())
 *             .build());
 *         var default_ = new ConnectionProfile("default", ConnectionProfileArgs.builder()
 *             .displayName("Connection profile")
 *             .location("us-central1")
 *             .connectionProfileId("my-profile")
 *             .postgresqlProfile(ConnectionProfilePostgresqlProfileArgs.builder()
 *                 .hostname(instance.publicIpAddress())
 *                 .username(user.name())
 *                 .password(user.password())
 *                 .database(db.name())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:sql:DatabaseInstance
 *     properties:
 *       name: my-instance
 *       databaseVersion: POSTGRES_14
 *       region: us-central1
 *       settings:
 *         tier: db-f1-micro
 *         ipConfiguration:
 *           authorizedNetworks:
 *             - value: 34.71.242.81
 *             - value: 34.72.28.29
 *             - value: 34.67.6.157
 *             - value: 34.67.234.134
 *             - value: 34.72.239.218
 *       deletionProtection: 'true'
 *   db:
 *     type: gcp:sql:Database
 *     properties:
 *       instance: ${instance.name}
 *       name: db
 *   pwd:
 *     type: random:RandomPassword
 *     properties:
 *       length: 16
 *       special: false
 *   user:
 *     type: gcp:sql:User
 *     properties:
 *       name: user
 *       instance: ${instance.name}
 *       password: ${pwd.result}
 *   default:
 *     type: gcp:datastream:ConnectionProfile
 *     properties:
 *       displayName: Connection profile
 *       location: us-central1
 *       connectionProfileId: my-profile
 *       postgresqlProfile:
 *         hostname: ${instance.publicIpAddress}
 *         username: ${user.name}
 *         password: ${user.password}
 *         database: ${db.name}
 * ```
 * 
 * ### Datastream Connection Profile Sql Server
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const instance = new gcp.sql.DatabaseInstance("instance", {
 *     name: "sql-server",
 *     databaseVersion: "SQLSERVER_2019_STANDARD",
 *     region: "us-central1",
 *     rootPassword: "root-password",
 *     deletionProtection: true,
 *     settings: {
 *         tier: "db-custom-2-4096",
 *         ipConfiguration: {
 *             authorizedNetworks: [
 *                 {
 *                     value: "34.71.242.81",
 *                 },
 *                 {
 *                     value: "34.72.28.29",
 *                 },
 *                 {
 *                     value: "34.67.6.157",
 *                 },
 *                 {
 *                     value: "34.67.234.134",
 *                 },
 *                 {
 *                     value: "34.72.239.218",
 *                 },
 *             ],
 *         },
 *     },
 * });
 * const db = new gcp.sql.Database("db", {
 *     name: "db",
 *     instance: instance.name,
 * });
 * const user = new gcp.sql.User("user", {
 *     name: "user",
 *     instance: instance.name,
 *     password: "password",
 * });
 * const _default = new gcp.datastream.ConnectionProfile("default", {
 *     displayName: "SQL Server Source",
 *     location: "us-central1",
 *     connectionProfileId: "source-profile",
 *     sqlServerProfile: {
 *         hostname: instance.publicIpAddress,
 *         port: 1433,
 *         username: user.name,
 *         password: user.password,
 *         database: db.name,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * instance = gcp.sql.DatabaseInstance("instance",
 *     name="sql-server",
 *     database_version="SQLSERVER_2019_STANDARD",
 *     region="us-central1",
 *     root_password="root-password",
 *     deletion_protection=True,
 *     settings={
 *         "tier": "db-custom-2-4096",
 *         "ip_configuration": {
 *             "authorized_networks": [
 *                 {
 *                     "value": "34.71.242.81",
 *                 },
 *                 {
 *                     "value": "34.72.28.29",
 *                 },
 *                 {
 *                     "value": "34.67.6.157",
 *                 },
 *                 {
 *                     "value": "34.67.234.134",
 *                 },
 *                 {
 *                     "value": "34.72.239.218",
 *                 },
 *             ],
 *         },
 *     })
 * db = gcp.sql.Database("db",
 *     name="db",
 *     instance=instance.name)
 * user = gcp.sql.User("user",
 *     name="user",
 *     instance=instance.name,
 *     password="password")
 * default = gcp.datastream.ConnectionProfile("default",
 *     display_name="SQL Server Source",
 *     location="us-central1",
 *     connection_profile_id="source-profile",
 *     sql_server_profile={
 *         "hostname": instance.public_ip_address,
 *         "port": 1433,
 *         "username": user.name,
 *         "password": user.password,
 *         "database": db.name,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instance = new Gcp.Sql.DatabaseInstance("instance", new()
 *     {
 *         Name = "sql-server",
 *         DatabaseVersion = "SQLSERVER_2019_STANDARD",
 *         Region = "us-central1",
 *         RootPassword = "root-password",
 *         DeletionProtection = true,
 *         Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
 *         {
 *             Tier = "db-custom-2-4096",
 *             IpConfiguration = new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationArgs
 *             {
 *                 AuthorizedNetworks = new[]
 *                 {
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.71.242.81",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.72.28.29",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.67.6.157",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.67.234.134",
 *                     },
 *                     new Gcp.Sql.Inputs.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs
 *                     {
 *                         Value = "34.72.239.218",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var db = new Gcp.Sql.Database("db", new()
 *     {
 *         Name = "db",
 *         Instance = instance.Name,
 *     });
 *     var user = new Gcp.Sql.User("user", new()
 *     {
 *         Name = "user",
 *         Instance = instance.Name,
 *         Password = "password",
 *     });
 *     var @default = new Gcp.Datastream.ConnectionProfile("default", new()
 *     {
 *         DisplayName = "SQL Server Source",
 *         Location = "us-central1",
 *         ConnectionProfileId = "source-profile",
 *         SqlServerProfile = new Gcp.Datastream.Inputs.ConnectionProfileSqlServerProfileArgs
 *         {
 *             Hostname = instance.PublicIpAddress,
 *             Port = 1433,
 *             Username = user.Name,
 *             Password = user.Password,
 *             Database = db.Name,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastream"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/sql"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		instance, err := sql.NewDatabaseInstance(ctx, "instance", &sql.DatabaseInstanceArgs{
 * 			Name:               pulumi.String("sql-server"),
 * 			DatabaseVersion:    pulumi.String("SQLSERVER_2019_STANDARD"),
 * 			Region:             pulumi.String("us-central1"),
 * 			RootPassword:       pulumi.String("root-password"),
 * 			DeletionProtection: pulumi.Bool(true),
 * 			Settings: &sql.DatabaseInstanceSettingsArgs{
 * 				Tier: pulumi.String("db-custom-2-4096"),
 * 				IpConfiguration: &sql.DatabaseInstanceSettingsIpConfigurationArgs{
 * 					AuthorizedNetworks: sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArray{
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.71.242.81"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.72.28.29"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.67.6.157"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.67.234.134"),
 * 						},
 * 						&sql.DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs{
 * 							Value: pulumi.String("34.72.239.218"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		db, err := sql.NewDatabase(ctx, "db", &sql.DatabaseArgs{
 * 			Name:     pulumi.String("db"),
 * 			Instance: instance.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		user, err := sql.NewUser(ctx, "user", &sql.UserArgs{
 * 			Name:     pulumi.String("user"),
 * 			Instance: instance.Name,
 * 			Password: pulumi.String("password"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datastream.NewConnectionProfile(ctx, "default", &datastream.ConnectionProfileArgs{
 * 			DisplayName:         pulumi.String("SQL Server Source"),
 * 			Location:            pulumi.String("us-central1"),
 * 			ConnectionProfileId: pulumi.String("source-profile"),
 * 			SqlServerProfile: &datastream.ConnectionProfileSqlServerProfileArgs{
 * 				Hostname: instance.PublicIpAddress,
 * 				Port:     pulumi.Int(1433),
 * 				Username: user.Name,
 * 				Password: user.Password,
 * 				Database: db.Name,
 * 			},
 * 		})
 * 		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.sql.DatabaseInstance;
 * import com.pulumi.gcp.sql.DatabaseInstanceArgs;
 * import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
 * import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsIpConfigurationArgs;
 * import com.pulumi.gcp.sql.Database;
 * import com.pulumi.gcp.sql.DatabaseArgs;
 * import com.pulumi.gcp.sql.User;
 * import com.pulumi.gcp.sql.UserArgs;
 * import com.pulumi.gcp.datastream.ConnectionProfile;
 * import com.pulumi.gcp.datastream.ConnectionProfileArgs;
 * import com.pulumi.gcp.datastream.inputs.ConnectionProfileSqlServerProfileArgs;
 * 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 instance = new DatabaseInstance("instance", DatabaseInstanceArgs.builder()
 *             .name("sql-server")
 *             .databaseVersion("SQLSERVER_2019_STANDARD")
 *             .region("us-central1")
 *             .rootPassword("root-password")
 *             .deletionProtection("true")
 *             .settings(DatabaseInstanceSettingsArgs.builder()
 *                 .tier("db-custom-2-4096")
 *                 .ipConfiguration(DatabaseInstanceSettingsIpConfigurationArgs.builder()
 *                     .authorizedNetworks(
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.71.242.81")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.72.28.29")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.67.6.157")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.67.234.134")
 *                             .build(),
 *                         DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs.builder()
 *                             .value("34.72.239.218")
 *                             .build())
 *                     .build())
 *                 .build())
 *             .build());
 *         var db = new Database("db", DatabaseArgs.builder()
 *             .name("db")
 *             .instance(instance.name())
 *             .build());
 *         var user = new User("user", UserArgs.builder()
 *             .name("user")
 *             .instance(instance.name())
 *             .password("password")
 *             .build());
 *         var default_ = new ConnectionProfile("default", ConnectionProfileArgs.builder()
 *             .displayName("SQL Server Source")
 *             .location("us-central1")
 *             .connectionProfileId("source-profile")
 *             .sqlServerProfile(ConnectionProfileSqlServerProfileArgs.builder()
 *                 .hostname(instance.publicIpAddress())
 *                 .port(1433)
 *                 .username(user.name())
 *                 .password(user.password())
 *                 .database(db.name())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   instance:
 *     type: gcp:sql:DatabaseInstance
 *     properties:
 *       name: sql-server
 *       databaseVersion: SQLSERVER_2019_STANDARD
 *       region: us-central1
 *       rootPassword: root-password
 *       deletionProtection: 'true'
 *       settings:
 *         tier: db-custom-2-4096
 *         ipConfiguration:
 *           authorizedNetworks:
 *             - value: 34.71.242.81
 *             - value: 34.72.28.29
 *             - value: 34.67.6.157
 *             - value: 34.67.234.134
 *             - value: 34.72.239.218
 *   db:
 *     type: gcp:sql:Database
 *     properties:
 *       name: db
 *       instance: ${instance.name}
 *   user:
 *     type: gcp:sql:User
 *     properties:
 *       name: user
 *       instance: ${instance.name}
 *       password: password
 *   default:
 *     type: gcp:datastream:ConnectionProfile
 *     properties:
 *       displayName: SQL Server Source
 *       location: us-central1
 *       connectionProfileId: source-profile
 *       sqlServerProfile:
 *         hostname: ${instance.publicIpAddress}
 *         port: 1433
 *         username: ${user.name}
 *         password: ${user.password}
 *         database: ${db.name}
 * ```
 * 
 * ## Import
 * ConnectionProfile can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/connectionProfiles/{{connection_profile_id}}`
 * * `{{project}}/{{location}}/{{connection_profile_id}}`
 * * `{{location}}/{{connection_profile_id}}`
 * When using the `pulumi import` command, ConnectionProfile can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:datastream/connectionProfile:ConnectionProfile default projects/{{project}}/locations/{{location}}/connectionProfiles/{{connection_profile_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:datastream/connectionProfile:ConnectionProfile default {{project}}/{{location}}/{{connection_profile_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:datastream/connectionProfile:ConnectionProfile default {{location}}/{{connection_profile_id}}
 * ```
 */
public class ConnectionProfile internal constructor(
    override val javaResource: com.pulumi.gcp.datastream.ConnectionProfile,
) : KotlinCustomResource(javaResource, ConnectionProfileMapper) {
    /**
     * BigQuery warehouse profile.
     */
    public val bigqueryProfile: Output?
        get() = javaResource.bigqueryProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> connectionProfileBigqueryProfileToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The connection profile identifier.
     */
    public val connectionProfileId: Output
        get() = javaResource.connectionProfileId().applyValue({ args0 -> args0 })

    /**
     * Create the connection profile without validating it.
     */
    public val createWithoutValidation: Output?
        get() = javaResource.createWithoutValidation().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Display name.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> 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>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Forward SSH tunnel connectivity.
     * Structure is documented below.
     */
    public val forwardSshConnectivity: Output?
        get() = javaResource.forwardSshConnectivity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    connectionProfileForwardSshConnectivityToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Cloud Storage bucket profile.
     * Structure is documented below.
     */
    public val gcsProfile: Output?
        get() = javaResource.gcsProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    connectionProfileGcsProfileToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Labels.
     * **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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The name of the location this connection profile is located in.
     * - - -
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * MySQL database profile.
     * Structure is documented below.
     */
    public val mysqlProfile: Output?
        get() = javaResource.mysqlProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    connectionProfileMysqlProfileToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The resource's name.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Oracle database profile.
     * Structure is documented below.
     */
    public val oracleProfile: Output?
        get() = javaResource.oracleProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> connectionProfileOracleProfileToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * PostgreSQL database profile.
     * Structure is documented below.
     */
    public val postgresqlProfile: Output?
        get() = javaResource.postgresqlProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> connectionProfilePostgresqlProfileToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Private connectivity.
     * Structure is documented below.
     */
    public val privateConnectivity: Output?
        get() = javaResource.privateConnectivity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> connectionProfilePrivateConnectivityToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * SQL Server database profile.
     * Structure is documented below.
     */
    public val sqlServerProfile: Output?
        get() = javaResource.sqlServerProfile().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> connectionProfileSqlServerProfileToKotlin(args0) })
            }).orElse(null)
        })
}

public object ConnectionProfileMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.datastream.ConnectionProfile::class == javaResource::class

    override fun map(javaResource: Resource): ConnectionProfile = ConnectionProfile(
        javaResource as
            com.pulumi.gcp.datastream.ConnectionProfile,
    )
}

/**
 * @see [ConnectionProfile].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ConnectionProfile].
 */
public suspend fun connectionProfile(
    name: String,
    block: suspend ConnectionProfileResourceBuilder.() -> Unit,
): ConnectionProfile {
    val builder = ConnectionProfileResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ConnectionProfile].
 * @param name The _unique_ name of the resulting resource.
 */
public fun connectionProfile(name: String): ConnectionProfile {
    val builder = ConnectionProfileResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy