| 1 |
AWSTemplateFormatVersion: '2010-09-09' |
| 2 |
Transform: AWS::Serverless-2016-10-31 |
| 3 |
Description: > |
| 4 |
Go Driver lambda function test |
| 5 |
|
| 6 |
Parameters: |
| 7 |
MongoDbUri: |
| 8 |
Type: String |
| 9 |
Description: The MongoDB connection string. |
| 10 |
|
| 11 |
Globals: |
| 12 |
Function: |
| 13 |
Timeout: 30 |
| 14 |
|
| 15 |
Resources: |
| 16 |
MongoDBFunction: |
| 17 |
Type: AWS::Serverless::Function |
| 18 |
Metadata: |
| 19 |
BuildMethod: go1.x |
| 20 |
Properties: |
| 21 |
CodeUri: mongodb/ |
| 22 |
Handler: bootstrap |
| 23 |
Runtime: provided.al2 |
| 24 |
Architectures: [arm64] |
| 25 |
Events: |
| 26 |
MongoDB: |
| 27 |
Type: Api |
| 28 |
Properties: |
| 29 |
Path: /mongodb |
| 30 |
Method: GET |
| 31 |
Environment: |
| 32 |
Variables: |
| 33 |
MONGODB_URI: !Ref MongoDbUri |
| 34 |
|
| 35 |
Outputs: |
| 36 |
MongoDBApi: |
| 37 |
Description: "API Gateway endpoint URL for Prod stage for MongoDB function" |
| 38 |
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/mongodb/" |
| 39 |
MongoDBFunction: |
| 40 |
Description: "MongoDB Lambda Function ARN" |
| 41 |
Value: !GetAtt MongoDBFunction.Arn |
| 42 |
MongoDBFunctionIamRole: |
| 43 |
Description: "Implicit IAM Role created for MongoDB function" |
| 44 |
Value: !GetAtt MongoDBFunctionRole.Arn |