@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
267 lines • 10.8 kB
JavaScript
;
// *** 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.Instance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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}}
* ```
*
* ```sh
* $ 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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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["consumerAcceptLists"] = state ? state.consumerAcceptLists : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["diskEncryptionKeyName"] = state ? state.diskEncryptionKeyName : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["ipRange"] = state ? state.ipRange : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["peeringCidrRange"] = state ? state.peeringCidrRange : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["serviceAttachment"] = state ? state.serviceAttachment : undefined;
}
else {
const args = argsOrState;
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.orgId === undefined) && !opts.urn) {
throw new Error("Missing required property 'orgId'");
}
resourceInputs["consumerAcceptLists"] = args ? args.consumerAcceptLists : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["diskEncryptionKeyName"] = args ? args.diskEncryptionKeyName : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["ipRange"] = args ? args.ipRange : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["peeringCidrRange"] = args ? args.peeringCidrRange : undefined;
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;
/** @internal */
Instance.__pulumiType = 'gcp:apigee/instance:Instance';
//# sourceMappingURL=instance.js.map