Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ASG EC2 instance with delay of 5 mins #37567

Closed
pb9743 opened this issue May 16, 2024 · 3 comments
Closed

Create ASG EC2 instance with delay of 5 mins #37567

pb9743 opened this issue May 16, 2024 · 3 comments
Labels
question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.

Comments

@pb9743
Copy link

pb9743 commented May 16, 2024

Description

Below is my code to create delay of 5 mins before launching new EC2 instance from ASG after existing instance stopped manually from EC2 console (testing purpose). But new EC2 instance is launching before 5 mins.
Requirement is to create an Auto Scaling Group (ASG) where new EC2 instances start only after an existing server becomes stopped for 5 minutes. How to achieve it using AWS Terraform.

resource "aws_cloudwatch_metric_alarm" "stopped_instances_alarm" {
  alarm_name          = "StoppedInstancesAlarm"
  comparison_operator = "GreaterThanOrEqualToThreshold"
  evaluation_periods  = 1 # 
  metric_name         = "StoppedInstances"
  namespace           = "Custom/EC2"
  period              = 300 # 
  statistic           = "Sum"
  threshold           = 1 
  alarm_description   = "Alarm triggered when number of stopped instances exceeds threshold within 5 minutes"
}

References

No response

Would you like to implement a fix?

None

Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/cloudwatch Issues and PRs that pertain to the cloudwatch service. label May 16, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 16, 2024
@justinretzolk justinretzolk added question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. and removed needs-triage Waiting for first response or review from a maintainer. labels May 20, 2024
@justinretzolk
Copy link
Member

Hey @pb9743 👋 Thank you for taking the time to raise this! We use Issues in this repository to track feature enhancements and bugs in the AWS Provider. To maintain that, we ask that broader questions are raised using one of the Community Resources, such as the AWS Provider forum. With that in mind, I'm going to close this issue.

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Projects
None yet
Development

No branches or pull requests

2 participants