unable to terminate elastic beanstalk environment - amazon-web-services

I am trying so hard to delete an elastic beanstalk environment but it is showing some error as shown in the below screenshot. Any help will be appreciated.

It is saying that something (else) is using the Security Group.
You should:
Try to manually delete that Security Group
If you get an error (most likely), then you will need to hunt for other resources that are using that security group (probably some other EC2 instances)
If you are okay with removing the Security Group:
Detach the Security Group from the other resource(s)
Try terminating the stack again
If you do not wish to delete that Security Group, then:
Delete the CloudFormation stack manually
When stack deletion fails, try it again and it will ask which resources you do not wish to delete. You can select the Security Group here
Once the Stack is deleted, go back into Elastic Beanstalk and try to clean things up

Related

How to terminate AWS managed blockchain instance

I followed these instructions below to get an AWS Ethereum instance running, however since I am just learning blockchain, I would like to create an image and start/stop as needed. However when I go to EC2 and stop my instance, it restarts. I saw other posts about this being caused by elastic beanstalk but when I go to elastic beanstalk, I don't see anything there. What else could be causing it to restart?
Thanks!
https://docs.aws.amazon.com/blockchain-templates/latest/developerguide/blockchain-templates-getting-started.html
If you check the source code of one of its nested stacks ethereum-autoscalegroup.template.yaml, you can see that it actually creates instances in an autoscaling group (ASG).
Instances in ASG can't be stopped. However, you can terminate them, by setting desired capacity and minimum capacity to 0 of your ASG. Then if you want to create new instances when you need them, you can change desired capacity back to 1.

Everytime I stop an EC2 instance, another one is created

I'm new to AWS, and I tried EC2 instances,
But now I want to stop all the instances, and everytime I stop one, another is created,
Is there a way to stop all EC2 instances forever because I have a $1 bill for this,
This is the behaviour of an autoscaling group. Everytime you stop it, its health check fails which is triggering the behaviour you're seeing.
The instance itself should have a tag of aws:autoscaling:groupName containing the autoscaling group name. Find this autoscaling group within the EC2 console and set the minimum, maximum and desired counts to 0.
If the autoscaling group was created outside of the EC2 console i.e. CloudFormation template or part of an ElasticBeanstalk deployment then you should ensure that you change these settings within their configuration not directly via the console.

AWS wont let me delete custom Security Groups that I had created

I am new to AWS and,
Here's the drill:
- Logged in to AWS with root admin credentials.
- I created few security groups in AWS.
- Terminated all the EC2 instances that I had.
- Deleted ELB successfully.
- Deleted RDS successfully.
- Using default VPC and no Elastic IPs.
Now, when I am trying to delete security groups, one group says its being referenced by another. When I try to delete the referenced one, it says that the security group is being referenced by a Network Interface.
We get two options here- Associate with another group or Delete that Network Interface.
Trying first makes no sense as I want to get rid of all the Security Groups except the default (Like it was in the beginning). Still I tried that option and got the error "You do not have permission to access the specified resource" and it did not let me associate that Network Interface (Status-In Use) with any Security Group.
Tried deleting/detaching(force) that Network Interface and got an error message "You do not have permission to access the specified resource."
A similar issue can be found below without any known solution:
https://forums.aws.amazon.com/thread.jspa?threadID=99189&start=0&tstart=0
Unresolved Stackoverflow link: issue in deleting VPC and network interface
I would really appreciate if someone hits me with a hammer of facts :)
Thanks, in advance!
I had the same issue, after having removed load balancers, auto-scaling groups, the memcached cluster and so on, I couldn't delete the VPC.
I had the feeling that there was some vicious circle between two network interfaces that I couldn't detach or modify and the security group itself that I couldn't remove as long as it was attached to the interfaces.
I ran the aws elasticache describe-instances command (I saw a reference to elasticache in a network interface description) to see if it would show something I missed.
And indeed, there was some redis cluster remaining, that I didn't see in the mess of the UI, which was some remnant of a long forgotten test. After having removed this cluster, I could delete the VPC.
So I'd say that kind of issue: unauthorized access, even for admins is mainly related to a component managed by AWS, and to the fact that the UI is far from friendly when it comes to know from where an error comes.
https://forums.aws.amazon.com/thread.jspa?threadID=168376
It looks like sg-72bd411a does in fact reference itself. You'll need to go into it and remove the reference before you can delete it.

Amazon AWS Grey state - Deleting security group failed

I am new to AWS. After invalid deployment my environment cloudapp went to the Grey state. I have created another environment cloudapp-1and successfully uploaded and deployed my app. Then I swap the URLs to keep the first address still working.
Now when my first env is in the Grey state I am not able to do anything with it. I am not able to deploy, rebuild or even terminate it. I receive errors like this ones below.
Stack deletion failed: The following resource(s) failed to delete: [awseb-xxx-AWSEBSecurityGroup].
2016-07-13 13:23:32 UTC+0200 ERROR Deleting security group named: awseb-xxx-AWSEBSecurityGroup failed Reason: resource sg-xxxxxxx has a dependent object
I have tried to remove AWSEBSecurityGroup from cloudapp but i cannot because:
Error
Unable to validate settings: Environment named cloudapp is in an invalid state for this operation. Must be Ready.
It looks like kind of deadlock. I cannot delete the env because of a security group and I cannot change that group because the env is not Ready.
How to fix it?
First make sure that no other instances than the ElasticBeanstalk EC2 instances belonging to this particular environment is using the sg-xxxxxx security group.
Then you must make sure that you do not have any depending objects of that security group, like the error message vaguely states. Go to EC2 > Security Groups and search by Source/Destination (Group Id) for the sg-xxxxxx group.
This will give you a list of all security groups having rules referencing sg-xxxxxx. Once you've removed the depending rules you can retry your ElasticBeanstalk operation.

AWS Automatically Generating New Instance After I Terminate It.

OK, odd thing is happening on AWS.
I downloaded the AWS .NET developer tools and created an elastic beanstalk default instance.
I then, for one reason or another, created another instance via the Visual Studio interface and that instance is where all the clients code / configurations reside. I then returned to the default instance created by elastic beanstalk and terminated it. An hour later, I logged back on and another default instance was up and running. It seems that AWS has detected that I terminated the instance and has spawned another. Some sort of check seems to be in place.
Can somebody tell me what is going on here and how to completely remove the default instance (and its termination protection behavior)?
Thanks.
I've experienced something similar. If the instance was created through Elastic Beanstalk, you need to go the Elastic Beanstalk screen in the AWS console and remove the application from there first. If you just terminate the instance from the EC2 screen, Elastic Beanstalk probably thinks that the instance crashed and launches a new one.
if beanstalk is not enable, then most probably it is creating from auto scaling. which is present in EC2 service itself.
Go to auto scaling and first delete the auto configuration group and launch configuration for that associate instance.
As described here it is caused by Auto Scaling Group's desired/minimum 1 instance setting. So, what that means is that the instances in that auto scaling group will always have a running instance. If you delete the only one it will create another one. To prevent this go to EC2 dashboard and on the left sidebar scroll down to find/click Auto Scaling Groups under AUTO SCALING menu. You will see the list of groups where you can click on them to see which instances are in those groups. Find the group that your instance is in and either delete it (that happens when an environment is deleted as well) or change its desired and minimum 1 instance rule to 0 and save. That is it.
Check your autoscaling groups. If you would have created node groups for your EKS cluster.