{"id":13461695,"url":"https://github.com/aws/serverless-application-model","last_synced_at":"2025-05-14T22:05:25.792Z","repository":{"id":37081330,"uuid":"70530854","full_name":"aws/serverless-application-model","owner":"aws","description":"The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.","archived":false,"fork":false,"pushed_at":"2025-05-06T16:05:28.000Z","size":178997,"stargazers_count":9447,"open_issues_count":96,"forks_count":2413,"subscribers_count":277,"default_branch":"develop","last_synced_at":"2025-05-07T21:14:48.153Z","etag":null,"topics":["aws","aws-sam","lambda","sam","sam-specification","serverless","serverless-application-model","serverless-applications"],"latest_commit_sha":null,"homepage":"https://aws.amazon.com/serverless/sam","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-10-10T21:36:18.000Z","updated_at":"2025-05-05T14:29:49.000Z","dependencies_parsed_at":"2023-09-27T00:18:18.300Z","dependency_job_id":"ae7d8318-f7d6-4a8a-a687-b6c5834863d9","html_url":"https://github.com/aws/serverless-application-model","commit_stats":{"total_commits":1543,"total_committers":276,"mean_commits":5.590579710144928,"dds":0.8950097213220998,"last_synced_commit":"17000c195d65a41ee830173e7110ad2c36078a7a"},"previous_names":["awslabs/serverless-application-model"],"tags_count":105,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fserverless-application-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fserverless-application-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fserverless-application-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fserverless-application-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws","download_url":"https://codeload.github.com/aws/serverless-application-model/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253891740,"owners_count":21979850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-sam","lambda","sam","sam-specification","serverless","serverless-application-model","serverless-applications"],"created_at":"2024-07-31T11:00:52.922Z","updated_at":"2025-05-14T22:05:25.759Z","avatar_url":"https://github.com/aws.png","language":"Python","readme":"# AWS SAM transform\n\n[![Tests](https://github.com/aws/serverless-application-model/actions/workflows/build.yml/badge.svg)](https://github.com/aws/serverless-application-model/actions/workflows/build.yml)\n[![Update schema](https://github.com/aws/serverless-application-model/actions/workflows/schema.yml/badge.svg)](https://github.com/aws/serverless-application-model/actions/workflows/schema.yml)\n[![PyPI](https://img.shields.io/pypi/v/aws-sam-translator?label=PyPI)](https://pypi.org/project/aws-sam-translator/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aws-sam-translator?label=Python)](https://pypi.org/project/aws-sam-translator/)\n[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/aws/serverless-application-model.git)\n\nThe [AWS Serverless Application Model](https://aws.amazon.com/serverless/sam/) (AWS SAM) transform is a [AWS CloudFormation macro](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) that transforms [SAM templates](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy.html) into [CloudFormation templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html).\n\nTo use the SAM transform, add `AWS::Serverless-2016-10-31` to the [`Transform` section](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html) of your CloudFormation template.\n\nBenefits of using the SAM transform include:\n\n- Built-in best practices and sane defaults.\n- Local testing and debugging with the [AWS SAM CLI](https://github.com/aws/aws-sam-cli).\n- Extension of the CloudFormation template syntax.\n\n## Getting started\n\nSave the following as `template.yaml`:\n\n```yaml\nTransform: AWS::Serverless-2016-10-31\nResources:\n  MyFunction:\n    Type: AWS::Serverless::Function\n    Properties:\n      Runtime: nodejs18.x\n      Handler: index.handler\n      InlineCode: |\n        exports.handler = async (event) =\u003e {\n          console.log(event);\n        }\n```\n\nAnd deploy it with the [SAM CLI](https://github.com/aws/aws-sam-cli):\n\n```bash\nsam sync --stack-name sam-app\n```\n\nThe [`AWS::Serverless::Function`](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource will create a [AWS Lambda](https://aws.amazon.com/lambda/) function that logs [events](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-concepts.html#gettingstarted-concepts-event) it receives.\n\nUnder the hood, the template is transformed into the JSON equivalent of the following CloudFormation template:\n\n```yaml\nResources:\n  MyFunction:\n    Type: AWS::Lambda::Function\n    Properties:\n      Code:\n        ZipFile: |\n          exports.handler = async (event) =\u003e {\n            console.log(event);\n          }\n      Handler: index.handler\n      Role: !GetAtt MyFunctionRole.Arn\n      Runtime: nodejs18.x\n      Tags:\n        - Key: lambda:createdBy\n          Value: SAM\n  MyFunctionRole:\n    Type: AWS::IAM::Role\n    Properties:\n      AssumeRolePolicyDocument:\n        Version: \"2012-10-17\"\n        Statement:\n          - Action:\n              - sts:AssumeRole\n            Effect: Allow\n            Principal:\n              Service:\n                - lambda.amazonaws.com\n      ManagedPolicyArns:\n        - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole\n      Tags:\n        - Key: lambda:createdBy\n          Value: SAM\n```\n\nFor a more thorough introduction, see the [this tutorial](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html) in the [Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html).\n\n## Contributing\n\n### Setting up development environment\n\nYou'll need to have Python 3.8+ installed.\n\nCreate a [virtual environment](https://docs.python.org/3/library/venv.html):\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\nSet up dependencies:\n\n```bash\nmake init\n```\n\nRun tests:\n\n```bash\nmake pr\n ```\n \nSee [`DEVELOPMENT_GUIDE.md`](DEVELOPMENT_GUIDE.md) for further development instructions, and [`CONTRIBUTING.md`](CONTRIBUTING.md) for the contributing guidelines.\n\n## Getting help\n\nThe best way to interact with the team is through GitHub. You can either [create an issue](https://github.com/aws/serverless-application-model/issues/new/choose) or [start a discussion](https://github.com/aws/serverless-application-model/discussions).\n\nYou can also join the [`#samdev` channel](https://join.slack.com/t/awsdevelopers/shared_invite/zt-yryddays-C9fkWrmguDv0h2EEDzCqvw) on Slack.\n\n## Learn more\n\n### Workshops and tutorials\n\n- [The Complete AWS SAM Workshop](https://catalog.workshops.aws/complete-aws-sam)\n- [AWS Serverless Developer Experience Workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/9a27e484-7336-4ed0-8f90-f2747e4ac65c/en-US)\n- [Deploying a \"Hello, World!\" application](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html)\n- [Testing in the cloud using the SAM CLI](https://aws.amazon.com/blogs/compute/accelerating-serverless-development-with-aws-sam-accelerate/)\n\n### Documentation\n\n- [SAM Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)\n- [SAM template specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html)\n- [SAM connectors](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/managing-permissions-connectors.html)\n- [SAM policy templates](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-policy-templates.html)\n","funding_links":[],"categories":["Python","Industrial Materials","HarmonyOS","后端开发框架及项目"],"sub_categories":["Tools","Windows Manager","管理面板"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Fserverless-application-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws%2Fserverless-application-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Fserverless-application-model/lists"}