SslCertArgs

data class SslCertArgs(val commonName: Output<String>? = null, val instance: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<SslCertArgs>

Creates a new Google SQL SSL Cert on a Google SQL Instance. For more information, see the official documentation, or the JSON API.

Note: All arguments including the private key will be stored in the raw state as plain-text

Example Usage

Example creating a SQL Client Certificate.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
import com.pulumi.gcp.sql.DatabaseInstance;
import com.pulumi.gcp.sql.DatabaseInstanceArgs;
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
import com.pulumi.gcp.sql.SslCert;
import com.pulumi.gcp.sql.SslCertArgs;
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 dbNameSuffix = new RandomId("dbNameSuffix", RandomIdArgs.builder()
.byteLength(4)
.build());
var main = new DatabaseInstance("main", DatabaseInstanceArgs.builder()
.databaseVersion("MYSQL_5_7")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-f1-micro")
.build())
.build());
var clientCert = new SslCert("clientCert", SslCertArgs.builder()
.commonName("client-name")
.instance(main.name())
.build());
}
}

Import

Since the contents of the certificate cannot be accessed after its creation, this resource cannot be imported.

Constructors

Link copied to clipboard
constructor(commonName: Output<String>? = null, instance: Output<String>? = null, project: Output<String>? = null)

Properties

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

The common name to be used in the certificate to identify the client. Constrained to a-zA-Z.-_ +. Changing this forces a new resource to be created.

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

The name of the Cloud SQL instance. Changing this forces a new resource to be created.

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.

Functions

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