UNPKG

@pulumi/gcp

Version:

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

281 lines • 11.9 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.Organization = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * An `Organization` is the top-level container in Apigee. * * To get more information about Organization, see: * * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations) * * How-to Guides * * [Creating an API organization](https://cloud.google.com/apigee/docs/api-platform/get-started/create-org) * * Setting a custom endpoint (required for data residency) * * ## Example Usage * * ### Apigee Organization Cloud Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"}); * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", { * name: "apigee-range", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 16, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const org = new gcp.apigee.Organization("org", { * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * }, { * dependsOn: [apigeeVpcConnection], * }); * ``` * ### Apigee Organization Cloud Basic Disable Vpc Peering * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const org = new gcp.apigee.Organization("org", { * description: "Terraform-provisioned basic Apigee Org without VPC Peering.", * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * disableVpcPeering: true, * }); * ``` * ### Apigee Organization Cloud Basic Data Residency * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const org = new gcp.apigee.Organization("org", { * description: "Terraform-provisioned basic Apigee Org under European Union hosting jurisdiction.", * projectId: current.then(current => current.project), * apiConsumerDataLocation: "europe-west1", * billingType: "PAYG", * disableVpcPeering: true, * }); * ``` * ### Apigee Organization Cloud Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"}); * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", { * name: "apigee-range", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 16, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const apigeeKeyring = new gcp.kms.KeyRing("apigee_keyring", { * name: "apigee-keyring", * location: "us-central1", * }); * const apigeeKey = new gcp.kms.CryptoKey("apigee_key", { * name: "apigee-key", * keyRing: apigeeKeyring.id, * }); * const apigeeSa = new gcp.projects.ServiceIdentity("apigee_sa", { * project: project.projectId, * service: apigee.service, * }); * const apigeeSaKeyuser = new gcp.kms.CryptoKeyIAMMember("apigee_sa_keyuser", { * cryptoKeyId: apigeeKey.id, * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: apigeeSa.member, * }); * const org = new gcp.apigee.Organization("org", { * analyticsRegion: "us-central1", * displayName: "apigee-org", * description: "Auto-provisioned Apigee Org.", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * runtimeDatabaseEncryptionKeyName: apigeeKey.id, * }, { * dependsOn: [ * apigeeVpcConnection, * apigeeSaKeyuser, * ], * }); * ``` * ### Apigee Organization Cloud Full Disable Vpc Peering * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeKeyring = new gcp.kms.KeyRing("apigee_keyring", { * name: "apigee-keyring", * location: "us-central1", * }); * const apigeeKey = new gcp.kms.CryptoKey("apigee_key", { * name: "apigee-key", * keyRing: apigeeKeyring.id, * }); * const apigeeSa = new gcp.projects.ServiceIdentity("apigee_sa", { * project: project.projectId, * service: apigee.service, * }); * const apigeeSaKeyuser = new gcp.kms.CryptoKeyIAMMember("apigee_sa_keyuser", { * cryptoKeyId: apigeeKey.id, * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: apigeeSa.member, * }); * const org = new gcp.apigee.Organization("org", { * analyticsRegion: "us-central1", * displayName: "apigee-org", * description: "Terraform-provisioned Apigee Org without VPC Peering.", * projectId: current.then(current => current.project), * disableVpcPeering: true, * runtimeDatabaseEncryptionKeyName: apigeeKey.id, * }, { * dependsOn: [apigeeSaKeyuser], * }); * ``` * * ## Import * * Organization can be imported using any of these accepted formats: * * * `organizations/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, Organization can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigee/organization:Organization default organizations/{{name}} * $ pulumi import gcp:apigee/organization:Organization default {{name}} * ``` */ class Organization extends pulumi.CustomResource { /** * Get an existing Organization 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 Organization(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:apigee/organization:Organization'; /** * Returns true if the given object is an instance of Organization. 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'] === Organization.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["analyticsRegion"] = state?.analyticsRegion; resourceInputs["apiConsumerDataEncryptionKeyName"] = state?.apiConsumerDataEncryptionKeyName; resourceInputs["apiConsumerDataLocation"] = state?.apiConsumerDataLocation; resourceInputs["apigeeProjectId"] = state?.apigeeProjectId; resourceInputs["authorizedNetwork"] = state?.authorizedNetwork; resourceInputs["billingType"] = state?.billingType; resourceInputs["caCertificate"] = state?.caCertificate; resourceInputs["controlPlaneEncryptionKeyName"] = state?.controlPlaneEncryptionKeyName; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["disableVpcPeering"] = state?.disableVpcPeering; resourceInputs["displayName"] = state?.displayName; resourceInputs["name"] = state?.name; resourceInputs["projectId"] = state?.projectId; resourceInputs["properties"] = state?.properties; resourceInputs["retention"] = state?.retention; resourceInputs["runtimeDatabaseEncryptionKeyName"] = state?.runtimeDatabaseEncryptionKeyName; resourceInputs["runtimeType"] = state?.runtimeType; resourceInputs["subscriptionType"] = state?.subscriptionType; } else { const args = argsOrState; if (args?.projectId === undefined && !opts.urn) { throw new Error("Missing required property 'projectId'"); } resourceInputs["analyticsRegion"] = args?.analyticsRegion; resourceInputs["apiConsumerDataEncryptionKeyName"] = args?.apiConsumerDataEncryptionKeyName; resourceInputs["apiConsumerDataLocation"] = args?.apiConsumerDataLocation; resourceInputs["authorizedNetwork"] = args?.authorizedNetwork; resourceInputs["billingType"] = args?.billingType; resourceInputs["controlPlaneEncryptionKeyName"] = args?.controlPlaneEncryptionKeyName; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["disableVpcPeering"] = args?.disableVpcPeering; resourceInputs["displayName"] = args?.displayName; resourceInputs["projectId"] = args?.projectId; resourceInputs["properties"] = args?.properties; resourceInputs["retention"] = args?.retention; resourceInputs["runtimeDatabaseEncryptionKeyName"] = args?.runtimeDatabaseEncryptionKeyName; resourceInputs["runtimeType"] = args?.runtimeType; resourceInputs["apigeeProjectId"] = undefined /*out*/; resourceInputs["caCertificate"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["subscriptionType"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Organization.__pulumiType, name, resourceInputs, opts); } } exports.Organization = Organization; //# sourceMappingURL=organization.js.map