1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. fc
  5. V3Alias
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.fc.V3Alias

Explore with Pulumi AI

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,
    },
});
Copy
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,
    })
Copy
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
	})
}
Copy
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 },
        },
    });

});
Copy
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());

    }
}
Copy
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'
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. V3AliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. V3AliasArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. V3AliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
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"),
})
Copy
var v3aliasResource = new V3Alias("v3aliasResource", V3AliasArgs.builder()
    .functionName("string")
    .additionalVersionWeight(Map.of("string", 0))
    .aliasName("string")
    .description("string")
    .versionId("string")
    .build());
Copy
v3alias_resource = alicloud.fc.V3Alias("v3aliasResource",
    function_name="string",
    additional_version_weight={
        "string": 0,
    },
    alias_name="string",
    description="string",
    version_id="string")
Copy
const v3aliasResource = new alicloud.fc.V3Alias("v3aliasResource", {
    functionName: "string",
    additionalVersionWeight: {
        string: 0,
    },
    aliasName: "string",
    description: "string",
    versionId: "string",
});
Copy
type: alicloud:fc:V3Alias
properties:
    additionalVersionWeight:
        string: 0
    aliasName: string
    description: string
    functionName: string
    versionId: string
Copy

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

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

The V3Alias resource accepts the following input properties:

FunctionName
This property is required.
Changes to this property will trigger replacement.
string
Function Name
AdditionalVersionWeight Dictionary<string, double>
Grayscale version
AliasName Changes to this property will trigger replacement. string
Function Alias
Description string
Description
VersionId string
The version that the alias points
FunctionName
This property is required.
Changes to this property will trigger replacement.
string
Function Name
AdditionalVersionWeight map[string]float64
Grayscale version
AliasName Changes to this property will trigger replacement. string
Function Alias
Description string
Description
VersionId string
The version that the alias points
functionName
This property is required.
Changes to this property will trigger replacement.
String
Function Name
additionalVersionWeight Map<String,Double>
Grayscale version
aliasName Changes to this property will trigger replacement. String
Function Alias
description String
Description
versionId String
The version that the alias points
functionName
This property is required.
Changes to this property will trigger replacement.
string
Function Name
additionalVersionWeight {[key: string]: number}
Grayscale version
aliasName Changes to this property will trigger replacement. string
Function Alias
description string
Description
versionId string
The version that the alias points
function_name
This property is required.
Changes to this property will trigger replacement.
str
Function Name
additional_version_weight Mapping[str, float]
Grayscale version
alias_name Changes to this property will trigger replacement. str
Function Alias
description str
Description
version_id str
The version that the alias points
functionName
This property is required.
Changes to this property will trigger replacement.
String
Function Name
additionalVersionWeight Map<Number>
Grayscale version
aliasName Changes to this property will trigger replacement. 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.
LastModifiedTime string
(Available since v1.234.0) Last modification time
CreateTime string
The creation time of the resource
Id string
The provider-assigned unique ID for this managed resource.
LastModifiedTime string
(Available since v1.234.0) Last modification time
createTime String
The creation time of the resource
id String
The provider-assigned unique ID for this managed resource.
lastModifiedTime String
(Available since v1.234.0) Last modification time
createTime string
The creation time of the resource
id string
The provider-assigned unique ID for this managed resource.
lastModifiedTime string
(Available since v1.234.0) Last modification time
create_time str
The creation time of the resource
id str
The provider-assigned unique ID for this managed resource.
last_modified_time str
(Available since v1.234.0) Last modification time
createTime String
The creation time of the resource
id String
The provider-assigned unique ID for this managed resource.
lastModifiedTime String
(Available since v1.234.0) Last modification time

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,
        last_modified_time: 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)
resources:  _:    type: alicloud:fc:V3Alias    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
Function Alias
CreateTime string
The creation time of the resource
Description string
Description
FunctionName Changes to this property will trigger replacement. string
Function Name
LastModifiedTime string
(Available since v1.234.0) Last modification time
VersionId string
The version that the alias points
AdditionalVersionWeight map[string]float64
Grayscale version
AliasName Changes to this property will trigger replacement. string
Function Alias
CreateTime string
The creation time of the resource
Description string
Description
FunctionName Changes to this property will trigger replacement. string
Function Name
LastModifiedTime string
(Available since v1.234.0) Last modification time
VersionId string
The version that the alias points
additionalVersionWeight Map<String,Double>
Grayscale version
aliasName Changes to this property will trigger replacement. String
Function Alias
createTime String
The creation time of the resource
description String
Description
functionName Changes to this property will trigger replacement. String
Function Name
lastModifiedTime String
(Available since v1.234.0) Last modification time
versionId String
The version that the alias points
additionalVersionWeight {[key: string]: number}
Grayscale version
aliasName Changes to this property will trigger replacement. string
Function Alias
createTime string
The creation time of the resource
description string
Description
functionName Changes to this property will trigger replacement. string
Function Name
lastModifiedTime string
(Available since v1.234.0) Last modification time
versionId string
The version that the alias points
additional_version_weight Mapping[str, float]
Grayscale version
alias_name Changes to this property will trigger replacement. str
Function Alias
create_time str
The creation time of the resource
description str
Description
function_name Changes to this property will trigger replacement. str
Function Name
last_modified_time str
(Available since v1.234.0) Last modification time
version_id str
The version that the alias points
additionalVersionWeight Map<Number>
Grayscale version
aliasName Changes to this property will trigger replacement. String
Function Alias
createTime String
The creation time of the resource
description String
Description
functionName Changes to this property will trigger replacement. String
Function Name
lastModifiedTime String
(Available since v1.234.0) Last modification time
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>
Copy

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.