Skip to content
v2.277.0

CfnAliasProps Struct ​

Properties for defining a CfnAlias.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const cfnAliasProps: lambda.CfnAliasProps = {
  functionName: 'functionName',
  functionVersion: 'functionVersion',
  name: 'name',

  // the properties below are optional
  description: 'description',
  provisionedConcurrencyConfig: {
    provisionedConcurrentExecutions: 123,
  },
  routingConfig: {
    additionalVersionWeights: [{
      functionVersion: 'functionVersion',
      functionWeight: 123,
    }],
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

cfn_alias_props = lambda.CfnAliasProps(
    function_name="functionName",
    function_version="functionVersion",
    name="name",

    # the properties below are optional
    description="description",
    provisioned_concurrency_config=lambda.CfnAlias.ProvisionedConcurrencyConfigurationProperty(
        provisioned_concurrent_executions=123
    ),
    routing_config=lambda.CfnAlias.AliasRoutingConfigurationProperty(
        additional_version_weights=[lambda.CfnAlias.VersionWeightProperty(
            function_version="functionVersion",
            function_weight=123
        )]
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;

CfnAliasProps cfnAliasProps = CfnAliasProps.builder()
        .functionName("functionName")
        .functionVersion("functionVersion")
        .name("name")

        // the properties below are optional
        .description("description")
        .provisionedConcurrencyConfig(ProvisionedConcurrencyConfigurationProperty.builder()
                .provisionedConcurrentExecutions(123)
                .build())
        .routingConfig(AliasRoutingConfigurationProperty.builder()
                .additionalVersionWeights(List.of(VersionWeightProperty.builder()
                        .functionVersion("functionVersion")
                        .functionWeight(123)
                        .build()))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;

var cfnAliasProps = new CfnAliasProps {
    FunctionName = "functionName",
    FunctionVersion = "functionVersion",
    Name = "name",

    // the properties below are optional
    Description = "description",
    ProvisionedConcurrencyConfig = new ProvisionedConcurrencyConfigurationProperty {
        ProvisionedConcurrentExecutions = 123
    },
    RoutingConfig = new AliasRoutingConfigurationProperty {
        AdditionalVersionWeights = new [] { new VersionWeightProperty {
            FunctionVersion = "functionVersion",
            FunctionWeight = 123
        } }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAliasProps := &CfnAliasProps{
	FunctionName: jsii.String("functionName"),
	FunctionVersion: jsii.String("functionVersion"),
	Name: jsii.String("name"),

	// the properties below are optional
	Description: jsii.String("description"),
	ProvisionedConcurrencyConfig: &ProvisionedConcurrencyConfigurationProperty{
		ProvisionedConcurrentExecutions: jsii.Number(123),
	},
	RoutingConfig: &AliasRoutingConfigurationProperty{
		AdditionalVersionWeights: []interface{}{
			&VersionWeightProperty{
				FunctionVersion: jsii.String("functionVersion"),
				FunctionWeight: jsii.Number(123),
			},
		},
	},
}

Properties ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
A description of the alias.
functionNamestring | IFunctionReffunction_nametyping.Union[str, IFunctionRef]functionNameStringFunctionNamestringFunctionNameinterface{} required #
The name or ARN of the Lambda function.
notes

Name formats - Function name - MyFunction .

  • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
  • Partial ARN - 123456789012:function:MyFunction .

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

functionVersionstringfunction_versionstrfunctionVersionStringFunctionVersionstringFunctionVersion*string required #
The function version that the alias invokes.
namestringnamestrnameStringNamestringName*string required #
The name of the alias.
provisionedConcurrencyConfigoptionalIResolvable | CfnAlias.ProvisionedConcurrencyConfigurationPropertyprovisioned_concurrency_configoptionaltyping.Union[IResolvable, ProvisionedConcurrencyConfigurationProperty]provisionedConcurrencyConfigoptionalIResolvableProvisionedConcurrencyConfigoptionalIResolvableProvisionedConcurrencyConfigoptionalinterface{} #
Specifies a provisioned concurrency configuration for a function's alias.
routingConfigoptionalIResolvable | CfnAlias.AliasRoutingConfigurationPropertyrouting_configoptionaltyping.Union[IResolvable, AliasRoutingConfigurationProperty]routingConfigoptionalIResolvableRoutingConfigoptionalIResolvableRoutingConfigoptionalinterface{} #
The routing configuration of the alias.