alicloud.fc.Alias
Explore with Pulumi AI
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
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = new AliCloud.FC.Alias("example", new()
{
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 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)
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:
- Alias
Name string Name for the alias you are creating.
- Service
Name string The Function Compute service name.
- Service
Version string The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- Description string
Description of the alias.
- Routing
Config Pulumi.Ali Cloud. FC. Inputs. Alias Routing Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- Alias
Name string Name for the alias you are creating.
- Service
Name string The Function Compute service name.
- Service
Version string The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- Description string
Description of the alias.
- Routing
Config AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- alias
Name String Name for the alias you are creating.
- service
Name String The Function Compute service name.
- service
Version String The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- description String
Description of the alias.
- routing
Config AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- alias
Name string Name for the alias you are creating.
- service
Name string The Function Compute service name.
- service
Version string The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- description string
Description of the alias.
- routing
Config AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- 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 AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- alias
Name String Name for the alias you are creating.
- service
Name String The Function Compute service name.
- service
Version String The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- description String
Description of the alias.
- routing
Config Property Map The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
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 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.
- Alias
Name string Name for the alias you are creating.
- Description string
Description of the alias.
- Routing
Config Pulumi.Ali Cloud. FC. Inputs. Alias Routing Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- Service
Name string The Function Compute service name.
- Service
Version string The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- Alias
Name string Name for the alias you are creating.
- Description string
Description of the alias.
- Routing
Config AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- Service
Name string The Function Compute service name.
- Service
Version string The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- alias
Name String Name for the alias you are creating.
- description String
Description of the alias.
- routing
Config AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- service
Name String The Function Compute service name.
- service
Version String The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
- alias
Name string Name for the alias you are creating.
- description string
Description of the alias.
- routing
Config AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- service
Name string The Function Compute service name.
- service
Version 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 AliasRouting Config Args The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- 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]+).
- alias
Name String Name for the alias you are creating.
- description String
Description of the alias.
- routing
Config Property Map The Function Compute alias' route configuration settings. Fields documented below.
routing_config includes the following arguments:
- service
Name String The Function Compute service name.
- service
Version String The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
Supporting Types
AliasRoutingConfig
- Additional
Version Dictionary<string, double>Weights A map that defines the proportion of events that should be sent to different versions of a Function Compute service.
- Additional
Version map[string]float64Weights A map that defines the proportion of events that should be sent to different versions of a Function Compute service.
- additional
Version Map<String,Double>Weights A map that defines the proportion of events that should be sent to different versions of a Function Compute service.
- additional
Version {[key: string]: number}Weights A map that defines the proportion of events that should be sent to different versions of a Function Compute service.
- additional_
version_ Mapping[str, float]weights A map that defines the proportion of events that should be sent to different versions of a Function Compute service.
- additional
Version Map<Number>Weights 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
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.