Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Claude-GP committed Jan 29, 2024
1 parent 6384b4d commit 8d40ab4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

env:
TERRAFORM_VERSION: 0.13.5
TERRAFORM_VERSION: 1.4.0
TERRAFORM_WORK_DIR: ./terraform

steps:
Expand Down
5 changes: 5 additions & 0 deletions lambda/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { Handler } from "aws-lambda";
import axios from 'axios';
import { Payload, Text } from "./types";
import { error } from "console";

const handler: Handler = async (payload: Payload) => {
const apiKey = process.env.API_Key;
const apiUrl = process.env.API_URL;
const { headers, data } = payload;

try {
if (!apiUrl)
{
throw error;
}
// Make the HTTP request using Axios
const response = await axios.post(apiUrl, data, {
headers: headers,
Expand Down
23 changes: 22 additions & 1 deletion test/mocks/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
import "./libs/aws-sdk";
export const PAYLOAD = {
headers: [

],
data: {
"message": "An example alert message",
"alias": "Life is too short for no alias",
"description":"Every alert needs a description",
"responders":[
{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c", "type":"team"},
],
"visibleTo":[
{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
],
"actions": ["Restart", "AnExampleAction"],
"tags": ["OverwriteQuietHours","Critical"],
"details":{"key1":"value1","key2":"value2"},
"entity":"An example entity",
"priority":"P1"
}
}

0 comments on commit 8d40ab4

Please sign in to comment.