File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 12
12
runs-on : ubuntu-latest
13
13
14
14
env :
15
- TERRAFORM_VERSION : 0.13.5
15
+ TERRAFORM_VERSION : 1.4.0
16
16
TERRAFORM_WORK_DIR : ./terraform
17
17
18
18
steps :
Original file line number Diff line number Diff line change 1
1
import { Handler } from "aws-lambda" ;
2
2
import axios from 'axios' ;
3
3
import { Payload , Text } from "./types" ;
4
+ import { error } from "console" ;
4
5
5
6
const handler : Handler = async ( payload : Payload ) => {
6
7
const apiKey = process . env . API_Key ;
7
8
const apiUrl = process . env . API_URL ;
8
9
const { headers, data } = payload ;
9
10
10
11
try {
12
+ if ( ! apiUrl )
13
+ {
14
+ throw error ;
15
+ }
11
16
// Make the HTTP request using Axios
12
17
const response = await axios . post ( apiUrl , data , {
13
18
headers : headers ,
Original file line number Diff line number Diff line change 1
- import "./libs/aws-sdk" ;
1
+ export const PAYLOAD = {
2
+ headers : [
3
+
4
+ ] ,
5
+ data : {
6
+ "message" : "An example alert message" ,
7
+ "alias" : "Life is too short for no alias" ,
8
+ "description" :"Every alert needs a description" ,
9
+ "responders" :[
10
+ { "id" :"4513b7ea-3b91-438f-b7e4-e3e54af9147c" , "type" :"team" } ,
11
+ ] ,
12
+ "visibleTo" :[
13
+ { "id" :"4513b7ea-3b91-438f-b7e4-e3e54af9147c" , "type" :"team" } ,
14
+ ] ,
15
+ "actions" : [ "Restart" , "AnExampleAction" ] ,
16
+ "tags" : [ "OverwriteQuietHours" , "Critical" ] ,
17
+ "details" :{ "key1" :"value1" , "key2" :"value2" } ,
18
+ "entity" :"An example entity" ,
19
+ "priority" :"P1"
20
+ }
21
+ }
22
+
You can’t perform that action at this time.
0 commit comments