AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS Lambda CreateFunction API operation.

Syntax

FromMemoryStream (Default)

Publish-LMFunction
-FunctionName <String>
-Code_ZipFile <Byte[]>
-Handler <String>
-Runtime <Runtime>
-Role <String>
-Publish <SwitchParameter>
-LoggingConfig_ApplicationLogLevel <ApplicationLogLevel>
-SnapStart_ApplyOn <SnapStartApplyOn>
-Architecture <String[]>
-CodeSigningConfigArn <String>
-ImageConfig_Command <String[]>
-Description <String>
-ImageConfig_EntryPoint <String[]>
-FileSystemConfig <FileSystemConfig[]>
-VpcConfig_Ipv6AllowedForDualStack <Boolean>
-ImageConfig_IsCommandSet <Boolean>
-ImageConfig_IsEntryPointSet <Boolean>
-VpcConfig_IsSecurityGroupIdsSet <Boolean>
-VpcConfig_IsSubnetIdsSet <Boolean>
-Environment_IsVariablesSet <Boolean>
-KMSKeyArn <String>
-Layer <String[]>
-LoggingConfig_LogFormat <LogFormat>
-LoggingConfig_LogGroup <String>
-MemorySize <Int32>
-TracingConfig_Mode <TracingMode>
-PackageType <PackageType>
-PublishVersion <Boolean>
-VpcConfig_SecurityGroupId <String[]>
-EphemeralStorage_Size <Int32>
-VpcConfig_SubnetId <String[]>
-LoggingConfig_SystemLogLevel <SystemLogLevel>
-Tag <Hashtable>
-DeadLetterConfig_TargetArn <String>
-Timeout <Int32>
-Environment_Variable <Hashtable>
-ImageConfig_WorkingDirectory <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonLambdaConfig>

FromZipFile

Publish-LMFunction
-FunctionName <String>
-ZipFilename <String>
-Handler <String>
-Runtime <Runtime>
-Role <String>
-Publish <SwitchParameter>
-LoggingConfig_ApplicationLogLevel <ApplicationLogLevel>
-SnapStart_ApplyOn <SnapStartApplyOn>
-Architecture <String[]>
-CodeSigningConfigArn <String>
-ImageConfig_Command <String[]>
-Description <String>
-ImageConfig_EntryPoint <String[]>
-FileSystemConfig <FileSystemConfig[]>
-VpcConfig_Ipv6AllowedForDualStack <Boolean>
-ImageConfig_IsCommandSet <Boolean>
-ImageConfig_IsEntryPointSet <Boolean>
-VpcConfig_IsSecurityGroupIdsSet <Boolean>
-VpcConfig_IsSubnetIdsSet <Boolean>
-Environment_IsVariablesSet <Boolean>
-KMSKeyArn <String>
-Layer <String[]>
-LoggingConfig_LogFormat <LogFormat>
-LoggingConfig_LogGroup <String>
-MemorySize <Int32>
-TracingConfig_Mode <TracingMode>
-PackageType <PackageType>
-PublishVersion <Boolean>
-VpcConfig_SecurityGroupId <String[]>
-EphemeralStorage_Size <Int32>
-VpcConfig_SubnetId <String[]>
-LoggingConfig_SystemLogLevel <SystemLogLevel>
-Tag <Hashtable>
-DeadLetterConfig_TargetArn <String>
-Timeout <Int32>
-Environment_Variable <Hashtable>
-ImageConfig_WorkingDirectory <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonLambdaConfig>

FromS3Object

Publish-LMFunction
-FunctionName <String>
-Handler <String>
-Runtime <Runtime>
-Role <String>
-Publish <SwitchParameter>
-LoggingConfig_ApplicationLogLevel <ApplicationLogLevel>
-SnapStart_ApplyOn <SnapStartApplyOn>
-Architecture <String[]>
-CodeSigningConfigArn <String>
-ImageConfig_Command <String[]>
-Description <String>
-ImageConfig_EntryPoint <String[]>
-FileSystemConfig <FileSystemConfig[]>
-VpcConfig_Ipv6AllowedForDualStack <Boolean>
-ImageConfig_IsCommandSet <Boolean>
-ImageConfig_IsEntryPointSet <Boolean>
-VpcConfig_IsSecurityGroupIdsSet <Boolean>
-VpcConfig_IsSubnetIdsSet <Boolean>
-Environment_IsVariablesSet <Boolean>
-KMSKeyArn <String>
-Layer <String[]>
-LoggingConfig_LogFormat <LogFormat>
-LoggingConfig_LogGroup <String>
-MemorySize <Int32>
-TracingConfig_Mode <TracingMode>
-PackageType <PackageType>
-PublishVersion <Boolean>
-Code_S3Bucket <String>
-Code_S3Key <String>
-Code_S3ObjectVersion <String>
-VpcConfig_SecurityGroupId <String[]>
-EphemeralStorage_Size <Int32>
-VpcConfig_SubnetId <String[]>
-LoggingConfig_SystemLogLevel <SystemLogLevel>
-Tag <Hashtable>
-DeadLetterConfig_TargetArn <String>
-Timeout <Int32>
-Environment_Variable <Hashtable>
-ImageConfig_WorkingDirectory <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonLambdaConfig>

FromImage

Publish-LMFunction
-FunctionName <String>
-Runtime <Runtime>
-Role <String>
-Publish <SwitchParameter>
-LoggingConfig_ApplicationLogLevel <ApplicationLogLevel>
-SnapStart_ApplyOn <SnapStartApplyOn>
-Architecture <String[]>
-CodeSigningConfigArn <String>
-ImageConfig_Command <String[]>
-Description <String>
-ImageConfig_EntryPoint <String[]>
-FileSystemConfig <FileSystemConfig[]>
-Code_ImageUri <String>
-VpcConfig_Ipv6AllowedForDualStack <Boolean>
-ImageConfig_IsCommandSet <Boolean>
-ImageConfig_IsEntryPointSet <Boolean>
-VpcConfig_IsSecurityGroupIdsSet <Boolean>
-VpcConfig_IsSubnetIdsSet <Boolean>
-Environment_IsVariablesSet <Boolean>
-KMSKeyArn <String>
-Layer <String[]>
-LoggingConfig_LogFormat <LogFormat>
-LoggingConfig_LogGroup <String>
-MemorySize <Int32>
-TracingConfig_Mode <TracingMode>
-PackageType <PackageType>
-PublishVersion <Boolean>
-VpcConfig_SecurityGroupId <String[]>
-EphemeralStorage_Size <Int32>
-VpcConfig_SubnetId <String[]>
-LoggingConfig_SystemLogLevel <SystemLogLevel>
-Tag <Hashtable>
-DeadLetterConfig_TargetArn <String>
-Timeout <Int32>
-Environment_Variable <Hashtable>
-ImageConfig_WorkingDirectory <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonLambdaConfig>

Description

Creates a Lambda function. To create a function, you need a deployment package and an execution role. The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use Amazon Web Services, such as Amazon CloudWatch Logs for log streaming and X-Ray for request tracing. If the deployment package is a container image, then you set the package type to Image. For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties. If the deployment package is a .zip file archive, then you set the package type to Zip. For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and runtime properties. The code in the deployment package must be compatible with the target instruction set architecture of the function (x86-64 or arm64). If you do not specify the architecture, then the default value is x86-64. When you create a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or modify the function. The State, StateReason, and StateReasonCode fields in the response from GetFunctionConfiguration indicate when the function is ready to invoke. For more information, see Lambda function states. A function has an unpublished version, and can have published versions and aliases. The unpublished version changes when you update your function's code and configuration. A published version is a snapshot of your function code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be changed to map to a different version. Use the Publish parameter to create version 1 of your function from its initial configuration. The other parameters let you configure version-specific and function-level settings. You can modify version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both the unpublished and published versions of the function, and include tags (TagResource) and per-function concurrency limits (PutFunctionConcurrency). You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with UpdateFunctionCode, Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes set of signing profiles, which define the trusted publishers for this function. If another Amazon Web Services account or an Amazon Web Service invokes your function, use AddPermission to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias. To invoke your function directly, use Invoke. To invoke your function in response to events in other Amazon Web Services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in the other service. For more information, see Invoking Lambda functions.

Parameters

-Architecture <String[]>
The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is x86_64.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesArchitectures
-ClientConfig <AmazonLambdaConfig>
Amazon.PowerShell.Cmdlets.LM.AmazonLambdaClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Code_ImageUri <String>
URI of a container image in the Amazon ECR registry.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Code_S3Bucket <String>
An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesBucketName, FunctionCode_S3Bucket, S3Bucket
-Code_S3Key <String>
The Amazon S3 key of the deployment package.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesFunctionCode_S3Key, Key, S3Key
-Code_S3ObjectVersion <String>
For versioned objects, the version of the deployment package object to use.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesFunctionCode_S3ObjectVersion, S3ObjectVersion, VersionId
-Code_ZipFile <Byte[]>
The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you.The cmdlet will automatically convert the supplied parameter of type string, string[], System.IO.FileInfo or System.IO.Stream to byte[] before supplying it to the service.
Required?False
Position?2
Accept pipeline input?True (ByPropertyName)
AliasesZipContent, ZipFileContent
-CodeSigningConfigArn <String>
To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DeadLetterConfig_TargetArn <String>
The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Description <String>
A description of the function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Environment_IsVariablesSet <Boolean>
This property is set to true if the property is set; false otherwise. This property can be used to determine if the related property was returned by a service response or if the related property should be sent to the service during a service call.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Environment_Variable <Hashtable>
Environment variable key-value pairs. For more information, see Using Lambda environment variables.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesEnvironment_Variables
-EphemeralStorage_Size <Int32>
The size of the function's /tmp directory.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-FileSystemConfig <FileSystemConfig[]>
Connection settings for an Amazon EFS file system.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesFileSystemConfigs
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-FunctionName <String>
The name or ARN of the Lambda function.Name formats
  • Function namemy-function.
  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.
  • Partial ARN123456789012:function:my-function.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
Required?False
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-Handler <String>
The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.
Required?False
Position?3
Accept pipeline input?True (ByPropertyName)
-ImageConfig_Command <String[]>
Specifies parameters that you want to pass in with ENTRYPOINT.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ImageConfig_EntryPoint <String[]>
Specifies the entry point to their application, which is typically the location of the runtime executable.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ImageConfig_IsCommandSet <Boolean>
This property is set to true if the property is set; false otherwise. This property can be used to determine if the related property was returned by a service response or if the related property should be sent to the service during a service call.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ImageConfig_IsEntryPointSet <Boolean>
This property is set to true if the property is set; false otherwise. This property can be used to determine if the related property was returned by a service response or if the related property should be sent to the service during a service call.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ImageConfig_WorkingDirectory <String>
Specifies the working directory.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-KMSKeyArn <String>
The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's environment variables. When Lambda SnapStart is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Layer <String[]>
A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLayers
-LoggingConfig_ApplicationLogLevel <ApplicationLogLevel>
Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfig_LogFormat <LogFormat>
The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfig_LogGroup <String>
The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named /aws/lambda/<function name>. To use a different log group, enter an existing log group or enter a new log group name.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfig_SystemLogLevel <SystemLogLevel>
Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MemorySize <Int32>
The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PackageType <PackageType>
The type of deployment package. Set to Image for container image and set to Zip for .zip file archive.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the FunctionName parameter. The -PassThru parameter is deprecated, use -Select '^FunctionName' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Publish <SwitchParameter>
This parameter is obsolete. Use PublishVersion instead.
Required?False
Position?Named
Accept pipeline input?False
-PublishVersion <Boolean>
Set to true to publish the first version of the function during creation.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Role <String>
The Amazon Resource Name (ARN) of the function's execution role.
Required?False
Position?5
Accept pipeline input?True (ByPropertyName)
-Runtime <Runtime>
The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.
Required?False
Position?4
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is '*'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Lambda.Model.CreateFunctionResponse). Specifying the name of a property of type Amazon.Lambda.Model.CreateFunctionResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SnapStart_ApplyOn <SnapStartApplyOn>
Set to PublishedVersions to create a snapshot of the initialized execution environment when you publish a function version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Hashtable>
A list of tags to apply to the function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags
-Timeout <Int32>
The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-TracingConfig_Mode <TracingMode>
The tracing mode.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-VpcConfig_Ipv6AllowedForDualStack <Boolean>
Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-VpcConfig_IsSecurityGroupIdsSet <Boolean>
This property is set to true if the property is set; false otherwise. This property can be used to determine if the related property was returned by a service response or if the related property should be sent to the service during a service call.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-VpcConfig_IsSubnetIdsSet <Boolean>
This property is set to true if the property is set; false otherwise. This property can be used to determine if the related property was returned by a service response or if the related property should be sent to the service during a service call.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-VpcConfig_SecurityGroupId <String[]>
A list of VPC security group IDs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesVpcConfig_SecurityGroupIds
-VpcConfig_SubnetId <String[]>
A list of VPC subnet IDs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesVpcConfig_SubnetIds
-ZipFilename <String>
This parameter is obsolete and will be removed in a future version. Use 'Code_ZipFile' instead. The path to a zip file containing your deployment package. For more information about creating a .zip file, go to Execution Permissions in the AWS Lambda Developer Guide.
Required?True
Position?2
Accept pipeline input?True (ByPropertyName)
AliasesFunctionZip, Filename

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.Lambda.Model.CreateFunctionResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Examples

Example 1

Publish-LMFunction -Description "My C# Lambda Function" `
-FunctionName MyFunction `
-ZipFilename .\MyFunctionBinaries.zip `
-Handler "AssemblyName::Namespace.ClassName::MethodName" `
-Role "arn:aws:iam::123456789012:role/LambdaFullExecRole" `
-Runtime dotnetcore1.0 `
-Environment_Variable @{ "envvar1"="value";"envvar2"="value" }

CodeSha256 : /NgBMd...gq71I=
CodeSize : 214784
DeadLetterConfig :
Description : My C# Lambda Function
Environment : Amazon.Lambda.Model.EnvironmentResponse
FunctionArn : arn:aws:lambda:us-west-2:123456789012:function:ToUpper
FunctionName : MyFunction
Handler : AssemblyName::Namespace.ClassName::MethodName
KMSKeyArn :
LastModified : 2016-12-29T23:50:14.207+0000
MemorySize : 128
Role : arn:aws:iam::123456789012:role/LambdaFullExecRole
Runtime : dotnetcore1.0
Timeout : 3
Version : $LATEST
VpcConfig :
This example creates a new C# (dotnetcore1.0 runtime) function named MyFunction in AWS Lambda, providing the compiled binaries for the function from a zip file on the local file system (relative or absolute paths may be used). C# Lambda functions specify the handler for the function using the designation AssemblyName::Namespace.ClassName::MethodName. You should replace the assembly name (without .dll suffix), namespace, class name and method name parts of the handler spec appropriately. The new function will have environment variables 'envvar1' and 'envvar2' set up from the provided values.

Example 2

Write-S3Object -BucketName mybucket -Key MyFunctionBinaries.zip -File .\MyFunctionBinaries.zip
Publish-LMFunction -Description "My C# Lambda Function" `
-FunctionName MyFunction `
-BucketName mybucket `
-Key MyFunctionBinaries.zip `
-Handler "AssemblyName::Namespace.ClassName::MethodName" `
-Role "arn:aws:iam::123456789012:role/LambdaFullExecRole" `
-Runtime dotnetcore1.0 `
-Environment_Variable @{ "envvar1"="value";"envvar2"="value" }
This example is similar to the previous one except the function binaries are first uploaded to an Amazon S3 bucket (which must be in the same region as the intended Lambda function) and the resulting S3 object is then referenced when creating the function.

Supported Version

AWS Tools for PowerShell: 2.x.y.z