Skip to content

Commit

Permalink
Fix sam build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
direnakkoc committed Feb 21, 2023
1 parent 1e4c860 commit a6bc083
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 202 deletions.
2 changes: 1 addition & 1 deletion cf-macro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import _ from 'lodash'
import Ajv from 'ajv'

import alarms from 'slic-watch-core/alarms/alarms'
import alarms from '../core/alarms/alarms'
import dashboard from 'slic-watch-core/dashboards/dashboard'
import CloudFormationTemplate from 'slic-watch-core/cf-template'
import defaultConfig from 'slic-watch-core/inputs/default-config'
Expand Down
4 changes: 3 additions & 1 deletion cf-macro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"version": "2.1.2",
"private": true,
"scripts": {
"test": "tap --coverage-report=html --no-browser --no-check-coverage tests/**/*.test.ts"
"test": "tap --coverage-report=html --no-browser --no-check-coverage tests/**/*.test.ts",
"build": "esbuild ./index.ts --outfile=dist/index.js --platform=node --format=esm --packages=external --bundle --sourcemap"
},
"tap": {
"node-arg": [
Expand All @@ -22,6 +23,7 @@
]
},
"devDependencies": {
"esbuild": "^0.17.10",
"esmock": "^2.1.0",
"ts-node": "^10.9.1"
},
Expand Down
10 changes: 1 addition & 9 deletions cf-macro/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@ Resources:
MacroLambdaFunction:
Type: AWS::Serverless::Function
Properties:
Handler: cf-macro/index.handler
Handler: dist/index.handler
Runtime: nodejs16.x
Timeout: 60
Architectures:
- x86_64
Policies:
- AWSLambdaBasicExecutionRole
Metadata:
BuildMethod: esbuild
BuildProperties:
Minify: false
Target: es2020
Sourcemap: true
EntryPoints:
- cf-macro/index.ts
2 changes: 1 addition & 1 deletion core/alarms/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default function LambdaAlarms (functionAlarmPropertiess: FunctionAlarmPro
funcName: { Ref: funcLogicalId },
ComparisonOperator: config.ComparisonOperator,
Threshold: threshold,
Metrics:metrics,
Metrics: metrics,
ExtendedStatistic: config.ExtendedStatistic,
EvaluationPeriods: config.EvaluationPeriods,
TreatMissingData: config.TreatMissingData,
Expand Down
Loading

0 comments on commit a6bc083

Please sign in to comment.