UNPKG

@pulumi/gcp

Version:

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

259 lines • 10.6 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.ApiProduct = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * An `ApiProduct` in Apigee. * * To get more information about ApiProduct, see: * * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.apiproducts#ApiProduct) * * How-to Guides * * [Creating an API product](https://cloud.google.com/apigee/docs/api-platform/publish/what-api-product) * * ## Example Usage * * ### Apigee Api Product 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", * location: "us-central1", * orgId: apigeeOrg.id, * peeringCidrRange: "SLASH_22", * }); * const basicApiProduct = new gcp.apigee.ApiProduct("basic_api_product", { * orgId: apigeeOrg.id, * name: "my-product", * displayName: "My Basic API Product", * approvalType: "auto", * }, { * dependsOn: [apigeeInstance], * }); * ``` * ### Apigee Api Product With Legacy Operation * * ```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", * location: "us-central1", * orgId: apigeeOrg.id, * peeringCidrRange: "SLASH_22", * }); * const envDev = new gcp.apigee.Environment("env_dev", { * name: "dev", * orgId: apigeeOrg.id, * }); * const testApigeeApi = new gcp.apigee.Api("test_apigee_api", { * name: "hello-world", * orgId: apigeeOrg.name, * configBundle: "apigee_api_bundle.zip", * }); * const fullApiProduct = new gcp.apigee.ApiProduct("full_api_product", { * orgId: apigeeOrg.id, * name: "my-product", * displayName: "My full API Product", * approvalType: "auto", * description: "This is a sample API Product created with Terraform.", * attributes: [{ * name: "access", * value: "private", * }], * environments: ["dev"], * proxies: ["hello-world"], * apiResources: [ * "/", * "/weather/**", * ], * scopes: [ * "read:weather", * "write:reports", * ], * quota: "10000", * quotaInterval: "1", * quotaTimeUnit: "day", * quotaCounterScope: "PROXY", * }, { * dependsOn: [ * apigeeInstance, * envDev, * testApigeeApi, * ], * }); * ``` * ## Import * * ApiProduct can be imported using any of these accepted formats: * * * `{{org_id}}/apiproducts/{{name}}` * * `{{org_id}}/{{name}}` * * When using the `pulumi import` command, ApiProduct can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigee/apiProduct:ApiProduct default {{org_id}}/apiproducts/{{name}} * $ pulumi import gcp:apigee/apiProduct:ApiProduct default {{org_id}}/{{name}} * ``` */ class ApiProduct extends pulumi.CustomResource { /** * Get an existing ApiProduct 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 ApiProduct(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:apigee/apiProduct:ApiProduct'; /** * Returns true if the given object is an instance of ApiProduct. 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'] === ApiProduct.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiResources"] = state?.apiResources; resourceInputs["approvalType"] = state?.approvalType; resourceInputs["attributes"] = state?.attributes; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["environments"] = state?.environments; resourceInputs["graphqlOperationGroup"] = state?.graphqlOperationGroup; resourceInputs["grpcOperationGroup"] = state?.grpcOperationGroup; resourceInputs["lastModifiedAt"] = state?.lastModifiedAt; resourceInputs["name"] = state?.name; resourceInputs["operationGroup"] = state?.operationGroup; resourceInputs["orgId"] = state?.orgId; resourceInputs["proxies"] = state?.proxies; resourceInputs["quota"] = state?.quota; resourceInputs["quotaCounterScope"] = state?.quotaCounterScope; resourceInputs["quotaInterval"] = state?.quotaInterval; resourceInputs["quotaTimeUnit"] = state?.quotaTimeUnit; resourceInputs["scopes"] = state?.scopes; resourceInputs["space"] = state?.space; } else { const args = argsOrState; if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.orgId === undefined && !opts.urn) { throw new Error("Missing required property 'orgId'"); } resourceInputs["apiResources"] = args?.apiResources; resourceInputs["approvalType"] = args?.approvalType; resourceInputs["attributes"] = args?.attributes; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["environments"] = args?.environments; resourceInputs["graphqlOperationGroup"] = args?.graphqlOperationGroup; resourceInputs["grpcOperationGroup"] = args?.grpcOperationGroup; resourceInputs["name"] = args?.name; resourceInputs["operationGroup"] = args?.operationGroup; resourceInputs["orgId"] = args?.orgId; resourceInputs["proxies"] = args?.proxies; resourceInputs["quota"] = args?.quota; resourceInputs["quotaCounterScope"] = args?.quotaCounterScope; resourceInputs["quotaInterval"] = args?.quotaInterval; resourceInputs["quotaTimeUnit"] = args?.quotaTimeUnit; resourceInputs["scopes"] = args?.scopes; resourceInputs["space"] = args?.space; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["lastModifiedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ApiProduct.__pulumiType, name, resourceInputs, opts); } } exports.ApiProduct = ApiProduct; //# sourceMappingURL=apiProduct.js.map