@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
119 lines • 5.9 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.Function = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Allows management of [Yandex Cloud Function](https://cloud.yandex.com/docs/functions/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const test_function = new yandex.Function("test-function", {
* content: {
* zipFilename: "function.zip",
* },
* description: "any description",
* entrypoint: "main",
* executionTimeout: "10",
* memory: 128,
* runtime: "python37",
* serviceAccountId: "are1service2account3id",
* tags: ["my_tag"],
* userHash: "any_user_defined_string",
* });
* ```
*/
class Function extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["content"] = state ? state.content : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["entrypoint"] = state ? state.entrypoint : undefined;
resourceInputs["environment"] = state ? state.environment : undefined;
resourceInputs["executionTimeout"] = state ? state.executionTimeout : undefined;
resourceInputs["folderId"] = state ? state.folderId : undefined;
resourceInputs["imageSize"] = state ? state.imageSize : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["loggroupId"] = state ? state.loggroupId : undefined;
resourceInputs["memory"] = state ? state.memory : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["package"] = state ? state.package : undefined;
resourceInputs["runtime"] = state ? state.runtime : undefined;
resourceInputs["serviceAccountId"] = state ? state.serviceAccountId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["userHash"] = state ? state.userHash : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.entrypoint === undefined) && !opts.urn) {
throw new Error("Missing required property 'entrypoint'");
}
if ((!args || args.memory === undefined) && !opts.urn) {
throw new Error("Missing required property 'memory'");
}
if ((!args || args.runtime === undefined) && !opts.urn) {
throw new Error("Missing required property 'runtime'");
}
if ((!args || args.userHash === undefined) && !opts.urn) {
throw new Error("Missing required property 'userHash'");
}
resourceInputs["content"] = args ? args.content : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["entrypoint"] = args ? args.entrypoint : undefined;
resourceInputs["environment"] = args ? args.environment : undefined;
resourceInputs["executionTimeout"] = args ? args.executionTimeout : undefined;
resourceInputs["folderId"] = args ? args.folderId : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["memory"] = args ? args.memory : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["package"] = args ? args.package : undefined;
resourceInputs["runtime"] = args ? args.runtime : undefined;
resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["userHash"] = args ? args.userHash : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["imageSize"] = undefined /*out*/;
resourceInputs["loggroupId"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Function.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing Function 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 Function(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Function. 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'] === Function.__pulumiType;
}
}
exports.Function = Function;
/** @internal */
Function.__pulumiType = 'yandex:index/function:Function';
//# sourceMappingURL=function.js.map