aws-sls-tf

所属分类:FaaS/Serverless
开发工具:HCL
文件大小:478KB
下载次数:0
上传日期:2022-02-13 04:59:44
上 传 者sh-1993
说明:  AWS无服务器地形加速器
(AWS Serverless Terraform Accelerator)

文件列表:
.editorconfig (559, 2022-02-13)
.vscode (0, 2022-02-13)
.vscode\settings.json (616, 2022-02-13)
LICENSE (11357, 2022-02-13)
app (0, 2022-02-13)
app\feature-flag (0, 2022-02-13)
app\feature-flag\index.py (3911, 2022-02-13)
app\feature-flag\set_env.sh (204, 2022-02-13)
app\variables.tf (931, 2022-02-13)
aws (0, 2022-02-13)
aws\acms.tf (374, 2022-02-13)
aws\all_objects_combined.tf (1937, 2022-02-13)
aws\api_gateways.tf (1387, 2022-02-13)
aws\api_integrations.tf (309, 2022-02-13)
aws\aws_s3_buckets.tf (1219, 2022-02-13)
aws\cloudfront_distro.tf (164, 2022-02-13)
aws\cognito.tf (2762, 2022-02-13)
aws\dynamodb_tables.tf (418, 2022-02-13)
aws\functions.tf (1143, 2022-02-13)
aws\inspire.code-workspace (565, 2022-02-13)
aws\lambda_layers.tf (572, 2022-02-13)
aws\locals.tf (3122, 2022-02-13)
aws\modules (0, 2022-02-13)
aws\modules\api_integrations (0, 2022-02-13)
aws\modules\api_integrations\main.tf (2995, 2022-02-13)
aws\modules\api_integrations\outs.tf (0, 2022-02-13)
aws\modules\api_integrations\read-api-integration.md (81, 2022-02-13)
aws\modules\api_integrations\variables.tf (5767, 2022-02-13)
aws\modules\api_integrations\vers.tf (153, 2022-02-13)
aws\step_functions.tf (265, 2022-02-13)
aws\variables.tf (671, 2022-02-13)
aws\vpcs.tf (727, 2022-02-13)
backend (0, 2022-02-13)
backend\backend.tfvars (182, 2022-02-13)
... ...

# Architecture The AWS-SLS-TF (the AWS Serverless with terraform) is an opiniated appraoch to implement AWS Serverless with terraform with the following high level goals: 1. Create a serverless manifest that is decoupled from its implementation detail. The manifest concept is very similar to `AWS SAM Model` where the user uses an extension of AWS CloudFormation to define the resources, and their interrelationships, in addition to input and output parameters. 2. Extracting the configuration from the implementation; the end-users only need to get trained on tailoring the configurations in a Relational manner and follow the templates (or solutions) 3. Layered Architecture where different resource owners (or implementation teams) deploy terraform and share the resources with other team members. As an example, the NOC team may create Networking resources and provide VPC endpoints, security groups, and subnet details to application development teams who will use those to create `aws lambda functions` within a VPC subnet. The following diagram shows the above objectives: ![](https://github.com/seyedk/aws-sls-tf/blob/master/docs/img/terraform%20architecture%20bg-white.png) 4)Manging the layers by using Terraform State management features such as remote states, where the resources on each layer in the architecture is available to other layers in a mixture shown below: ![](https://github.com/seyedk/aws-sls-tf/blob/master/docs/img/terraform%20architecture%20-%20State%20mgmt%20conceptual.png) 5)This is not meant for Serverless only, but we begin with a simple concept like serverless to build and warm up our team; later we'll evolve to cover more advanced scenarios. ## Terraform State management Example This repo is meant to showcase using terraform states in creating layered archtiecture in AWS. The lines 36 to 40 in [this mocule](https://github.com/seyedk/aws-sls-tf/blob/master/modules/services/hello-world-app/main.tf) shows how the applicaiton layer has been implemented: The Data Layer state is ingested into service layer. Instead ## Getting Started In order to use the serverless accelerator, you need the folllowing prerquisites: ## Prerequisites 1. Terraform version ~>0.14 1. AWS CLI (> V2.00) 1. aws-azure-login (npm) ## Running examples 1. Change directory to `solutions` and create your serverless solution layer 1. create the serverless manifest configuration file (.tfvars) ### login first you need to login to your aws account with an IAM user: If you have single sign on enabled with an Identity provider, use the command line options to loign to AWS. For Azure AD, you can use `aws-azure-login` NPM Module as shown below. Use a named profile when applicable: ```bash aws-azure-login --profile ``` ### init It's very important to pay special care when using the key. This key is will be referenced as a layer name. ```bash tf init -backend-config=backend/backend.tfvars -backend-config="key=/terraform.tfstate" ``` ### plan/Apply When using the plan, you should specify the location of the serverless module: ```bash tf plan|apply -var-file=configuration.tfvars ``` For this quick start, the location is at `../../` as shown below: ```bash tf plan|apply -var-file=configuration.tfvars ../../ ``` ## Build and Test TODO: Describe and show how to build your code and run the tests. ## Contribute The next few sections will provide steps how to integrate one layer with other layers ## Integrate with Another layer ### 1 - [scenario 1 - integrate with VPC](https://github.com/seyedk/aws-sls-tf/blob/master/docs/integrate-lambda-with-vpc.md)

近期下载者

相关文件


收藏者