forked from calvinjkim/datadog-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
109 lines (101 loc) · 2.5 KB
/
template.yaml
File metadata and controls
109 lines (101 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Datadog MCP Server - Read-only Metrics & Logs for Claude
Globals:
Function:
Timeout: 30
MemorySize: 256
Runtime: nodejs20.x
Parameters:
DatadogApiKey:
Type: String
NoEcho: true
Description: Datadog API Key
DatadogAppKey:
Type: String
NoEcho: true
Description: Datadog Application Key
DatadogSite:
Type: String
Default: datadoghq.com
Description: Datadog site (e.g. datadoghq.com, datadoghq.eu)
Resources:
McpApi:
Type: AWS::Serverless::Api
Properties:
StageName: prod
Auth:
ApiKeyRequired: true
McpFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: esbuild
BuildProperties:
Minify: false
Target: es2022
Sourcemap: true
EntryPoints:
- src/index.ts
Properties:
Handler: index.handler
CodeUri: .
Environment:
Variables:
DD_API_KEY: !Ref DatadogApiKey
DD_APP_KEY: !Ref DatadogAppKey
DD_SITE: !Ref DatadogSite
Events:
McpPost:
Type: Api
Properties:
RestApiId: !Ref McpApi
Path: /mcp
Method: POST
McpGet:
Type: Api
Properties:
RestApiId: !Ref McpApi
Path: /mcp
Method: GET
McpDelete:
Type: Api
Properties:
RestApiId: !Ref McpApi
Path: /mcp
Method: DELETE
ApiKey:
Type: AWS::ApiGateway::ApiKey
DependsOn: McpApiprodStage
Properties:
Name: datadog-mcp-team-key
Enabled: true
StageKeys:
- RestApiId: !Ref McpApi
StageName: prod
UsagePlan:
Type: AWS::ApiGateway::UsagePlan
DependsOn: McpApiprodStage
Properties:
UsagePlanName: datadog-mcp-plan
Throttle:
BurstLimit: 50
RateLimit: 20
Quota:
Limit: 10000
Period: DAY
ApiStages:
- ApiId: !Ref McpApi
Stage: prod
UsagePlanKey:
Type: AWS::ApiGateway::UsagePlanKey
Properties:
KeyId: !Ref ApiKey
KeyType: API_KEY
UsagePlanId: !Ref UsagePlan
Outputs:
McpEndpoint:
Description: MCP Server endpoint URL
Value: !Sub 'https://${McpApi}.execute-api.${AWS::Region}.amazonaws.com/prod/mcp'
ApiKeyId:
Description: API Key ID (run "aws apigateway get-api-key --api-key <id> --include-value" to get the key value)
Value: !Ref ApiKey