SourceRepresentationInstanceArgs

data class SourceRepresentationInstanceArgs(val caCertificate: Output<String>? = null, val clientCertificate: Output<String>? = null, val clientKey: Output<String>? = null, val databaseVersion: Output<String>? = null, val dumpFilePath: Output<String>? = null, val host: Output<String>? = null, val name: Output<String>? = null, val password: Output<String>? = null, val port: Output<Int>? = null, val project: Output<String>? = null, val region: Output<String>? = null, val username: Output<String>? = null) : ConvertibleToJava<SourceRepresentationInstanceArgs>

A source representation instance is a Cloud SQL instance that represents the source database server to the Cloud SQL replica. It is visible in the Cloud Console and appears the same as a regular Cloud SQL instance, but it contains no data, requires no configuration or maintenance, and does not affect billing. You cannot update the source representation instance.

Example Usage

Sql Source Representation Instance Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const instance = new gcp.sql.SourceRepresentationInstance("instance", {
name: "my-instance",
region: "us-central1",
databaseVersion: "MYSQL_8_0",
host: "10.20.30.40",
port: 3306,
username: "some-user",
password: "password-for-the-user",
dumpFilePath: "gs://replica-bucket/source-database.sql.gz",
});
import pulumi
import pulumi_gcp as gcp
instance = gcp.sql.SourceRepresentationInstance("instance",
name="my-instance",
region="us-central1",
database_version="MYSQL_8_0",
host="10.20.30.40",
port=3306,
username="some-user",
password="password-for-the-user",
dump_file_path="gs://replica-bucket/source-database.sql.gz")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var instance = new Gcp.Sql.SourceRepresentationInstance("instance", new()
{
Name = "my-instance",
Region = "us-central1",
DatabaseVersion = "MYSQL_8_0",
Host = "10.20.30.40",
Port = 3306,
Username = "some-user",
Password = "password-for-the-user",
DumpFilePath = "gs://replica-bucket/source-database.sql.gz",
});
});
package main
import (
"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 {
_, err := sql.NewSourceRepresentationInstance(ctx, "instance", &sql.SourceRepresentationInstanceArgs{
Name: pulumi.String("my-instance"),
Region: pulumi.String("us-central1"),
DatabaseVersion: pulumi.String("MYSQL_8_0"),
Host: pulumi.String("10.20.30.40"),
Port: pulumi.Int(3306),
Username: pulumi.String("some-user"),
Password: pulumi.String("password-for-the-user"),
DumpFilePath: pulumi.String("gs://replica-bucket/source-database.sql.gz"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.sql.SourceRepresentationInstance;
import com.pulumi.gcp.sql.SourceRepresentationInstanceArgs;
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 SourceRepresentationInstance("instance", SourceRepresentationInstanceArgs.builder()
.name("my-instance")
.region("us-central1")
.databaseVersion("MYSQL_8_0")
.host("10.20.30.40")
.port(3306)
.username("some-user")
.password("password-for-the-user")
.dumpFilePath("gs://replica-bucket/source-database.sql.gz")
.build());
}
}
resources:
instance:
type: gcp:sql:SourceRepresentationInstance
properties:
name: my-instance
region: us-central1
databaseVersion: MYSQL_8_0
host: 10.20.30.40
port: 3306
username: some-user
password: password-for-the-user
dumpFilePath: gs://replica-bucket/source-database.sql.gz

Sql Source Representation Instance Postgres

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const instance = new gcp.sql.SourceRepresentationInstance("instance", {
name: "my-instance",
region: "us-central1",
databaseVersion: "POSTGRES_9_6",
host: "10.20.30.40",
port: 3306,
username: "some-user",
password: "password-for-the-user",
dumpFilePath: "gs://replica-bucket/source-database.sql.gz",
});
import pulumi
import pulumi_gcp as gcp
instance = gcp.sql.SourceRepresentationInstance("instance",
name="my-instance",
region="us-central1",
database_version="POSTGRES_9_6",
host="10.20.30.40",
port=3306,
username="some-user",
password="password-for-the-user",
dump_file_path="gs://replica-bucket/source-database.sql.gz")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var instance = new Gcp.Sql.SourceRepresentationInstance("instance", new()
{
Name = "my-instance",
Region = "us-central1",
DatabaseVersion = "POSTGRES_9_6",
Host = "10.20.30.40",
Port = 3306,
Username = "some-user",
Password = "password-for-the-user",
DumpFilePath = "gs://replica-bucket/source-database.sql.gz",
});
});
package main
import (
"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 {
_, err := sql.NewSourceRepresentationInstance(ctx, "instance", &sql.SourceRepresentationInstanceArgs{
Name: pulumi.String("my-instance"),
Region: pulumi.String("us-central1"),
DatabaseVersion: pulumi.String("POSTGRES_9_6"),
Host: pulumi.String("10.20.30.40"),
Port: pulumi.Int(3306),
Username: pulumi.String("some-user"),
Password: pulumi.String("password-for-the-user"),
DumpFilePath: pulumi.String("gs://replica-bucket/source-database.sql.gz"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.sql.SourceRepresentationInstance;
import com.pulumi.gcp.sql.SourceRepresentationInstanceArgs;
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 SourceRepresentationInstance("instance", SourceRepresentationInstanceArgs.builder()
.name("my-instance")
.region("us-central1")
.databaseVersion("POSTGRES_9_6")
.host("10.20.30.40")
.port(3306)
.username("some-user")
.password("password-for-the-user")
.dumpFilePath("gs://replica-bucket/source-database.sql.gz")
.build());
}
}
resources:
instance:
type: gcp:sql:SourceRepresentationInstance
properties:
name: my-instance
region: us-central1
databaseVersion: POSTGRES_9_6
host: 10.20.30.40
port: 3306
username: some-user
password: password-for-the-user
dumpFilePath: gs://replica-bucket/source-database.sql.gz

Import

SourceRepresentationInstance can be imported using any of these accepted formats:

  • projects/{{project}}/instances/{{name}}

  • {{project}}/{{name}}

  • {{name}} When using the pulumi import command, SourceRepresentationInstance can be imported using one of the formats above. For example:

$ pulumi import gcp:sql/sourceRepresentationInstance:SourceRepresentationInstance default projects/{{project}}/instances/{{name}}
$ pulumi import gcp:sql/sourceRepresentationInstance:SourceRepresentationInstance default {{project}}/{{name}}
$ pulumi import gcp:sql/sourceRepresentationInstance:SourceRepresentationInstance default {{name}}

Constructors

Link copied to clipboard
constructor(caCertificate: Output<String>? = null, clientCertificate: Output<String>? = null, clientKey: Output<String>? = null, databaseVersion: Output<String>? = null, dumpFilePath: Output<String>? = null, host: Output<String>? = null, name: Output<String>? = null, password: Output<String>? = null, port: Output<Int>? = null, project: Output<String>? = null, region: Output<String>? = null, username: Output<String>? = null)

Properties

Link copied to clipboard
val caCertificate: Output<String>? = null

The CA certificate on the external server. Include only if SSL/TLS is used on the external server.

Link copied to clipboard
val clientCertificate: Output<String>? = null

The client certificate on the external server. Required only for server-client authentication. Include only if SSL/TLS is used on the external server.

Link copied to clipboard
val clientKey: Output<String>? = null

The private key file for the client certificate on the external server. Required only for server-client authentication. Include only if SSL/TLS is used on the external server.

Link copied to clipboard
val databaseVersion: Output<String>? = null

The MySQL version running on your source database server. Possible values are: MYSQL_5_6, MYSQL_5_7, MYSQL_8_0, POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13, POSTGRES_14.

Link copied to clipboard
val dumpFilePath: Output<String>? = null

A file in the bucket that contains the data from the external server.

Link copied to clipboard
val host: Output<String>? = null

The IPv4 address and port for the external server, or the the DNS address for the external server. If the external server is hosted on Cloud SQL, the port is 5432.

Link copied to clipboard
val name: Output<String>? = null

The name of the source representation instance. Use any valid Cloud SQL instance name.

Link copied to clipboard
val password: Output<String>? = null

The password for the replication user account. Note: This property is sensitive and will not be displayed in the plan.

Link copied to clipboard
val port: Output<Int>? = null

The externally accessible port for the source database server. Defaults to 3306.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val region: Output<String>? = null

The Region in which the created instance should reside. If it is not provided, the provider region is used.

Link copied to clipboard
val username: Output<String>? = null

The replication user account on the external server.

Functions

Link copied to clipboard
open override fun toJava(): SourceRepresentationInstanceArgs