Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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", {
description: "This is my API for demonstration purposes",
});
const restApiMetric = awsx.apigateway.metrics.error5XX({ restApi });
const restApiAlarm = restApiMetric.createAlarm("alarm" + alarmIndex++, { threshold: 50, evaluationPeriods: 2 });
const table = new aws.dynamodb.Table("testtable", {
attributes: [{
name: "id",
type: "S",
}],
hashKey: "id",
readCapacity: 5,