@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
120 lines • 4.77 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.ApiGateway = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Allows management of [Yandex Cloud API Gateway](https://cloud.yandex.com/docs/api-gateway/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const test_api_gateway = new yandex.ApiGateway("test-api-gateway", {
* description: "any description",
* labels: {
* label: "label",
* "empty-label": "",
* },
* spec: `openapi: "3.0.0"
* info:
* version: 1.0.0
* title: Test API
* paths:
* /hello:
* get:
* summary: Say hello
* operationId: hello
* parameters:
* - name: user
* in: query
* description: User name to appear in greetings
* required: false
* schema:
* type: string
* default: 'world'
* responses:
* '200':
* description: Greeting
* content:
* 'text/plain':
* schema:
* type: "string"
* x-yc-apigateway-integration:
* type: dummy
* http_code: 200
* http_headers:
* 'Content-Type': "text/plain"
* content:
* 'text/plain': "Hello again, {user}!\n"
* `,
* });
* ```
*/
class ApiGateway extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["domain"] = state ? state.domain : undefined;
resourceInputs["folderId"] = state ? state.folderId : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["logGroupId"] = state ? state.logGroupId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["spec"] = state ? state.spec : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["userDomains"] = state ? state.userDomains : undefined;
}
else {
const args = argsOrState;
if ((!args || args.spec === undefined) && !opts.urn) {
throw new Error("Missing required property 'spec'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["folderId"] = args ? args.folderId : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["spec"] = args ? args.spec : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["domain"] = undefined /*out*/;
resourceInputs["logGroupId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["userDomains"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ApiGateway.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing ApiGateway 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 ApiGateway(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ApiGateway. 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'] === ApiGateway.__pulumiType;
}
}
exports.ApiGateway = ApiGateway;
/** @internal */
ApiGateway.__pulumiType = 'yandex:index/apiGateway:ApiGateway';
//# sourceMappingURL=apiGateway.js.map