"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! ***
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, { ...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["accessLoggingConfig"] = state?.accessLoggingConfig;
            resourceInputs["consumerAcceptLists"] = state?.consumerAcceptLists;
            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["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;
/** @internal */
Instance.__pulumiType = 'gcp:apigee/instance:Instance';
//# sourceMappingURL=instance.js.map