Question: Your company has started using AWS and needs an EC 2 instance containing generated SSH keys. Your task is to prepare its configuration terraform Requiremens

Your company has started using AWS and needs an EC2 instance containing generated SSH keys. Your task is to prepare its configuration terraform
Requiremens
1. Add the following providers to your solution using terraform 0.14.5
a. syntax:
b. local(version 2.0.0)
i. tls(version 3.0.0)
2. Reference the above providers in your solution via the provider keyword and add their configuration if required
3. Don't add any more providers
4. Use the correct resource from the tls provider to generate private and public SSH keys(RSA -4096 bit) using one of the aforementioned providers. the name of this resource should be ssh_key
5. Use the correct resource from local provider to generate cloud_config.yaml by rendering cloud-config.yaml.tpl and filling placeholders with following keys:
a. Public_key with the result of creating the public key
b. private_key with the result of creating the private key the name of this resource should be cloud_config. Remember to use correct indentation
Assumptions
For this task assume that:
You don't need to write any code to setup any resources in AWS
cloud-config.yaml.tpl follows precisely the following format(Don't copy it, assume it is located in the same directory as cloud-config.yaml.tpl, Simply read it):
#cloud-config.yaml.tpl
write_files:
- path: /etc/app/key
permissions: '0600'
content: |
${private_key}
- path: /etc/app/key.pub
permissions: '0644'
content: |
${public_key}
Indention in the YAML file are four single spaces
the version of terraformin use 0.14.5
Hints
Do not use deprecated terraform syntax; e.g. use var.whatever instead of ${var.whatever}
Use template functions in place of deprecated template provider

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!