splunk / splunk-aws-cloudformation

AWS CloudFormation templates for Splunk distributed cluster deployment
Apache License 2.0
109 stars 66 forks source link

Bastion host creation fails when trying to use existing key pair #3

Closed rgonchikar1 closed 10 years ago

rgonchikar1 commented 10 years ago

Hi,

While working with the vpc master template, I found that the bastion host creation fails when trying to use an existing key pair. I encountered this issue when following these steps: 1) Create the splunk stack 2) Delete splunk stack 3) Create a new splunk stack in the same region.

Thanks Rashmi

rarsan commented 10 years ago

Hi Rashmi, are you using the same key name BastionKeyName for the stacks? If you, then you need to delete the previously created one. Bastion host creation is failing because it's trying to create a new key pair with the same name. Go to AWS EC2 -> Key Pairs to see your current list of keys. Hope this helps.

rgonchikar1 commented 10 years ago

Yes, I'm using the same key name. I found this to be a limitation for this scenario: 1) Create multiple clusters using the same key pair. I don't want a new key pair for every cluster I create. I've fixed this at my end now. But thought I'd let you know that the boot strap script isn't checking if the key pair already exists.

rarsan commented 10 years ago

Thanks for bringing this up. I'd like to further understand your requirements. Are you using the same bastion host for multiple clusters?

rgonchikar1 commented 10 years ago

Yes, that's right. We're using the same bastion host for multiple clusters.

rarsan commented 10 years ago

That should work fine as is. Each vpc_master stack creates the vpc + bastion host. Each bastion host creates a bastion key to be used later for access to all splunk clusters. If you're using a single bastion host, there should only be one such bastion key. I assume you either created multiple bastion hosts, or multiple vpc_master?

rgonchikar1 commented 10 years ago

I used vpc_master once, but used splunk_cluster multiple times. The key pair issue comes up when: 1) I want to tear down the cluster created using splunk_cluster and want to re-create. 2) I want to create an additional cluster in the same region. I've resolved this issue at my end though. We could close the thread.