UNPKG

@pulumi/gcp

Version:

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

290 lines • 11.7 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.Instance = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * An `Instance` is the runtime dataplane in Apigee. * * To get more information about Instance, see: * * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.instances/create) * * How-to Guides * * [Creating a runtime instance](https://cloud.google.com/apigee/docs/api-platform/get-started/create-instance) * * ## Example Usage * * ### Apigee Instance 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 apigeeOrg = new gcp.apigee.Organization("apigee_org", { * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * }, { * dependsOn: [apigeeVpcConnection], * }); * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", { * name: "my-instance-name", * location: "us-central1", * orgId: apigeeOrg.id, * }); * ``` * ### Apigee Instance Cidr Range * * ```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: 22, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const apigeeOrg = new gcp.apigee.Organization("apigee_org", { * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * }, { * dependsOn: [apigeeVpcConnection], * }); * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", { * name: "my-instance-name", * location: "us-central1", * orgId: apigeeOrg.id, * peeringCidrRange: "SLASH_22", * }); * ``` * ### Apigee Instance Ip Range * * ```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: 22, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const apigeeOrg = new gcp.apigee.Organization("apigee_org", { * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * }, { * dependsOn: [apigeeVpcConnection], * }); * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", { * name: "my-instance-name", * location: "us-central1", * orgId: apigeeOrg.id, * ipRange: "10.87.8.0/22", * }); * ``` * ### Apigee Instance 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 apigeeOrg = new gcp.apigee.Organization("apigee_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, * ], * }); * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", { * name: "my-instance-name", * location: "us-central1", * description: "Auto-managed Apigee Runtime Instance", * displayName: "my-instance-name", * orgId: apigeeOrg.id, * diskEncryptionKeyName: apigeeKey.id, * }); * ``` * * ## Import * * Instance can be imported using any of these accepted formats: * * * `{{org_id}}/instances/{{name}}` * * `{{org_id}}/{{name}}` * * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigee/instance:Instance default {{org_id}}/instances/{{name}} * $ pulumi import gcp:apigee/instance:Instance default {{org_id}}/{{name}} * ``` */ class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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 Instance(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:apigee/instance:Instance'; /** * Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessLoggingConfig"] = state?.accessLoggingConfig; resourceInputs["consumerAcceptLists"] = state?.consumerAcceptLists; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["diskEncryptionKeyName"] = state?.diskEncryptionKeyName; resourceInputs["displayName"] = state?.displayName; resourceInputs["host"] = state?.host; resourceInputs["ipRange"] = state?.ipRange; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["peeringCidrRange"] = state?.peeringCidrRange; resourceInputs["port"] = state?.port; resourceInputs["serviceAttachment"] = state?.serviceAttachment; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.orgId === undefined && !opts.urn) { throw new Error("Missing required property 'orgId'"); } resourceInputs["accessLoggingConfig"] = args?.accessLoggingConfig; resourceInputs["consumerAcceptLists"] = args?.consumerAcceptLists; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["diskEncryptionKeyName"] = args?.diskEncryptionKeyName; resourceInputs["displayName"] = args?.displayName; resourceInputs["ipRange"] = args?.ipRange; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["peeringCidrRange"] = args?.peeringCidrRange; resourceInputs["host"] = undefined /*out*/; resourceInputs["port"] = undefined /*out*/; resourceInputs["serviceAttachment"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Instance.__pulumiType, name, resourceInputs, opts); } } exports.Instance = Instance; //# sourceMappingURL=instance.js.map