1. Packages
  2. Alicloud Provider
  3. API Docs
  4. fc
  5. V3Alias
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.fc.V3Alias

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides a FCV3 Alias resource.

    Alias for functions.

    For information about FCV3 Alias and how to use it, see What is Alias.

    NOTE: Available since v1.228.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const functionName = config.get("functionName") || "flask-3xdg";
    const _default = new alicloud.fc.V3Alias("default", {
        versionId: "1",
        functionName: functionName,
        description: "create alias",
        aliasName: name,
        additionalVersionWeight: {
            "2": 0.5,
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    function_name = config.get("functionName")
    if function_name is None:
        function_name = "flask-3xdg"
    default = alicloud.fc.V3Alias("default",
        version_id="1",
        function_name=function_name,
        description="create alias",
        alias_name=name,
        additional_version_weight={
            "2": 0.5,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/fc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		functionName := "flask-3xdg"
    		if param := cfg.Get("functionName"); param != "" {
    			functionName = param
    		}
    		_, err := fc.NewV3Alias(ctx, "default", &fc.V3AliasArgs{
    			VersionId:    pulumi.String("1"),
    			FunctionName: pulumi.String(functionName),
    			Description:  pulumi.String("create alias"),
    			AliasName:    pulumi.String(name),
    			AdditionalVersionWeight: pulumi.Float64Map{
    				"2": pulumi.Float64(0.5),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var functionName = config.Get("functionName") ?? "flask-3xdg";
        var @default = new AliCloud.FC.V3Alias("default", new()
        {
            VersionId = "1",
            FunctionName = functionName,
            Description = "create alias",
            AliasName = name,
            AdditionalVersionWeight = 
            {
                { "2", 0.5 },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.fc.V3Alias;
    import com.pulumi.alicloud.fc.V3AliasArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var functionName = config.get("functionName").orElse("flask-3xdg");
            var default_ = new V3Alias("default", V3AliasArgs.builder()
                .versionId("1")
                .functionName(functionName)
                .description("create alias")
                .aliasName(name)
                .additionalVersionWeight(Map.of("2", "0.5"))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
      functionName:
        type: string
        default: flask-3xdg
    resources:
      default:
        type: alicloud:fc:V3Alias
        properties:
          versionId: '1'
          functionName: ${functionName}
          description: create alias
          aliasName: ${name}
          additionalVersionWeight:
            '2': '0.5'
    

    Create V3Alias Resource

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

    Constructor syntax

    new V3Alias(name: string, args: V3AliasArgs, opts?: CustomResourceOptions);
    @overload
    def V3Alias(resource_name: str,
                args: V3AliasArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def V3Alias(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                function_name: Optional[str] = None,
                additional_version_weight: Optional[Mapping[str, float]] = None,
                alias_name: Optional[str] = None,
                description: Optional[str] = None,
                version_id: Optional[str] = None)
    func NewV3Alias(ctx *Context, name string, args V3AliasArgs, opts ...ResourceOption) (*V3Alias, error)
    public V3Alias(string name, V3AliasArgs args, CustomResourceOptions? opts = null)
    public V3Alias(String name, V3AliasArgs args)
    public V3Alias(String name, V3AliasArgs args, CustomResourceOptions options)
    
    type: alicloud:fc:V3Alias
    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 V3AliasArgs
    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 V3AliasArgs
    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 V3AliasArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args V3AliasArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args V3AliasArgs
    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 v3aliasResource = new AliCloud.FC.V3Alias("v3aliasResource", new()
    {
        FunctionName = "string",
        AdditionalVersionWeight = 
        {
            { "string", 0 },
        },
        AliasName = "string",
        Description = "string",
        VersionId = "string",
    });
    
    example, err := fc.NewV3Alias(ctx, "v3aliasResource", &fc.V3AliasArgs{
    	FunctionName: pulumi.String("string"),
    	AdditionalVersionWeight: pulumi.Float64Map{
    		"string": pulumi.Float64(0),
    	},
    	AliasName:   pulumi.String("string"),
    	Description: pulumi.String("string"),
    	VersionId:   pulumi.String("string"),
    })
    
    var v3aliasResource = new V3Alias("v3aliasResource", V3AliasArgs.builder()
        .functionName("string")
        .additionalVersionWeight(Map.of("string", 0))
        .aliasName("string")
        .description("string")
        .versionId("string")
        .build());
    
    v3alias_resource = alicloud.fc.V3Alias("v3aliasResource",
        function_name="string",
        additional_version_weight={
            "string": 0,
        },
        alias_name="string",
        description="string",
        version_id="string")
    
    const v3aliasResource = new alicloud.fc.V3Alias("v3aliasResource", {
        functionName: "string",
        additionalVersionWeight: {
            string: 0,
        },
        aliasName: "string",
        description: "string",
        versionId: "string",
    });
    
    type: alicloud:fc:V3Alias
    properties:
        additionalVersionWeight:
            string: 0
        aliasName: string
        description: string
        functionName: string
        versionId: string
    

    V3Alias 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 V3Alias resource accepts the following input properties:

    FunctionName string
    Function Name
    AdditionalVersionWeight Dictionary<string, double>
    Grayscale version
    AliasName string
    Function Alias
    Description string
    Description
    VersionId string
    The version that the alias points
    FunctionName string
    Function Name
    AdditionalVersionWeight map[string]float64
    Grayscale version
    AliasName string
    Function Alias
    Description string
    Description
    VersionId string
    The version that the alias points
    functionName String
    Function Name
    additionalVersionWeight Map<String,Double>
    Grayscale version
    aliasName String
    Function Alias
    description String
    Description
    versionId String
    The version that the alias points
    functionName string
    Function Name
    additionalVersionWeight {[key: string]: number}
    Grayscale version
    aliasName string
    Function Alias
    description string
    Description
    versionId string
    The version that the alias points
    function_name str
    Function Name
    additional_version_weight Mapping[str, float]
    Grayscale version
    alias_name str
    Function Alias
    description str
    Description
    version_id str
    The version that the alias points
    functionName String
    Function Name
    additionalVersionWeight Map<Number>
    Grayscale version
    aliasName String
    Function Alias
    description String
    Description
    versionId String
    The version that the alias points

    Outputs

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

    CreateTime string
    The creation time of the resource
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    The creation time of the resource
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    The creation time of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    createTime string
    The creation time of the resource
    id string
    The provider-assigned unique ID for this managed resource.
    create_time str
    The creation time of the resource
    id str
    The provider-assigned unique ID for this managed resource.
    createTime String
    The creation time of the resource
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing V3Alias Resource

    Get an existing V3Alias 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?: V3AliasState, opts?: CustomResourceOptions): V3Alias
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_version_weight: Optional[Mapping[str, float]] = None,
            alias_name: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            function_name: Optional[str] = None,
            version_id: Optional[str] = None) -> V3Alias
    func GetV3Alias(ctx *Context, name string, id IDInput, state *V3AliasState, opts ...ResourceOption) (*V3Alias, error)
    public static V3Alias Get(string name, Input<string> id, V3AliasState? state, CustomResourceOptions? opts = null)
    public static V3Alias get(String name, Output<String> id, V3AliasState 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:
    AdditionalVersionWeight Dictionary<string, double>
    Grayscale version
    AliasName string
    Function Alias
    CreateTime string
    The creation time of the resource
    Description string
    Description
    FunctionName string
    Function Name
    VersionId string
    The version that the alias points
    AdditionalVersionWeight map[string]float64
    Grayscale version
    AliasName string
    Function Alias
    CreateTime string
    The creation time of the resource
    Description string
    Description
    FunctionName string
    Function Name
    VersionId string
    The version that the alias points
    additionalVersionWeight Map<String,Double>
    Grayscale version
    aliasName String
    Function Alias
    createTime String
    The creation time of the resource
    description String
    Description
    functionName String
    Function Name
    versionId String
    The version that the alias points
    additionalVersionWeight {[key: string]: number}
    Grayscale version
    aliasName string
    Function Alias
    createTime string
    The creation time of the resource
    description string
    Description
    functionName string
    Function Name
    versionId string
    The version that the alias points
    additional_version_weight Mapping[str, float]
    Grayscale version
    alias_name str
    Function Alias
    create_time str
    The creation time of the resource
    description str
    Description
    function_name str
    Function Name
    version_id str
    The version that the alias points
    additionalVersionWeight Map<Number>
    Grayscale version
    aliasName String
    Function Alias
    createTime String
    The creation time of the resource
    description String
    Description
    functionName String
    Function Name
    versionId String
    The version that the alias points

    Import

    FCV3 Alias can be imported using the id, e.g.

    $ pulumi import alicloud:fc/v3Alias:V3Alias example <function_name>:<alias_name>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi