amazon-cloudwatch

using one terraform inventory into another terraform script

大憨熊 提交于 2020-01-07 02:53:08
问题 I am trying to write a seperate terraform script for aws cloudwatch alerts apart from creating aws instances, i want to use terraform inventory of different terraform script which will build aws instances.How to access the inventory of one terraform script and use it in the cloudwatch alerts terraform script? Thank you! 回答1: This is possible if you are using remote state. You will have to use root-level outputs to expose the values you want to be able to access from the second Terraform state

CloudWatch Event that targets SQS Queue fails to work

北战南征 提交于 2020-01-06 07:09:37
问题 According to this article it's possible to set SQS as target for scheduled CloudWatch event: https://aws.amazon.com/ru/about-aws/whats-new/2016/03/cloudwatch-events-now-supports-amazon-sqs-queue-targets/ I've created a simple Cloud Formation template that aims to trigger CloudWatch event each minute so the new message should appear in SQS , but something is missing as there are no messages in SQS . The code: { "AWSTemplateFormatVersion": "2010-09-09", "Description": "stack 1", "Parameters": {

Will increasing my EC2 limit for the relevant instance solve a latency issue?

╄→尐↘猪︶ㄣ 提交于 2020-01-06 05:56:07
问题 I'm a noob and am having a problem with one specific instance. Can anyone tell me if increasing some (?) limit for this instance will solve the problem? The instance type is t2.small. Also, a customer has had trouble with the website timing out when attempting to sign-up. I assume that would throw a status 500 error, as referenced below, right. Thus, does this mean a limit increase of some sort would eliminate the timeout problem with sign up? Two alarms have been going off repeatedly. Here's

Dynamically adding/removing EC2 instances of an AutoscalingGroup to AWS Dashboard Metric Widget

无人久伴 提交于 2020-01-04 14:08:36
问题 I am trying to create a dashboard and want a widget to display the CPUUtilization graphs of ALL EC2 instances within my autoscaling. Whenever a new instance gets added by autoscaling rules then the dashboard widget should include the graph of new EC2 instance automatically and when an instance gets deleted it should remove the graph of that instance. When I select the autoscaling group as the metric it simply displays one line in the graph although there are 4 instances within that

Dynamically adding/removing EC2 instances of an AutoscalingGroup to AWS Dashboard Metric Widget

我们两清 提交于 2020-01-04 14:06:31
问题 I am trying to create a dashboard and want a widget to display the CPUUtilization graphs of ALL EC2 instances within my autoscaling. Whenever a new instance gets added by autoscaling rules then the dashboard widget should include the graph of new EC2 instance automatically and when an instance gets deleted it should remove the graph of that instance. When I select the autoscaling group as the metric it simply displays one line in the graph although there are 4 instances within that

Fetching CloudWatch metrics using the AWS Java SDK?

久未见 提交于 2020-01-03 09:54:34
问题 I'm trying to fetch CPU stats from an EC2 instance using the CloudWatch API: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.html I have the following code but its returning an empty result, even though the instance Id, and AWS access and secret keys are correct. I can see the CPU util for the instance on the CloudWatch UI, but can't seem to get it below? I'm using version 1.9.0 of the AWS SDK. Any help much appreciated. import

AWS CloudWatch Alarm to add capacity to EC2 autoscaling group has been in alarm forever

家住魔仙堡 提交于 2020-01-03 05:44:20
问题 I set a CloudWatch Alarm to add 1 capacity unit to EC2 autoscaling group when memory reservation is > 70%. The Alarm was triggered at the right moment, but it has since been in alarm for 16 hours+ with no change at all in the EC2 autoscaling group. What could possibly be going wrong? Here's my ECS CloudFormation template: ECSCluster: Type: AWS::ECS::Cluster Properties: ClusterName: !Ref EnvironmentName ECSAutoScalingGroup: DependsOn: ECSCluster Type: AWS::AutoScaling::AutoScalingGroup

Shutdown EC2 Instance if idle right before another billable hour

不羁岁月 提交于 2020-01-01 05:45:15
问题 At unpredictable times (user request) I need to run a memory-intensive job. For this I get a spot or on-demand instance and mark it with a tag as non_idle . When the job is done (which may take hours), I give it the tag idle . Due to the hourly billing model of AWS, I want to keep that instance alive until another billable hour is incurred in case another job comes in. If a job comes in, the instance should be reused and marked it as non_idle . If no job comes in during that time, the

AWS Lambda Python 3.7 runtime exception logging

£可爱£侵袭症+ 提交于 2020-01-01 02:08:35
问题 Unhandled exceptions thrown while using the Python 3.7 runtime do not seem to be logged to CloudWatch as they are in Python 3.6. How can you setup the logger in Python 3.7 to capture this information? Also posted on AWS forum To replicate: 1. Create a lambda function like so: import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) def lambda_handler(event, context): logger.info("This shows fine") raise Exception("I failed") 2. Run this function using the Python 3.6 runtime

Avoiding INSUFFICIENT DATA in Cloudwatch?

痞子三分冷 提交于 2020-01-01 01:10:15
问题 I have alarms set up to tell me when my load balancers are throwing 5xxs using the HTTPCode_Backend_5XX metric with the sum statistic. The issue is that sum registers 0 as no data points, so when no 5xxs are thrown, the alarm is treated as insufficient data. This is especially frustrating, because I have SNS setup to notify me whenever we get too many 5xxs (alarm state) and whenever things go back to normal. Annoyingly, 0 5xxs means we're in INSUFFICIENT DATA status, but 1 5xx means we're in