UNPKG

@pulumi/gcp

Version:

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

229 lines • 9.58 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.BackendAuthenticationConfig = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * BackendAuthenticationConfig groups the TrustConfig together with other settings that control how the load balancer authenticates, and expresses its identity to the backend. * * To get more information about BackendAuthenticationConfig, see: * * How-to Guides * * [Backend mTLS](https://cloud.google.com/load-balancing/docs/backend-authenticated-tls-backend-mtls#backend-authentication-config) * * ## Example Usage * * ### Network Security Backend Authentication Config Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.BackendAuthenticationConfig("default", { * name: "my-backend-authentication-config", * labels: { * foo: "bar", * }, * description: "my description", * wellKnownRoots: "PUBLIC_ROOTS", * }); * ``` * ### Network Security Backend Authentication Config Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const certificate = new gcp.certificatemanager.Certificate("certificate", { * name: "my-certificate", * labels: { * foo: "bar", * }, * location: "global", * selfManaged: { * pemCertificate: std.file({ * input: "test-fixtures/cert.pem", * }).then(invoke => invoke.result), * pemPrivateKey: std.file({ * input: "test-fixtures/key.pem", * }).then(invoke => invoke.result), * }, * scope: "CLIENT_AUTH", * }); * const trustConfig = new gcp.certificatemanager.TrustConfig("trust_config", { * name: "my-trust-config", * description: "sample description for the trust config", * location: "global", * trustStores: [{ * trustAnchors: [{ * pemCertificate: std.file({ * input: "test-fixtures/cert.pem", * }).then(invoke => invoke.result), * }], * intermediateCas: [{ * pemCertificate: std.file({ * input: "test-fixtures/cert.pem", * }).then(invoke => invoke.result), * }], * }], * labels: { * foo: "bar", * }, * }); * const _default = new gcp.networksecurity.BackendAuthenticationConfig("default", { * name: "my-backend-authentication-config", * labels: { * bar: "foo", * }, * location: "global", * description: "my description", * wellKnownRoots: "PUBLIC_ROOTS", * clientCertificate: certificate.id, * trustConfig: trustConfig.id, * }); * ``` * ### Backend Service Tls Settings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const defaultHealthCheck = new gcp.compute.HealthCheck("default", { * name: "health-check", * httpHealthCheck: { * port: 80, * }, * }); * const defaultBackendAuthenticationConfig = new gcp.networksecurity.BackendAuthenticationConfig("default", { * name: "authentication", * wellKnownRoots: "PUBLIC_ROOTS", * }); * const _default = new gcp.compute.BackendService("default", { * name: "backend-service", * healthChecks: defaultHealthCheck.id, * loadBalancingScheme: "EXTERNAL_MANAGED", * protocol: "HTTPS", * tlsSettings: { * sni: "example.com", * subjectAltNames: [ * { * dnsName: "example.com", * }, * { * uniformResourceIdentifier: "https://example.com", * }, * ], * authenticationConfig: pulumi.interpolate`//networksecurity.googleapis.com/${defaultBackendAuthenticationConfig.id}`, * }, * }); * ``` * * ## Import * * BackendAuthenticationConfig can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/backendAuthenticationConfigs/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, BackendAuthenticationConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:networksecurity/backendAuthenticationConfig:BackendAuthenticationConfig default projects/{{project}}/locations/{{location}}/backendAuthenticationConfigs/{{name}} * $ pulumi import gcp:networksecurity/backendAuthenticationConfig:BackendAuthenticationConfig default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:networksecurity/backendAuthenticationConfig:BackendAuthenticationConfig default {{location}}/{{name}} * ``` */ class BackendAuthenticationConfig extends pulumi.CustomResource { /** * Get an existing BackendAuthenticationConfig 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 BackendAuthenticationConfig(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:networksecurity/backendAuthenticationConfig:BackendAuthenticationConfig'; /** * Returns true if the given object is an instance of BackendAuthenticationConfig. 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'] === BackendAuthenticationConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["clientCertificate"] = state?.clientCertificate; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["trustConfig"] = state?.trustConfig; resourceInputs["updateTime"] = state?.updateTime; resourceInputs["wellKnownRoots"] = state?.wellKnownRoots; } else { const args = argsOrState; resourceInputs["clientCertificate"] = args?.clientCertificate; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["trustConfig"] = args?.trustConfig; resourceInputs["wellKnownRoots"] = args?.wellKnownRoots; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(BackendAuthenticationConfig.__pulumiType, name, resourceInputs, opts); } } exports.BackendAuthenticationConfig = BackendAuthenticationConfig; //# sourceMappingURL=backendAuthenticationConfig.js.map