UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

132 lines 5.81 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SslCert = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Creates a new Google SQL SSL Cert on a Google SQL Instance. For more information, see the [official documentation](https://cloud.google.com/sql/), or the [JSON API](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/sslCerts). * * Read more about sensitive data in state. * * ## Example Usage * * Example creating a SQL Client Certificate. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as random from "@pulumi/random"; * * const dbNameSuffix = new random.index.Id("db_name_suffix", {byteLength: 4}); * const main = new gcp.sql.DatabaseInstance("main", { * name: `main-instance-${dbNameSuffix.hex}`, * databaseVersion: "MYSQL_5_7", * settings: { * tier: "db-f1-micro", * }, * }); * const clientCert = new gcp.sql.SslCert("client_cert", { * commonName: "client-name", * instance: main.name, * }); * ``` * * ## Import * * Since the contents of the certificate cannot be accessed after its creation, this resource cannot be imported. */ class SslCert extends pulumi.CustomResource { /** * Get an existing SslCert resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new SslCert(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:sql/sslCert:SslCert'; /** * Returns true if the given object is an instance of SslCert. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === SslCert.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cert"] = state?.cert; resourceInputs["certSerialNumber"] = state?.certSerialNumber; resourceInputs["commonName"] = state?.commonName; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["expirationTime"] = state?.expirationTime; resourceInputs["instance"] = state?.instance; resourceInputs["privateKey"] = state?.privateKey; resourceInputs["project"] = state?.project; resourceInputs["serverCaCert"] = state?.serverCaCert; resourceInputs["sha1Fingerprint"] = state?.sha1Fingerprint; } else { const args = argsOrState; if (args?.commonName === undefined && !opts.urn) { throw new Error("Missing required property 'commonName'"); } if (args?.instance === undefined && !opts.urn) { throw new Error("Missing required property 'instance'"); } resourceInputs["commonName"] = args?.commonName; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["instance"] = args?.instance; resourceInputs["project"] = args?.project; resourceInputs["cert"] = undefined /*out*/; resourceInputs["certSerialNumber"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["expirationTime"] = undefined /*out*/; resourceInputs["privateKey"] = undefined /*out*/; resourceInputs["serverCaCert"] = undefined /*out*/; resourceInputs["sha1Fingerprint"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["cert", "privateKey", "serverCaCert"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(SslCert.__pulumiType, name, resourceInputs, opts); } } exports.SslCert = SslCert; //# sourceMappingURL=sslCert.js.map