UNPKG

@pulumi/gcp

Version:

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

244 lines • 10.8 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.Organization = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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) * * ## 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 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}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.analyticsRegion : undefined; resourceInputs["apiConsumerDataEncryptionKeyName"] = state ? state.apiConsumerDataEncryptionKeyName : undefined; resourceInputs["apiConsumerDataLocation"] = state ? state.apiConsumerDataLocation : undefined; resourceInputs["apigeeProjectId"] = state ? state.apigeeProjectId : undefined; resourceInputs["authorizedNetwork"] = state ? state.authorizedNetwork : undefined; resourceInputs["billingType"] = state ? state.billingType : undefined; resourceInputs["caCertificate"] = state ? state.caCertificate : undefined; resourceInputs["controlPlaneEncryptionKeyName"] = state ? state.controlPlaneEncryptionKeyName : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["disableVpcPeering"] = state ? state.disableVpcPeering : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["properties"] = state ? state.properties : undefined; resourceInputs["retention"] = state ? state.retention : undefined; resourceInputs["runtimeDatabaseEncryptionKeyName"] = state ? state.runtimeDatabaseEncryptionKeyName : undefined; resourceInputs["runtimeType"] = state ? state.runtimeType : undefined; resourceInputs["subscriptionType"] = state ? state.subscriptionType : undefined; } else { const args = argsOrState; if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } resourceInputs["analyticsRegion"] = args ? args.analyticsRegion : undefined; resourceInputs["apiConsumerDataEncryptionKeyName"] = args ? args.apiConsumerDataEncryptionKeyName : undefined; resourceInputs["apiConsumerDataLocation"] = args ? args.apiConsumerDataLocation : undefined; resourceInputs["authorizedNetwork"] = args ? args.authorizedNetwork : undefined; resourceInputs["billingType"] = args ? args.billingType : undefined; resourceInputs["controlPlaneEncryptionKeyName"] = args ? args.controlPlaneEncryptionKeyName : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["disableVpcPeering"] = args ? args.disableVpcPeering : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["properties"] = args ? args.properties : undefined; resourceInputs["retention"] = args ? args.retention : undefined; resourceInputs["runtimeDatabaseEncryptionKeyName"] = args ? args.runtimeDatabaseEncryptionKeyName : undefined; resourceInputs["runtimeType"] = args ? args.runtimeType : undefined; 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; /** @internal */ Organization.__pulumiType = 'gcp:apigee/organization:Organization'; //# sourceMappingURL=organization.js.map