UNPKG

@pulumi/gcp

Version:

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

103 lines 4.25 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.BackendBucketSignedUrlKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A key for signing Cloud CDN signed URLs for BackendBuckets. * * To get more information about BackendBucketSignedUrlKey, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/backendBuckets) * * How-to Guides * * [Using Signed URLs](https://cloud.google.com/cdn/docs/using-signed-urls/) * * ## Example Usage * * ### Backend Bucket 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 bucket = new gcp.storage.Bucket("bucket", { * name: "test-storage-bucket", * location: "EU", * }); * const testBackend = new gcp.compute.BackendBucket("test_backend", { * name: "test-signed-backend-bucket", * description: "Contains beautiful images", * bucketName: bucket.name, * enableCdn: true, * }); * const backendKey = new gcp.compute.BackendBucketSignedUrlKey("backend_key", { * name: "test-key", * keyValue: urlSignature.b64Url, * backendBucket: testBackend.name, * }); * ``` * * ## Import * * This resource does not support import. */ class BackendBucketSignedUrlKey extends pulumi.CustomResource { /** * Get an existing BackendBucketSignedUrlKey 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 BackendBucketSignedUrlKey(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of BackendBucketSignedUrlKey. 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'] === BackendBucketSignedUrlKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["backendBucket"] = state?.backendBucket; resourceInputs["keyValue"] = state?.keyValue; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; } else { const args = argsOrState; if (args?.backendBucket === undefined && !opts.urn) { throw new Error("Missing required property 'backendBucket'"); } if (args?.keyValue === undefined && !opts.urn) { throw new Error("Missing required property 'keyValue'"); } resourceInputs["backendBucket"] = args?.backendBucket; 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(BackendBucketSignedUrlKey.__pulumiType, name, resourceInputs, opts); } } exports.BackendBucketSignedUrlKey = BackendBucketSignedUrlKey; /** @internal */ BackendBucketSignedUrlKey.__pulumiType = 'gcp:compute/backendBucketSignedUrlKey:BackendBucketSignedUrlKey'; //# sourceMappingURL=backendBucketSignedUrlKey.js.map