UNPKG

@pulumi/gcp

Version:

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

133 lines 5.12 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.BackendServiceSignedUrlKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A key for signing Cloud CDN signed URLs for Backend Services. * * To get more information about BackendServiceSignedUrlKey, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) * * How-to Guides * * [Using Signed URLs](https://cloud.google.com/cdn/docs/using-signed-urls/) * * ## Example Usage * * ### Backend Service Signed Url Key * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as random from "@pulumi/random"; * * const urlSignature = new random.RandomId("url_signature", {byteLength: 16}); * const webserver = new gcp.compute.InstanceTemplate("webserver", { * name: "standard-webserver", * machineType: "e2-medium", * networkInterfaces: [{ * network: "default", * }], * disks: [{ * sourceImage: "debian-cloud/debian-11", * autoDelete: true, * boot: true, * }], * }); * const webservers = new gcp.compute.InstanceGroupManager("webservers", { * name: "my-webservers", * versions: [{ * instanceTemplate: webserver.id, * name: "primary", * }], * baseInstanceName: "webserver", * zone: "us-central1-f", * targetSize: 1, * }); * const _default = new gcp.compute.HttpHealthCheck("default", { * name: "test", * requestPath: "/", * checkIntervalSec: 1, * timeoutSec: 1, * }); * const exampleBackend = new gcp.compute.BackendService("example_backend", { * name: "my-backend-service", * description: "Our company website", * portName: "http", * protocol: "HTTP", * timeoutSec: 10, * enableCdn: true, * backends: [{ * group: webservers.instanceGroup, * }], * healthChecks: _default.id, * }); * const backendKey = new gcp.compute.BackendServiceSignedUrlKey("backend_key", { * name: "test-key", * keyValue: urlSignature.b64Url, * backendService: exampleBackend.name, * }); * ``` * * ## Import * * This resource does not support import. */ class BackendServiceSignedUrlKey extends pulumi.CustomResource { /** * Get an existing BackendServiceSignedUrlKey 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 BackendServiceSignedUrlKey(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of BackendServiceSignedUrlKey. 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'] === BackendServiceSignedUrlKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["backendService"] = state?.backendService; resourceInputs["keyValue"] = state?.keyValue; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; } else { const args = argsOrState; if (args?.backendService === undefined && !opts.urn) { throw new Error("Missing required property 'backendService'"); } if (args?.keyValue === undefined && !opts.urn) { throw new Error("Missing required property 'keyValue'"); } resourceInputs["backendService"] = args?.backendService; resourceInputs["keyValue"] = args?.keyValue ? pulumi.secret(args.keyValue) : undefined; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["keyValue"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(BackendServiceSignedUrlKey.__pulumiType, name, resourceInputs, opts); } } exports.BackendServiceSignedUrlKey = BackendServiceSignedUrlKey; /** @internal */ BackendServiceSignedUrlKey.__pulumiType = 'gcp:compute/backendServiceSignedUrlKey:BackendServiceSignedUrlKey'; //# sourceMappingURL=backendServiceSignedUrlKey.js.map