aws-cdk.aws-lambda-dotnet


Nameaws-cdk.aws-lambda-dotnet JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/cdklabs/awscdk-lambda-dotnet.git
Summary@aws-cdk/aws-lambda-dotnet
upload_time2024-03-29 10:20:44
maintainerNone
docs_urlNone
authorAmazon Web Services<aws-cdk-dev@amazon.com>
requires_python~=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AWS Lambda .NET Library

<!--BEGIN STABILITY BANNER-->---


![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development.
> They are subject to non-backward compatible changes or removal in any future version. These are
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes. This means that while you may use them, you may need to update
> your source code when upgrading to a newer version of this package.

---
<!--END STABILITY BANNER-->

This library provides constructs for .NET Lambda functions.

To use this module you will either need to have `.NET SDK` installed (`.NET 6.0` or later) with the [AWS Lambda Tools for .NET](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html) or `Docker` installed.

## .NET Function

Define a `DotNetFunction`:

```python
dotnet.DotNetFunction(self, "MyFunction",
    project_dir="src/MyFunction"
)
```

All other properties of `lambda.Function` are supported, see also the [AWS Lambda construct library](https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-lambda).

### Custom Runtime and Native AOT

With this construct it is possible to use a custom runtime by setting the runtime to `PROVIDED_AL2`. This allows you to run unsupported .NET runtime versions like .NET 7.0 or [Native AOT](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot). Setting the runtime to `PROVIDED_AL2` will instruct CDK and the AWS Lambda Tools for .NET to build your project in a Docker container based of Amazon Linux 2. An example can be found below.

```python
dotnet.DotNetFunction(self, "MyFunction",
    project_dir="src/MyFunction",
    runtime=lambda_.Runtime.PROVIDED_AL2,
    bundling=dotnet.BundlingOptions(
        msbuild_parameters=["/p:PublishAot=true"]
    )
)
```

Make sure `<AssemblyName>bootstrap</AssemblyName>` is set in the `csproj` file as this is required by the custom runtime.

> Publishing your application with Native AOT requires you to use the same processor architecture for the Lambda function as for your build environment. Without specification, the construct automatically selects the processor architecture of the machine where CDK is building your project.

## Community Extensions

We encourage the development of Community Service Extensions that support
advanced features. Here are some useful extensions that we have reviewed:

* [ListenerRulesExtension](https://www.npmjs.com/package/@wheatstalk/ecs-service-extension-listener-rules) for more precise control over Application Load Balancer rules

> Please submit a pull request so that we can review your service extension and
> list it here.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cdklabs/awscdk-lambda-dotnet.git",
    "name": "aws-cdk.aws-lambda-dotnet",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Amazon Web Services<aws-cdk-dev@amazon.com>",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/5a/e0/c6b9e94628354951fb516c2b23302c57e70ef111c011be3e3a059c667fcd/aws-cdk.aws-lambda-dotnet-0.0.4.tar.gz",
    "platform": null,
    "description": "# AWS Lambda .NET Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\nThis library provides constructs for .NET Lambda functions.\n\nTo use this module you will either need to have `.NET SDK` installed (`.NET 6.0` or later) with the [AWS Lambda Tools for .NET](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html) or `Docker` installed.\n\n## .NET Function\n\nDefine a `DotNetFunction`:\n\n```python\ndotnet.DotNetFunction(self, \"MyFunction\",\n    project_dir=\"src/MyFunction\"\n)\n```\n\nAll other properties of `lambda.Function` are supported, see also the [AWS Lambda construct library](https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-lambda).\n\n### Custom Runtime and Native AOT\n\nWith this construct it is possible to use a custom runtime by setting the runtime to `PROVIDED_AL2`. This allows you to run unsupported .NET runtime versions like .NET 7.0 or [Native AOT](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot). Setting the runtime to `PROVIDED_AL2` will instruct CDK and the AWS Lambda Tools for .NET to build your project in a Docker container based of Amazon Linux 2. An example can be found below.\n\n```python\ndotnet.DotNetFunction(self, \"MyFunction\",\n    project_dir=\"src/MyFunction\",\n    runtime=lambda_.Runtime.PROVIDED_AL2,\n    bundling=dotnet.BundlingOptions(\n        msbuild_parameters=[\"/p:PublishAot=true\"]\n    )\n)\n```\n\nMake sure `<AssemblyName>bootstrap</AssemblyName>` is set in the `csproj` file as this is required by the custom runtime.\n\n> Publishing your application with Native AOT requires you to use the same processor architecture for the Lambda function as for your build environment. Without specification, the construct automatically selects the processor architecture of the machine where CDK is building your project.\n\n## Community Extensions\n\nWe encourage the development of Community Service Extensions that support\nadvanced features. Here are some useful extensions that we have reviewed:\n\n* [ListenerRulesExtension](https://www.npmjs.com/package/@wheatstalk/ecs-service-extension-listener-rules) for more precise control over Application Load Balancer rules\n\n> Please submit a pull request so that we can review your service extension and\n> list it here.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "@aws-cdk/aws-lambda-dotnet",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/cdklabs/awscdk-lambda-dotnet.git",
        "Source": "https://github.com/cdklabs/awscdk-lambda-dotnet.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6260e0d77d353fcb5720898534fd8f3b92ee0f2c4c258a3fd53bfb787a962ebe",
                "md5": "5545a1ec57e20f2ce9a1bd0f46a201af",
                "sha256": "1ec5fe2f0010dd693655851c33d7b74c5dbdbf94a735f88a75149f0390b068c7"
            },
            "downloads": -1,
            "filename": "aws_cdk.aws_lambda_dotnet-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5545a1ec57e20f2ce9a1bd0f46a201af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 75509,
            "upload_time": "2024-03-29T10:20:43",
            "upload_time_iso_8601": "2024-03-29T10:20:43.101855Z",
            "url": "https://files.pythonhosted.org/packages/62/60/e0d77d353fcb5720898534fd8f3b92ee0f2c4c258a3fd53bfb787a962ebe/aws_cdk.aws_lambda_dotnet-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ae0c6b9e94628354951fb516c2b23302c57e70ef111c011be3e3a059c667fcd",
                "md5": "b311caa0b5899cfacc0ca90f5b05ba42",
                "sha256": "f7373f9a5161b48353b05255816b16db3df1775f561c3cde11a2a436ff3d3461"
            },
            "downloads": -1,
            "filename": "aws-cdk.aws-lambda-dotnet-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b311caa0b5899cfacc0ca90f5b05ba42",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 77244,
            "upload_time": "2024-03-29T10:20:44",
            "upload_time_iso_8601": "2024-03-29T10:20:44.925875Z",
            "url": "https://files.pythonhosted.org/packages/5a/e0/c6b9e94628354951fb516c2b23302c57e70ef111c011be3e3a059c667fcd/aws-cdk.aws-lambda-dotnet-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 10:20:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cdklabs",
    "github_project": "awscdk-lambda-dotnet",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aws-cdk.aws-lambda-dotnet"
}
        
Elapsed time: 0.22212s