Skip to content
v2.277.0

Architecture Class ​

Architectures supported by AWS Lambda.

Example ​

ts
new lambda.Function(this, 'MyFunction', {
  runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
  architecture: lambda.Architecture.ARM_64,
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
  insightsVersion: lambda.LambdaInsightsVersion.VERSION_1_0_119_0,
});
python
lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    architecture=lambda_.Architecture.ARM_64,
    code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler")),
    insights_version=lambda_.LambdaInsightsVersion.VERSION_1_0_119_0
)
java
Function.Builder.create(this, "MyFunction")
        .runtime(Runtime.NODEJS_LATEST)
        .handler("index.handler")
        .architecture(Architecture.ARM_64)
        .code(Code.fromAsset(join(__dirname, "lambda-handler")))
        .insightsVersion(LambdaInsightsVersion.VERSION_1_0_119_0)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new Function(this, "MyFunction", new FunctionProps {
    Runtime = Runtime.NODEJS_LATEST,
    Handler = "index.handler",
    Architecture = Architecture.ARM_64,
    Code = Code.FromAsset(Join(__dirname, "lambda-handler")),
    InsightsVersion = LambdaInsightsVersion.VERSION_1_0_119_0
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Architecture: lambda.Architecture_ARM_64(),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
	InsightsVersion: lambda.LambdaInsightsVersion_VERSION_1_0_119_0(),
})

Properties ​

64 bit architecture with the ARM instruction set.
dockerPlatformstringdocker_platformstrdockerPlatformStringDockerPlatformstringDockerPlatform*string#
The platform to use for this architecture when building with Docker.
namestringnamestrnameStringNamestringName*string#
The name of the architecture as recognized by the AWS Lambda service APIs.
64 bit architecture with x86 instruction set.

Methods ​

custom(name: string, dockerPlatform?: string): Architecture // chainable@staticmethod def custom(name: str, docker_platform: typing.Optional[str] = None) -> Architecturepublic static Architecture custom(String name, String dockerPlatform)public static Architecture Custom(string name, string? dockerPlatform = null)func Custom(Name *string, DockerPlatform *string) Architecturestatic#
Used to specify a custom architecture name.

Use this if the architecture name is not yet supported by the CDK.

2 parameters

Parameters

  • namenamenamenameName — the architecture name as recognized by AWS Lambda.
  • dockerPlatformdocker_platformdockerPlatformdockerPlatformDockerPlatform — the platform to use for this architecture when building with Docker.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of the architecture using the name.