Determine which AutoScaling Group a Launch Configuration is attached to - amazon-web-services

Question: Is there a way to determine which AutoScaling Group a Launch Configuration is attached to.
Why do I need to know? I have a list of existing Launch Configurations and I want to delete one of them.
Undesirable Solutions:
I can get a list of all my AutoScaling Groups and look through each one to determine which Launch Configuration it is using.
I can just try to delete the Launch Configuration and then having the error tell me which AutoScaling Group it is attached to.
Desirable Solutions:
Query Launch Configuration and have it return which group it is attached to.
Query all AutoScaling Groups with the Launch Configuration name as a filter.

The answer as of this moment is that the solution I am looking for does not yet exist.
In light of this current lack I have proceeded to evaluate my Undesirable Solutions.
I first considered using a try/catch|except block and parsing the error when trying to delete a Launch Configuration that was attached to a group. The cost of parsing was more than I wanted to deal with so I decided to go with looping through the AutoScaling Groups and finding a match for each individual Launch Configuration.
While the solution is less than ideal, it is working quite nicely. I hope to post the code on GitHub shortly so that others can also benefit from it.
Update: 07 August 2013
Here is some code on GitHub that I have been working on. Hope it is helpful to others.

Related

GCP unknown activity logs related to VM creation. What could be causing them?

So I am helping out on a project in Google cloud and recently it has come to my attention that in the "activity" tab, right next to the dashboard on the home page there is a set of logs. My problem is that I am getting a series of logs on repeat with the following order:
1.Create VM
2.Add instances to instance group
3.Remove instances from instance group
4.Delete VM
Also, the actions are being done by a service account.
This project had people working before in it, so I am not aware of everything that has been done in the past. That being said, I am tasked with finding out where this is coming from.
In my search I came up with things like there might have been an managed instance group with load balancer and autoscaler enabled which could be causing the automatic recreation of instances. However, when searching on this section there is nothing on instance groups, load balancers or anything of the like. There aren't even VMs on compute engine.
Any idea on what could be causing it or how I can begin to search for this?

How do I view AWS Batch Compute Environment Errors?

We setup a batch compute environment, job queue, and job definition. The min CPUs for the compute environment is set to 16, so it should always have at least one EC2 instance running. It's a MANAGED environment. It is not starting any, yet everything is still reporting healthy. I've looked at the troubleshooting page and nothing useful has come of it yet.
Where can I go to see what is going wrong? Is this completely a black box and if I make a mistake somewhere in my config (Probable some kind of ARN permissions problem), I have to scan every line till I happen to see the mistake?
The answer is, look at EC2 Auto Scaling Groups. There should be an autoscaling group named after the compute environment. All of the errors for starting EC2 instances should be in that auto scaling group, which is created and managed by the batch compute environment.

AWS Webapp tutorial: how to choose source in database security group?

I am following the AWS tutorial to create a Webapp here: http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/getting-started-create-rds.html
I am stuck at the part 'Create a Security Group for Your DB Instance'.
The tutorial instructs you to start writing 'WebserverSG' into the IP source, and to select an option. However, even after completely typing 'WebserverSG', no such option is presented and I am unable to create the security group.
Is there a way to know the source without selecting it from the options? Alternatively, have I done something wrong for the option to not be presented?
This is my first time dealing with AWS; I don't have a concrete understanding of the purpose of security groups - so please bear this in mind!
Thanks in advance for any answers.
Are you going through the VPC area of the console or trying to edit it from within RDS? If I remember correctly you can only enter another Security Group as a source from within the VPC area.
This was fixed by: remaking the web server security group with the exact name WebServerSG, then making the database security group by starting typing the inbound IP with 'sg-...' instead of 'WebSe...'. Assigning the new security group to a similar instance has everything working.

Update layer security groups

I have an OpWorks stack setup with layers and instances.
On one of the layers I decided I needed a new security attached to it. I attached the group but it is not being applied to the EC2 instance.
Is there a command anywhere to perform the applying of the security group changes?
You've probably figured this out by now, but if anyone else stumbles over the same problem - you need to rebuild the EC2 instances in order for them to pick up the new security group assignment.
Changes within already assigned security groups are applied immediately, but security groups themselves get assigned to instances upon launch only.

RDS Security groups - default only working

I'm new to AWS and RDS. I've combed through help files and other stackflow questions, but can't seem to find out if i'm doing something wrong.
When I go to my RDS Instance, I see
Security Groups:default( active )
I click default, and it takes me to the SG page, where I create new groups.
However, any rules I put in those new groups don't work, only the rules I put in the default group works. In some of the documentation, I see the screenshots and the beside the Security Groups on the instance page, it doesn't list default, but a user created group.
So is there some way to make all the new groups active or a way to change which group has precedence on that Instance page? Or am I going to have to put all my rules in the default group?
I had the same problem trying to modify security group right from the top-level view of instances. [The Postgres RDS setup has it backwards, having me create the instance and then telling me I have to do the security group thing, saying only "see startup guide" and providing a broken link to that. :)]
Anyway, I finally figured out I had to select the running instance and then under instance actions select "Modify" and then there is a nice friendly widget for changing the security group.
Update:
You can now change a RDS security group, see user115813's answer a few pixels under my original answer.
Please feel free to validate his answer instead of mine.