UNPKG

@pulumi/gcp

Version:

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

295 lines • 11.4 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.CaPool = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A CaPool represents a group of CertificateAuthorities that form a trust anchor. A CaPool can be used to manage * issuance policies for one or more CertificateAuthority resources and to rotate CA certificates in and out of the * trust anchor. * * To get more information about CaPool, see: * * * [API documentation](https://cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools) * * How-to Guides * * [Certificate Authority Service Overview](https://cloud.google.com/certificate-authority-service/docs/overview) * * ## Example Usage * * ### Privateca Capool Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.certificateauthority.CaPool("default", { * name: "my-pool", * location: "us-central1", * tier: "ENTERPRISE", * publishingOptions: { * publishCaCert: true, * publishCrl: true, * }, * labels: { * foo: "bar", * }, * }); * ``` * ### Privateca Capool All Fields * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const privatecaSa = new gcp.projects.ServiceIdentity("privateca_sa", {service: "privateca.googleapis.com"}); * const privatecaSaKeyuserEncrypterdecrypter = new gcp.kms.CryptoKeyIAMMember("privateca_sa_keyuser_encrypterdecrypter", { * cryptoKeyId: "projects/keys-project/locations/us-central1/keyRings/key-ring/cryptoKeys/crypto-key", * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: privatecaSa.member, * }); * const _default = new gcp.certificateauthority.CaPool("default", { * name: "my-pool", * location: "us-central1", * tier: "ENTERPRISE", * publishingOptions: { * publishCaCert: false, * publishCrl: true, * encodingFormat: "PEM", * }, * labels: { * foo: "bar", * }, * encryptionSpec: { * cloudKmsKey: "projects/keys-project/locations/us-central1/keyRings/key-ring/cryptoKeys/crypto-key", * }, * issuancePolicy: { * allowedKeyTypes: [ * { * ellipticCurve: { * signatureAlgorithm: "ECDSA_P256", * }, * }, * { * rsa: { * minModulusSize: "5", * maxModulusSize: "10", * }, * }, * ], * backdateDuration: "3600s", * maximumLifetime: "50000s", * allowedIssuanceModes: { * allowCsrBasedIssuance: true, * allowConfigBasedIssuance: true, * }, * identityConstraints: { * allowSubjectPassthrough: true, * allowSubjectAltNamesPassthrough: true, * celExpression: { * expression: "subject_alt_names.all(san, san.type == DNS || san.type == EMAIL )", * title: "My title", * }, * }, * baselineValues: { * aiaOcspServers: ["example.com"], * additionalExtensions: [{ * critical: true, * value: "asdf", * objectId: { * objectIdPaths: [ * 1, * 7, * ], * }, * }], * policyIds: [ * { * objectIdPaths: [ * 1, * 5, * ], * }, * { * objectIdPaths: [ * 1, * 5, * 7, * ], * }, * ], * caOptions: { * isCa: true, * maxIssuerPathLength: 10, * }, * keyUsage: { * baseKeyUsage: { * digitalSignature: true, * contentCommitment: true, * keyEncipherment: false, * dataEncipherment: true, * keyAgreement: true, * certSign: false, * crlSign: true, * decipherOnly: true, * }, * extendedKeyUsage: { * serverAuth: true, * clientAuth: false, * emailProtection: true, * codeSigning: true, * timeStamping: true, * }, * }, * nameConstraints: { * critical: true, * permittedDnsNames: [ * "*.example1.com", * "*.example2.com", * ], * excludedDnsNames: [ * "*.deny.example1.com", * "*.deny.example2.com", * ], * permittedIpRanges: [ * "10.0.0.0/8", * "11.0.0.0/8", * ], * excludedIpRanges: [ * "10.1.1.0/24", * "11.1.1.0/24", * ], * permittedEmailAddresses: [ * ".example1.com", * ".example2.com", * ], * excludedEmailAddresses: [ * ".deny.example1.com", * ".deny.example2.com", * ], * permittedUris: [ * ".example1.com", * ".example2.com", * ], * excludedUris: [ * ".deny.example1.com", * ".deny.example2.com", * ], * }, * }, * }, * }, { * dependsOn: [privatecaSaKeyuserEncrypterdecrypter], * }); * ``` * * ## Import * * CaPool can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/caPools/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, CaPool can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:certificateauthority/caPool:CaPool default projects/{{project}}/locations/{{location}}/caPools/{{name}} * $ pulumi import gcp:certificateauthority/caPool:CaPool default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:certificateauthority/caPool:CaPool default {{location}}/{{name}} * ``` */ class CaPool extends pulumi.CustomResource { /** * Get an existing CaPool 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 CaPool(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:certificateauthority/caPool:CaPool'; /** * Returns true if the given object is an instance of CaPool. 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'] === CaPool.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["encryptionSpec"] = state?.encryptionSpec; resourceInputs["issuancePolicy"] = state?.issuancePolicy; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["publishingOptions"] = state?.publishingOptions; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["tier"] = state?.tier; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.tier === undefined && !opts.urn) { throw new Error("Missing required property 'tier'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["encryptionSpec"] = args?.encryptionSpec; resourceInputs["issuancePolicy"] = args?.issuancePolicy; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["publishingOptions"] = args?.publishingOptions; resourceInputs["tier"] = args?.tier; 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(CaPool.__pulumiType, name, resourceInputs, opts); } } exports.CaPool = CaPool; //# sourceMappingURL=caPool.js.map