@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
115 lines • 5.44 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.ServerlessContainer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Allows management of Yandex Cloud Serverless Containers
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const test_container = new yandex.ServerlessContainer("test-container", {
* coreFraction: 100,
* cores: 1,
* description: "any description",
* executionTimeout: "15s",
* image: {
* url: "cr.yandex/yc/test-image:v1",
* },
* memory: 256,
* serviceAccountId: "are1service2account3id",
* });
* ```
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const test_container_with_digest = new yandex.ServerlessContainer("test-container-with-digest", {
* image: {
* digest: "sha256:e1d772fa8795adac847a2420c87d0d2e3d38fb02f168cab8c0b5fe2fb95c47f4",
* url: "cr.yandex/yc/test-image:v1",
* },
* memory: 128,
* });
* ```
*/
class ServerlessContainer extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["concurrency"] = state ? state.concurrency : undefined;
resourceInputs["coreFraction"] = state ? state.coreFraction : undefined;
resourceInputs["cores"] = state ? state.cores : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["executionTimeout"] = state ? state.executionTimeout : undefined;
resourceInputs["folderId"] = state ? state.folderId : undefined;
resourceInputs["image"] = state ? state.image : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["memory"] = state ? state.memory : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["revisionId"] = state ? state.revisionId : undefined;
resourceInputs["serviceAccountId"] = state ? state.serviceAccountId : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.image === undefined) && !opts.urn) {
throw new Error("Missing required property 'image'");
}
if ((!args || args.memory === undefined) && !opts.urn) {
throw new Error("Missing required property 'memory'");
}
resourceInputs["concurrency"] = args ? args.concurrency : undefined;
resourceInputs["coreFraction"] = args ? args.coreFraction : undefined;
resourceInputs["cores"] = args ? args.cores : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["executionTimeout"] = args ? args.executionTimeout : undefined;
resourceInputs["folderId"] = args ? args.folderId : undefined;
resourceInputs["image"] = args ? args.image : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["memory"] = args ? args.memory : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["revisionId"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServerlessContainer.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing ServerlessContainer 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 ServerlessContainer(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServerlessContainer. 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'] === ServerlessContainer.__pulumiType;
}
}
exports.ServerlessContainer = ServerlessContainer;
/** @internal */
ServerlessContainer.__pulumiType = 'yandex:index/serverlessContainer:ServerlessContainer';
//# sourceMappingURL=serverlessContainer.js.map