1. Packages
  2. Yandex
  3. API Docs
  4. FunctionScalingPolicy
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.FunctionScalingPolicy

Explore with Pulumi AI

yandex logo
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

    Allows management of Yandex Cloud Function Scaling Policies

    Example Usage

    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var myScalingPolicy = new Yandex.FunctionScalingPolicy("myScalingPolicy", new Yandex.FunctionScalingPolicyArgs
            {
                FunctionId = "are1samplefunction11",
                Policies = 
                {
                    new Yandex.Inputs.FunctionScalingPolicyPolicyArgs
                    {
                        Tag = "$latest",
                        ZoneInstancesLimit = 3,
                        ZoneRequestsLimit = 100,
                    },
                    new Yandex.Inputs.FunctionScalingPolicyPolicyArgs
                    {
                        Tag = "my_tag",
                        ZoneInstancesLimit = 4,
                        ZoneRequestsLimit = 150,
                    },
                },
            });
        }
    
    }
    
    package main
    
    import (
    	"fmt"
    
    	"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.NewFunctionScalingPolicy(ctx, "myScalingPolicy", &yandex.FunctionScalingPolicyArgs{
    			FunctionId: pulumi.String("are1samplefunction11"),
    			Policies: FunctionScalingPolicyPolicyArray{
    				&FunctionScalingPolicyPolicyArgs{
    					Tag:                pulumi.String(fmt.Sprintf("%v%v", "$", "latest")),
    					ZoneInstancesLimit: pulumi.Int(3),
    					ZoneRequestsLimit:  pulumi.Int(100),
    				},
    				&FunctionScalingPolicyPolicyArgs{
    					Tag:                pulumi.String("my_tag"),
    					ZoneInstancesLimit: pulumi.Int(4),
    					ZoneRequestsLimit:  pulumi.Int(150),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_yandex as yandex
    
    my_scaling_policy = yandex.FunctionScalingPolicy("myScalingPolicy",
        function_id="are1samplefunction11",
        policies=[
            yandex.FunctionScalingPolicyPolicyArgs(
                tag="$latest",
                zone_instances_limit=3,
                zone_requests_limit=100,
            ),
            yandex.FunctionScalingPolicyPolicyArgs(
                tag="my_tag",
                zone_instances_limit=4,
                zone_requests_limit=150,
            ),
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const myScalingPolicy = new yandex.FunctionScalingPolicy("my_scaling_policy", {
        functionId: "are1samplefunction11",
        policies: [
            {
                tag: "$latest",
                zoneInstancesLimit: 3,
                zoneRequestsLimit: 100,
            },
            {
                tag: "my_tag",
                zoneInstancesLimit: 4,
                zoneRequestsLimit: 150,
            },
        ],
    });
    

    Coming soon!

    Create FunctionScalingPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new FunctionScalingPolicy(name: string, args: FunctionScalingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def FunctionScalingPolicy(resource_name: str,
                              args: FunctionScalingPolicyArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def FunctionScalingPolicy(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              function_id: Optional[str] = None,
                              policies: Optional[Sequence[FunctionScalingPolicyPolicyArgs]] = None)
    func NewFunctionScalingPolicy(ctx *Context, name string, args FunctionScalingPolicyArgs, opts ...ResourceOption) (*FunctionScalingPolicy, error)
    public FunctionScalingPolicy(string name, FunctionScalingPolicyArgs args, CustomResourceOptions? opts = null)
    public FunctionScalingPolicy(String name, FunctionScalingPolicyArgs args)
    public FunctionScalingPolicy(String name, FunctionScalingPolicyArgs args, CustomResourceOptions options)
    
    type: yandex:FunctionScalingPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args FunctionScalingPolicyArgs
    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 FunctionScalingPolicyArgs
    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 FunctionScalingPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FunctionScalingPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FunctionScalingPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var functionScalingPolicyResource = new Yandex.FunctionScalingPolicy("functionScalingPolicyResource", new()
    {
        FunctionId = "string",
        Policies = new[]
        {
            new Yandex.Inputs.FunctionScalingPolicyPolicyArgs
            {
                Tag = "string",
                ZoneInstancesLimit = 0,
                ZoneRequestsLimit = 0,
            },
        },
    });
    
    example, err := yandex.NewFunctionScalingPolicy(ctx, "functionScalingPolicyResource", &yandex.FunctionScalingPolicyArgs{
    	FunctionId: pulumi.String("string"),
    	Policies: yandex.FunctionScalingPolicyPolicyArray{
    		&yandex.FunctionScalingPolicyPolicyArgs{
    			Tag:                pulumi.String("string"),
    			ZoneInstancesLimit: pulumi.Int(0),
    			ZoneRequestsLimit:  pulumi.Int(0),
    		},
    	},
    })
    
    var functionScalingPolicyResource = new FunctionScalingPolicy("functionScalingPolicyResource", FunctionScalingPolicyArgs.builder()
        .functionId("string")
        .policies(FunctionScalingPolicyPolicyArgs.builder()
            .tag("string")
            .zoneInstancesLimit(0)
            .zoneRequestsLimit(0)
            .build())
        .build());
    
    function_scaling_policy_resource = yandex.FunctionScalingPolicy("functionScalingPolicyResource",
        function_id="string",
        policies=[{
            "tag": "string",
            "zone_instances_limit": 0,
            "zone_requests_limit": 0,
        }])
    
    const functionScalingPolicyResource = new yandex.FunctionScalingPolicy("functionScalingPolicyResource", {
        functionId: "string",
        policies: [{
            tag: "string",
            zoneInstancesLimit: 0,
            zoneRequestsLimit: 0,
        }],
    });
    
    type: yandex:FunctionScalingPolicy
    properties:
        functionId: string
        policies:
            - tag: string
              zoneInstancesLimit: 0
              zoneRequestsLimit: 0
    

    FunctionScalingPolicy Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The FunctionScalingPolicy resource accepts the following input properties:

    FunctionId string
    Yandex Cloud Function id used to define function
    Policies List<FunctionScalingPolicyPolicy>
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    FunctionId string
    Yandex Cloud Function id used to define function
    Policies []FunctionScalingPolicyPolicyArgs
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    functionId String
    Yandex Cloud Function id used to define function
    policies List<FunctionScalingPolicyPolicy>
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    functionId string
    Yandex Cloud Function id used to define function
    policies FunctionScalingPolicyPolicy[]
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    function_id str
    Yandex Cloud Function id used to define function
    policies Sequence[FunctionScalingPolicyPolicyArgs]
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    functionId String
    Yandex Cloud Function id used to define function
    policies List<Property Map>
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing FunctionScalingPolicy Resource

    Get an existing FunctionScalingPolicy 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?: FunctionScalingPolicyState, opts?: CustomResourceOptions): FunctionScalingPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            function_id: Optional[str] = None,
            policies: Optional[Sequence[FunctionScalingPolicyPolicyArgs]] = None) -> FunctionScalingPolicy
    func GetFunctionScalingPolicy(ctx *Context, name string, id IDInput, state *FunctionScalingPolicyState, opts ...ResourceOption) (*FunctionScalingPolicy, error)
    public static FunctionScalingPolicy Get(string name, Input<string> id, FunctionScalingPolicyState? state, CustomResourceOptions? opts = null)
    public static FunctionScalingPolicy get(String name, Output<String> id, FunctionScalingPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    FunctionId string
    Yandex Cloud Function id used to define function
    Policies List<FunctionScalingPolicyPolicy>
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    FunctionId string
    Yandex Cloud Function id used to define function
    Policies []FunctionScalingPolicyPolicyArgs
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    functionId String
    Yandex Cloud Function id used to define function
    policies List<FunctionScalingPolicyPolicy>
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    functionId string
    Yandex Cloud Function id used to define function
    policies FunctionScalingPolicyPolicy[]
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    function_id str
    Yandex Cloud Function id used to define function
    policies Sequence[FunctionScalingPolicyPolicyArgs]
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag
    functionId String
    Yandex Cloud Function id used to define function
    policies List<Property Map>
    list definition for Yandex Cloud Function scaling policies

    • policy.# - number of Yandex Cloud Function scaling policies
    • policy.{num}.tag - Yandex.Cloud Function version tag for Yandex Cloud Function scaling policy
    • policy.{num}.zone_instances_limit - max number of instances in one zone for Yandex.Cloud Function with tag
    • policy.{num}.zone_requests_limit - max number of requests in one zone for Yandex.Cloud Function with tag

    Supporting Types

    FunctionScalingPolicyPolicy, FunctionScalingPolicyPolicyArgs

    Package Details

    Repository
    Yandex pulumi/pulumi-yandex
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the yandex Terraform Provider.
    yandex logo
    Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi