Skip to content

Commit

Permalink
Add API key requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
yang0352 committed Apr 9, 2025
1 parent 289682d commit 2cc9413
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Description: >
eks-automation-lambda
Resources:
EKSAutomationApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Auth:
ApiKeyRequired: true # sets for all methods
GitLambdaLayer:
Type: AWS::Serverless::LayerVersion
Properties:
Expand All @@ -25,8 +31,11 @@ Resources:
EKSAutomation:
Type: Api
Properties:
RestApiId: !Ref EKSAutomationApi
Path: /EKSAutomation
Method: get
Auth:
ApiKeyRequired: true
Policies:
- AWSLambdaVPCAccessExecutionRole
- Statement:
Expand Down Expand Up @@ -63,7 +72,7 @@ Resources:
Outputs:
EKSAutomationApi:
Description: "API Gateway endpoint URL for Prod stage for EKS Automation function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/automation/"
Value: !Sub "https://${EKSAutomationApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/automation/"
EKSAutomationFunction:
Description: "EKS Automation Lambda Function ARN"
Value: !GetAtt EKSAutomationFunction.Arn
Expand Down

0 comments on commit 2cc9413

Please sign in to comment.