Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

Alias

Creates a Function Compute service alias. Creates an alias that points to the specified Function Compute service version. For the detailed information, please refer to the developer guide.

NOTE: Available in 1.104.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AliCloud.FC.Alias("example", new AliCloud.FC.AliasArgs
        {
            AliasName = "my_alias",
            Description = "a sample description",
            RoutingConfig = new AliCloud.FC.Inputs.AliasRoutingConfigArgs
            {
                AdditionalVersionWeights = 
                {
                    { "2", 0.5 },
                },
            },
            ServiceName = "my_service_name",
            ServiceVersion = "1",
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := fc.NewAlias(ctx, "example", &fc.AliasArgs{
			AliasName:   pulumi.String("my_alias"),
			Description: pulumi.String("a sample description"),
			RoutingConfig: &fc.AliasRoutingConfigArgs{
				AdditionalVersionWeights: pulumi.Float64Map{
					"2": pulumi.Float64(0.5),
				},
			},
			ServiceName:    pulumi.String("my_service_name"),
			ServiceVersion: pulumi.String("1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.fc.Alias;
import com.pulumi.alicloud.fc.AliasArgs;
import com.pulumi.alicloud.fc.inputs.AliasRoutingConfigArgs;
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) {
        var example = new Alias("example", AliasArgs.builder()        
            .aliasName("my_alias")
            .description("a sample description")
            .routingConfig(AliasRoutingConfigArgs.builder()
                .additionalVersionWeights(Map.of("2", 0.5))
                .build())
            .serviceName("my_service_name")
            .serviceVersion("1")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.fc.Alias("example",
    alias_name="my_alias",
    description="a sample description",
    routing_config=alicloud.fc.AliasRoutingConfigArgs(
        additional_version_weights={
            "2": 0.5,
        },
    ),
    service_name="my_service_name",
    service_version="1")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.fc.Alias("example", {
    aliasName: "my_alias",
    description: "a sample description",
    routingConfig: {
        additionalVersionWeights: {
            "2": 0.5,
        },
    },
    serviceName: "my_service_name",
    serviceVersion: "1",
});
resources:
  example:
    type: alicloud:fc:Alias
    properties:
      aliasName: my_alias
      description: a sample description
      routingConfig:
        additionalVersionWeights:
          2: 0.5
      serviceName: my_service_name
      serviceVersion: 1

Create a Alias Resource

new Alias(name: string, args: AliasArgs, opts?: CustomResourceOptions);
@overload
def Alias(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          alias_name: Optional[str] = None,
          description: Optional[str] = None,
          routing_config: Optional[AliasRoutingConfigArgs] = None,
          service_name: Optional[str] = None,
          service_version: Optional[str] = None)
@overload
def Alias(resource_name: str,
          args: AliasArgs,
          opts: Optional[ResourceOptions] = None)
func NewAlias(ctx *Context, name string, args AliasArgs, opts ...ResourceOption) (*Alias, error)
public Alias(string name, AliasArgs args, CustomResourceOptions? opts = null)
public Alias(String name, AliasArgs args)
public Alias(String name, AliasArgs args, CustomResourceOptions options)
type: alicloud:fc:Alias
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

AliasName string

Name for the alias you are creating.

ServiceName string

The Function Compute service name.

ServiceVersion string

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

Description string

Description of the alias.

RoutingConfig Pulumi.AliCloud.FC.Inputs.AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

AliasName string

Name for the alias you are creating.

ServiceName string

The Function Compute service name.

ServiceVersion string

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

Description string

Description of the alias.

RoutingConfig AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

aliasName String

Name for the alias you are creating.

serviceName String

The Function Compute service name.

serviceVersion String

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

description String

Description of the alias.

routingConfig AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

aliasName string

Name for the alias you are creating.

serviceName string

The Function Compute service name.

serviceVersion string

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

description string

Description of the alias.

routingConfig AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

alias_name str

Name for the alias you are creating.

service_name str

The Function Compute service name.

service_version str

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

description str

Description of the alias.

routing_config AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

aliasName String

Name for the alias you are creating.

serviceName String

The Function Compute service name.

serviceVersion String

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

description String

Description of the alias.

routingConfig Property Map

The Function Compute alias' route configuration settings. Fields documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the Alias 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 an Existing Alias Resource

Get an existing Alias 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?: AliasState, opts?: CustomResourceOptions): Alias
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alias_name: Optional[str] = None,
        description: Optional[str] = None,
        routing_config: Optional[AliasRoutingConfigArgs] = None,
        service_name: Optional[str] = None,
        service_version: Optional[str] = None) -> Alias
func GetAlias(ctx *Context, name string, id IDInput, state *AliasState, opts ...ResourceOption) (*Alias, error)
public static Alias Get(string name, Input<string> id, AliasState? state, CustomResourceOptions? opts = null)
public static Alias get(String name, Output<String> id, AliasState 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:
AliasName string

Name for the alias you are creating.

Description string

Description of the alias.

RoutingConfig Pulumi.AliCloud.FC.Inputs.AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

ServiceName string

The Function Compute service name.

ServiceVersion string

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

AliasName string

Name for the alias you are creating.

Description string

Description of the alias.

RoutingConfig AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

ServiceName string

The Function Compute service name.

ServiceVersion string

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

aliasName String

Name for the alias you are creating.

description String

Description of the alias.

routingConfig AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

serviceName String

The Function Compute service name.

serviceVersion String

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

aliasName string

Name for the alias you are creating.

description string

Description of the alias.

routingConfig AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

serviceName string

The Function Compute service name.

serviceVersion string

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

alias_name str

Name for the alias you are creating.

description str

Description of the alias.

routing_config AliasRoutingConfigArgs

The Function Compute alias' route configuration settings. Fields documented below.

service_name str

The Function Compute service name.

service_version str

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

aliasName String

Name for the alias you are creating.

description String

Description of the alias.

routingConfig Property Map

The Function Compute alias' route configuration settings. Fields documented below.

serviceName String

The Function Compute service name.

serviceVersion String

The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).

Supporting Types

AliasRoutingConfig

AdditionalVersionWeights Dictionary<string, double>

A map that defines the proportion of events that should be sent to different versions of a Function Compute service.

AdditionalVersionWeights map[string]float64

A map that defines the proportion of events that should be sent to different versions of a Function Compute service.

additionalVersionWeights Map<String,Double>

A map that defines the proportion of events that should be sent to different versions of a Function Compute service.

additionalVersionWeights {[key: string]: number}

A map that defines the proportion of events that should be sent to different versions of a Function Compute service.

additional_version_weights Mapping[str, float]

A map that defines the proportion of events that should be sent to different versions of a Function Compute service.

additionalVersionWeights Map<Number>

A map that defines the proportion of events that should be sent to different versions of a Function Compute service.

Import

Function Compute alias can be imported using the id, e.g.

 $ pulumi import alicloud:fc/alias:Alias example my_alias_id

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.