Domanda

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.
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top