-
Notifications
You must be signed in to change notification settings - Fork 20
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 EC2 resource using terraform #24
Conversation
Signed-off-by: Guy Inger <[email protected]>
I was able to successfully create and destroy an EC2 instance with this terraform file in this PR. Diving into the scrip though, it does more things rather than just create an EC2 instance. |
I don't think the cluster installation should be handled by Terraform. I think it is part of the provisioning phase. Ansible is better suited for such a task. |
There are several question around this:
|
Also about what @guy9050 asked on where does those scripts should be done, in the past when I worked with IaC I added those type of setup steps as resources handled by the framework....this ensures you track the state of it as any other resource...with terraform this typically will be done with remote-exec at least under that point of view. I am working on the pulumi PoC and this is how I am doing it there |
@tsebastiani QE has been using a similar tool for their own testing purposes, and this is what Adrian has been working on for some time. It does the same as One of the preparations on our end for the 'key swapping' and other tasks it to make the images more self-container/self-sufficient: crc-org/snc#638. Ideally we make modifications that work for both CRC and CRC-Cloud. I am not sure if Ansible is a necessity, but could be considered for more advanced tasks is needed after the main provisioning, though should not be a hard requirement as this might impact CRC. |
AWS keypair creation is done only because it's mandatory, but it's absolutely useless. In order to make it work effectively (as you said) the image should include some tweaks that are not actually implemented in the crc image (like cloud-init). To overcome this issue, and make the newly deployed image safe, a keypair is generated by the script and is swapped with the default one Line 117 in d846f4c
|
Several points were mentioned in the discussion. I want to focus on one of them. This PR is about bootstrapping only. It deals with only the AWS resources. Key Pair is one of those resources. AFAIK, there are two spikes worked in parallel. One is done one and the second one is with Pulumi. Eventually, we would pick one of them and drop the other. This was my understanding. |
Thanks for the discussion. This PR focuses on merely the EC2 resources needed for the cluster. The CRC cluster installation will have its own PR. |
} | ||
|
||
|
||
# Specify the cloud provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Specify the cloud provider |
} | ||
} | ||
|
||
# Create a resource of type "aws_security_group" to enable SSH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Create a resource of type "aws_security_group" to enable SSH |
Not relevant anymore. |
This PR will contain a terraform plan for creating an EC2 instace for hosting CRC.
Signed-off-by: Guy Inger [email protected]