UNPKG

@pulumi/gcp

Version:

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

150 lines 5.98 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.EdgeCacheKeyset = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * EdgeCacheKeyset represents a collection of public keys used for validating signed requests. * * To get more information about EdgeCacheKeyset, see: * * * [API documentation](https://cloud.google.com/media-cdn/docs/reference/rest/v1/projects.locations.edgeCacheKeysets) * * How-to Guides * * [Create keysets](https://cloud.google.com/media-cdn/docs/create-keyset) * * ## Example Usage * * ### Network Services Edge Cache Keyset Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networkservices.EdgeCacheKeyset("default", { * name: "my-keyset", * description: "The default keyset", * publicKeys: [ * { * id: "my-public-key", * value: "FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY", * }, * { * id: "my-public-key-2", * value: "hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM", * }, * ], * }); * ``` * ### Network Services Edge Cache Keyset Dual Token * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const secret_basic = new gcp.secretmanager.Secret("secret-basic", { * secretId: "secret-name", * replication: { * auto: {}, * }, * }); * const secret_version_basic = new gcp.secretmanager.SecretVersion("secret-version-basic", { * secret: secret_basic.id, * secretData: "secret-data", * }); * const _default = new gcp.networkservices.EdgeCacheKeyset("default", { * name: "my-keyset", * description: "The default keyset", * publicKeys: [{ * id: "my-public-key", * managed: true, * }], * validationSharedKeys: [{ * secretVersion: secret_version_basic.id, * }], * }); * ``` * * ## Import * * EdgeCacheKeyset can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/global/edgeCacheKeysets/{{name}}` * * * `{{project}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, EdgeCacheKeyset can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset default projects/{{project}}/locations/global/edgeCacheKeysets/{{name}} * ``` * * ```sh * $ pulumi import gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset default {{project}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset default {{name}} * ``` */ class EdgeCacheKeyset extends pulumi.CustomResource { /** * Get an existing EdgeCacheKeyset 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 EdgeCacheKeyset(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of EdgeCacheKeyset. 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'] === EdgeCacheKeyset.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["publicKeys"] = state ? state.publicKeys : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["validationSharedKeys"] = state ? state.validationSharedKeys : undefined; } else { const args = argsOrState; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["publicKeys"] = args ? args.publicKeys : undefined; resourceInputs["validationSharedKeys"] = args ? args.validationSharedKeys : undefined; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(EdgeCacheKeyset.__pulumiType, name, resourceInputs, opts); } } exports.EdgeCacheKeyset = EdgeCacheKeyset; /** @internal */ EdgeCacheKeyset.__pulumiType = 'gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset'; //# sourceMappingURL=edgeCacheKeyset.js.map