Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

Function

Allows management of Yandex Cloud Function

Example Usage

using Pulumi;
using Yandex = Pulumi.Yandex;

class MyStack : Stack
{
    public MyStack()
    {
        var test_function = new Yandex.Function("test-function", new Yandex.FunctionArgs
        {
            Content = new Yandex.Inputs.FunctionContentArgs
            {
                ZipFilename = "function.zip",
            },
            Description = "any description",
            Entrypoint = "main",
            ExecutionTimeout = "10",
            Memory = 128,
            Runtime = "python37",
            ServiceAccountId = "are1service2account3id",
            Tags = 
            {
                "my_tag",
            },
            UserHash = "any_user_defined_string",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yandex.NewFunction(ctx, "test_function", &yandex.FunctionArgs{
			Content: &FunctionContentArgs{
				ZipFilename: pulumi.String("function.zip"),
			},
			Description:      pulumi.String("any description"),
			Entrypoint:       pulumi.String("main"),
			ExecutionTimeout: pulumi.String("10"),
			Memory:           pulumi.Int(128),
			Runtime:          pulumi.String("python37"),
			ServiceAccountId: pulumi.String("are1service2account3id"),
			Tags: pulumi.StringArray{
				pulumi.String("my_tag"),
			},
			UserHash: pulumi.String("any_user_defined_string"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_yandex as yandex

test_function = yandex.Function("test-function",
    content=yandex.FunctionContentArgs(
        zip_filename="function.zip",
    ),
    description="any description",
    entrypoint="main",
    execution_timeout="10",
    memory=128,
    runtime="python37",
    service_account_id="are1service2account3id",
    tags=["my_tag"],
    user_hash="any_user_defined_string")
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",
});

Create a Function Resource

new Function(name: string, args: FunctionArgs, opts?: CustomResourceOptions);
@overload
def Function(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             content: Optional[FunctionContentArgs] = None,
             description: Optional[str] = None,
             entrypoint: Optional[str] = None,
             environment: Optional[Mapping[str, str]] = None,
             execution_timeout: Optional[str] = None,
             folder_id: Optional[str] = None,
             labels: Optional[Mapping[str, str]] = None,
             memory: Optional[int] = None,
             name: Optional[str] = None,
             package: Optional[FunctionPackageArgs] = None,
             runtime: Optional[str] = None,
             service_account_id: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             user_hash: Optional[str] = None)
@overload
def Function(resource_name: str,
             args: FunctionArgs,
             opts: Optional[ResourceOptions] = None)
func NewFunction(ctx *Context, name string, args FunctionArgs, opts ...ResourceOption) (*Function, error)
public Function(string name, FunctionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Function Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Function resource accepts the following input properties:

Entrypoint string
Entrypoint for Yandex Cloud Function
Memory int
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
Runtime string
Runtime for Yandex Cloud Function
UserHash string
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
Content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
Description string
Description of the Yandex Cloud Function
Environment Dictionary<string, string>
A set of key/value environment variables for Yandex Cloud Function
ExecutionTimeout string
Execution timeout in seconds for Yandex Cloud Function
FolderId string
Folder ID for the Yandex Cloud Function
Labels Dictionary<string, string>
A set of key/value label pairs to assign to the Yandex Cloud Function
Name string
Yandex Cloud Function name used to define trigger
Package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
ServiceAccountId string
Service account ID for Yandex Cloud Function
Tags List<string>
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
Entrypoint string
Entrypoint for Yandex Cloud Function
Memory int
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
Runtime string
Runtime for Yandex Cloud Function
UserHash string
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
Content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
Description string
Description of the Yandex Cloud Function
Environment map[string]string
A set of key/value environment variables for Yandex Cloud Function
ExecutionTimeout string
Execution timeout in seconds for Yandex Cloud Function
FolderId string
Folder ID for the Yandex Cloud Function
Labels map[string]string
A set of key/value label pairs to assign to the Yandex Cloud Function
Name string
Yandex Cloud Function name used to define trigger
Package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
ServiceAccountId string
Service account ID for Yandex Cloud Function
Tags []string
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
entrypoint string
Entrypoint for Yandex Cloud Function
memory number
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
runtime string
Runtime for Yandex Cloud Function
userHash string
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
description string
Description of the Yandex Cloud Function
environment {[key: string]: string}
A set of key/value environment variables for Yandex Cloud Function
executionTimeout string
Execution timeout in seconds for Yandex Cloud Function
folderId string
Folder ID for the Yandex Cloud Function
labels {[key: string]: string}
A set of key/value label pairs to assign to the Yandex Cloud Function
name string
Yandex Cloud Function name used to define trigger
package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
serviceAccountId string
Service account ID for Yandex Cloud Function
tags string[]
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
entrypoint str
Entrypoint for Yandex Cloud Function
memory int
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
runtime str
Runtime for Yandex Cloud Function
user_hash str
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
description str
Description of the Yandex Cloud Function
environment Mapping[str, str]
A set of key/value environment variables for Yandex Cloud Function
execution_timeout str
Execution timeout in seconds for Yandex Cloud Function
folder_id str
Folder ID for the Yandex Cloud Function
labels Mapping[str, str]
A set of key/value label pairs to assign to the Yandex Cloud Function
name str
Yandex Cloud Function name used to define trigger
package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
service_account_id str
Service account ID for Yandex Cloud Function
tags Sequence[str]
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.

Outputs

All input properties are implicitly available as output properties. Additionally, the Function resource produces the following output properties:

CreatedAt string
Creation timestamp of the Yandex Cloud Function.
Id string
The provider-assigned unique ID for this managed resource.
ImageSize int
Image size for Yandex Cloud Function.
LoggroupId string
Loggroup ID size for Yandex Cloud Function.
Version string
Version for Yandex Cloud Function.
CreatedAt string
Creation timestamp of the Yandex Cloud Function.
Id string
The provider-assigned unique ID for this managed resource.
ImageSize int
Image size for Yandex Cloud Function.
LoggroupId string
Loggroup ID size for Yandex Cloud Function.
Version string
Version for Yandex Cloud Function.
createdAt string
Creation timestamp of the Yandex Cloud Function.
id string
The provider-assigned unique ID for this managed resource.
imageSize number
Image size for Yandex Cloud Function.
loggroupId string
Loggroup ID size for Yandex Cloud Function.
version string
Version for Yandex Cloud Function.
created_at str
Creation timestamp of the Yandex Cloud Function.
id str
The provider-assigned unique ID for this managed resource.
image_size int
Image size for Yandex Cloud Function.
loggroup_id str
Loggroup ID size for Yandex Cloud Function.
version str
Version for Yandex Cloud Function.

Look up an Existing Function Resource

Get an existing Function resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: FunctionState, opts?: CustomResourceOptions): Function
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        content: Optional[FunctionContentArgs] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        entrypoint: Optional[str] = None,
        environment: Optional[Mapping[str, str]] = None,
        execution_timeout: Optional[str] = None,
        folder_id: Optional[str] = None,
        image_size: Optional[int] = None,
        labels: Optional[Mapping[str, str]] = None,
        loggroup_id: Optional[str] = None,
        memory: Optional[int] = None,
        name: Optional[str] = None,
        package: Optional[FunctionPackageArgs] = None,
        runtime: Optional[str] = None,
        service_account_id: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        user_hash: Optional[str] = None,
        version: Optional[str] = None) -> Function
func GetFunction(ctx *Context, name string, id IDInput, state *FunctionState, opts ...ResourceOption) (*Function, error)
public static Function Get(string name, Input<string> id, FunctionState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
CreatedAt string
Creation timestamp of the Yandex Cloud Function.
Description string
Description of the Yandex Cloud Function
Entrypoint string
Entrypoint for Yandex Cloud Function
Environment Dictionary<string, string>
A set of key/value environment variables for Yandex Cloud Function
ExecutionTimeout string
Execution timeout in seconds for Yandex Cloud Function
FolderId string
Folder ID for the Yandex Cloud Function
ImageSize int
Image size for Yandex Cloud Function.
Labels Dictionary<string, string>
A set of key/value label pairs to assign to the Yandex Cloud Function
LoggroupId string
Loggroup ID size for Yandex Cloud Function.
Memory int
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
Name string
Yandex Cloud Function name used to define trigger
Package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
Runtime string
Runtime for Yandex Cloud Function
ServiceAccountId string
Service account ID for Yandex Cloud Function
Tags List<string>
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
UserHash string
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
Version string
Version for Yandex Cloud Function.
Content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
CreatedAt string
Creation timestamp of the Yandex Cloud Function.
Description string
Description of the Yandex Cloud Function
Entrypoint string
Entrypoint for Yandex Cloud Function
Environment map[string]string
A set of key/value environment variables for Yandex Cloud Function
ExecutionTimeout string
Execution timeout in seconds for Yandex Cloud Function
FolderId string
Folder ID for the Yandex Cloud Function
ImageSize int
Image size for Yandex Cloud Function.
Labels map[string]string
A set of key/value label pairs to assign to the Yandex Cloud Function
LoggroupId string
Loggroup ID size for Yandex Cloud Function.
Memory int
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
Name string
Yandex Cloud Function name used to define trigger
Package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
Runtime string
Runtime for Yandex Cloud Function
ServiceAccountId string
Service account ID for Yandex Cloud Function
Tags []string
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
UserHash string
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
Version string
Version for Yandex Cloud Function.
content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
createdAt string
Creation timestamp of the Yandex Cloud Function.
description string
Description of the Yandex Cloud Function
entrypoint string
Entrypoint for Yandex Cloud Function
environment {[key: string]: string}
A set of key/value environment variables for Yandex Cloud Function
executionTimeout string
Execution timeout in seconds for Yandex Cloud Function
folderId string
Folder ID for the Yandex Cloud Function
imageSize number
Image size for Yandex Cloud Function.
labels {[key: string]: string}
A set of key/value label pairs to assign to the Yandex Cloud Function
loggroupId string
Loggroup ID size for Yandex Cloud Function.
memory number
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
name string
Yandex Cloud Function name used to define trigger
package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
runtime string
Runtime for Yandex Cloud Function
serviceAccountId string
Service account ID for Yandex Cloud Function
tags string[]
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
userHash string
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
version string
Version for Yandex Cloud Function.
content FunctionContentArgs

Version deployment content for Yandex Cloud Function code. Can be only one package or content section.

  • content.0.zip_filename - Filename to zip archive for the version.
created_at str
Creation timestamp of the Yandex Cloud Function.
description str
Description of the Yandex Cloud Function
entrypoint str
Entrypoint for Yandex Cloud Function
environment Mapping[str, str]
A set of key/value environment variables for Yandex Cloud Function
execution_timeout str
Execution timeout in seconds for Yandex Cloud Function
folder_id str
Folder ID for the Yandex Cloud Function
image_size int
Image size for Yandex Cloud Function.
labels Mapping[str, str]
A set of key/value label pairs to assign to the Yandex Cloud Function
loggroup_id str
Loggroup ID size for Yandex Cloud Function.
memory int
Memory in megabytes (aligned to 128MB) for Yandex Cloud Function
name str
Yandex Cloud Function name used to define trigger
package FunctionPackageArgs

Version deployment package for Yandex Cloud Function code. Can be only one package or content section.

  • package.0.sha_256 - SHA256 hash of the version deployment package.
  • package.0.bucket_name - Name of the bucket that stores the code for the version.
  • package.0.object_name - Name of the object in the bucket that stores the code for the version.
runtime str
Runtime for Yandex Cloud Function
service_account_id str
Service account ID for Yandex Cloud Function
tags Sequence[str]
Tags for Yandex Cloud Function. Tag “$latest” isn’t returned.
user_hash str
User-defined string for current function version. User must change this string any times when function changed. Function will be updated when hash is changed.
version str
Version for Yandex Cloud Function.

Supporting Types

FunctionContent

FunctionPackage

BucketName string
ObjectName string
Sha256 string
BucketName string
ObjectName string
Sha256 string
bucketName string
objectName string
sha256 string

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.