Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 56 additions & 0 deletions checkOV/aws_sam.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'

Resources:
# Lambda function
MyLambdaFunction:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs14.x
CodeUri: s3://my-bucket/my-function-code.zip
MemorySize: 128
Timeout: 10
Environment:
Variables:
LOG_LEVEL: 'info'
Policies:
- AWSLambdaBasicExecutionRole
- AWSXrayWriteOnlyAccess
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- s3:GetObject
Resource: arn:aws:s3:::my-bucket/*

# API Gateway
MyApi:
Type: 'AWS::Serverless::Api'
Properties:
Name: 'MyApi'
StageName: 'prod'
EndpointConfiguration: REGIONAL
Cors: "'*'"

# IAM Role for Lambda
LambdaExecutionRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: 'LambdaExecutionPolicy'
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'logs:*'
- 's3:ListBucket'
Resource: '*'
Loading