Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(`${url}: Getting`);
try {
const res = await fetch.default(url);
} catch (err) {
console.log(`${url}: Failed to GET`);
return;
}
}
});
let alarmIndex = 0;
const funcMetric = awsx.lambda.metrics.duration({ function: subscription.func, unit: "Seconds" });
const funcAlarm = funcMetric.createAlarm("alarm" + alarmIndex++, { threshold: 120, evaluationPeriods: 2 });
const topicMetric = awsx.sns.metrics.numberOfMessagesPublished({ topic });
const topicAlarm = topicMetric.createAlarm("alarm" + alarmIndex++, { threshold: 1000, evaluationPeriods: 2 });
const queue = new aws.sqs.Queue("terraform_queue", {
delaySeconds: 90,
maxMessageSize: 2048,
messageRetentionSeconds: 86400,
receiveWaitTimeSeconds: 10,
tags: {
Environment: "production",
},
});
const queueMetric = awsx.sqs.metrics.sentMessageSize({ queue });
const queueAlarm = queueMetric.createAlarm("alarm" + alarmIndex++, { threshold: 120, evaluationPeriods: 2 });
const restApi = new aws.apigateway.RestApi("MyDemoAPI", {