- Download the starter code.
- In the main.tf file write the code to provision
- AWS as the cloud provider
- Use an existing VPC ID
- Use an existing public subnet
- 4 AWS t2.micro EC2 instances named Udacity T2
- 2 m4.large EC2 instances named Udacity M4
- Run Terraform.
- Take a screenshot of the 6 EC2 instances in the AWS console and save it as
Terraform_1_1
. - Use Terraform to delete the 2 m4.large instances
- Take an updated screenshot of the AWS console showing only the 4 t2.micro instances and save it as
Terraform_1_2
-
In the Exercise_2 folder, write the code to deploy an AWS Lambda Function using Terraform. Your code should include:
- A lambda.py file
- A main.tf file with AWS as the provider, and IAM role for Lambda, a VPC, and a public subnet
- An outputs.tf file
- A variables.tf file with an AWS region
-
Take a screenshot of the EC2 instances page
-
Take a screenshot of the VPC page
terraform init terraform plan aws lambda list-functions { "Functions": [] }
Outcome:
- Task 1: Task1
- Task 2: Task2
- Task 3: Task3
- Task 4: Task4
- Task 5: Task5
- Task 6: Task6
Notes:
- 3 Tier Arch: https://lucid.app/lucidchart/invitations/accept/fc0a2985-8533-495d-9332-c98c9d7d937d Serverless Arch: https://lucid.app/lucidchart/invitations/accept/467cbd45-084c-4341-92b7-d1b74e253240
- In "Task 2", Each estimate CSV has respective .txt having explanation
- Exercise 2: UdacityM4 deleted by commenting out that code.
- Task 3:
- Faced issue with CloudTrail user. Able to perform same action from Admin account.
- Fixed issue and updated solution at https://knowledge.udacity.com/questions/399056?utm_campaign=ret_600_auto_ndxxx_knowledge-comment-created_na&utm_source=blueshift&utm_medium=email&utm_content=ret_600_auto_ndxxx_knowledge-comment-created_na&bsft_clkid=1238a21a-56f0-4f98-bd45-9f1726c8077e&bsft_uid=73b14e77-af08-4513-87ed-e3ec70e8437a&bsft_mid=0a0fb974-1f71-4289-92f0-aac2d2c991df&bsft_eid=64e4ccff-21b0-44a8-abc6-a9081789abfc&bsft_txnid=e8ec19c9-e9fe-45c2-ad2f-8445cec25cec&bsft_mime_type=html&bsft_ek=2020-12-05T07%3A08%3A32Z&bsft_aaid=8d7e276e-4a10-41b2-8868-423fe96dd6b2&bsft_lx=1&bsft_tv=1#399085
- Task 6: To avoid charges already deleted instances, hence attached deletion of lambda stack.
Review comments:
-
Modify your estimates to include cost for elastic IP. Nitin: An Elastic IP address doesn’t incur charges as long as all the following conditions are true:
-
The Elastic IP address is associated with an EC2 instance.
-
The instance associated with the Elastic IP address is running.
-
The instance has only one Elastic IP address attached to it.
-
The Elastic IP address is associated with an attached network interface, such as a Network Load Balancer or NAT gateway. Ref: https://aws.amazon.com/premiumsupport/knowledge-center/elastic-ip-charges/
-
Your logs only show that you were logged in as "CloudTrail" User. I can not confirm from your logs if you were also able to login using "Accountant" user or not. Nitin: Added Task3/UdacityCloudTrailLogAccountant.csv