From 2acee87c9328d389e3a2f6adaa15436fe2c6f26b Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:20:43 +0530 Subject: [PATCH 1/8] Add files via upload initial commit --- NOTICE | 2 +- README.md | 48 +++++++++++++++++------------------------------- main.tf | 24 ++++++++++++++++++++++++ outputs.tf | 7 +++++++ providers.tf | 11 +++++++++++ variables.tf | 4 ++++ 6 files changed, 64 insertions(+), 32 deletions(-) create mode 100644 main.tf create mode 100644 outputs.tf create mode 100644 providers.tf create mode 100644 variables.tf diff --git a/NOTICE b/NOTICE index 4bf8ec7..6e2b44a 100644 --- a/NOTICE +++ b/NOTICE @@ -1,4 +1,4 @@ -Copyright 2021 LinkedIn Corporation +Copyright 2023 LinkedIn Corporation All Rights Reserved. Licensed under the LinkedIn Learning Exercise File License (the "License"). diff --git a/README.md b/README.md index 53259c4..a13d527 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,28 @@ -# Working with LinkedIn Learning Exercise Files on GitHub -This is the repository for the LinkedIn Learning course Working with LinkedIn Learning Exercise Files on GitHub. The full course is available from [LinkedIn Learning][lil-course-url]. +# Learning Terraform +This is the repository for the LinkedIn Learning course Learning Terraform. The full course is available from [LinkedIn Learning][lil-course-url]. -![course-name-alt-text][lil-thumbnail-url] +![Learning Terraform][lil-thumbnail-url] -A LinkedIn Learning membership gives you access to an incredibly rich resource: exercise files that allow you to follow along with the very same project as the instructor. For many of our technology courses, that project lives in GitHub. This course shows how to access GitHub exercise files—from the command line as well as from several popular IDEs, including Visual Studio and Visual Studio Code, IntelliJ IDEA, and GitHub Desktop. Learn how to locate the repository, clone it to your computer, and work with branches. Plus, learn how to save, commit, and roll back branch changes with Git commands. By the end of the course, you’ll have everything you need to start working with these valuable assets. +Terraform is a DevOps tool for declarative infrastructure—infrastructure as code. It simplifies and accelerates the configuration of cloud-based environments. In this course, instructor Josh Samuelson shows how to use Terraform to configure infrastructure and manage resources with Amazon Web Services (AWS). After demonstrating how to set up AWS for Terraform, Josh covers how Terraform manages your infrastructure, as well as how to use core Terraform commands. He also delves into more advanced topics, including how to leverage code modules from the Terraform registry and how to create your own modules. Upon wrapping up this course, you'll have the knowledge you need to efficiently define and manage infrastructure with this powerful tool. +_See the readme file in the main branch for updated instructions and information._ ## Instructions -This repository contains no exercise files, but simply points to the other repos used in the course: +This repository has branches for each of the videos in the course. You can use the branch pop up menu in github to switch to a specific branch and take a look at the course at that stage, or you can add `/tree/BRANCH_NAME` to the URL to go to the branch you want to access. -[vs-adv-debug-2823390](https://github.com/LinkedInLearning/vs-adv-debug-2823390). +## Branches +The branches are structured to correspond to the videos in the course. The naming convention is `CHAPTER#_MOVIE#`. As an example, the branch named `02_03` corresponds to the second chapter and the third video in that chapter. The code is built sequentally so each branch contains the completed code for that particular video and the starting code can be found in the previous video's branch. -[react-interface-2880067](https://github.com/LinkedInLearning/react-interface-2880067). +The `main` branch contains the starting code for the course and the `final` branch contains the completed code. -[learning-go-2875237](https://github.com/LinkedInLearning/learning-go-2875237). +### Instructor -**David Gassner** +Josh Samuelson + +DevOps Engineer -_Senior Staff Instructor at LinkedIn Learning_ + -Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/david-gassner?u=104). - -**Walt Ritscher** - -_Staff Instructor at LinkedIn Learning_ - -Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/walt-ritscher?u=104). - - -**Ray Villalobos** - -_Senior Staff Instructor at LinkedIn Learning_ - -Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/ray-villalobos?u=104). - - - -[0]: # (Replace these placeholder URLs with actual course URLs) - -[lil-course-url]: https://www.linkedin.com/learning/working-with-linkedin-learning-exercise-files-on-github?u=104 -[lil-thumbnail-url]: https://cdn.lynda.com/course/2882245/2882245-1621274914030-16x9.jpg +Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/josh-samuelson). +[lil-course-url]: https://www.linkedin.com/learning/learning-terraform-15575129?dApp=59033956 +[lil-thumbnail-url]: https://cdn.lynda.com/course/3087701/3087701-1666200696363-16x9.jpg diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..9b32ce0 --- /dev/null +++ b/main.tf @@ -0,0 +1,24 @@ +data "aws_ami" "app_ami" { + most_recent = true + + filter { + name = "name" + values = ["bitnami-tomcat-*-x86_64-hvm-ebs-nami"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } + + owners = ["979382823631"] # Bitnami +} + +resource "aws_instance" "web" { + ami = data.aws_ami.app_ami.id + instance_type = "t3.nano" + + tags = { + Name = "HelloWorld" + } +} diff --git a/outputs.tf b/outputs.tf new file mode 100644 index 0000000..b35171b --- /dev/null +++ b/outputs.tf @@ -0,0 +1,7 @@ +#output "instance_ami" { +# value = aws_instance.web.ami +#} + +#output "instance_arn" { +# value = aws_instance.web.arn +#} diff --git a/providers.tf b/providers.tf new file mode 100644 index 0000000..c41e365 --- /dev/null +++ b/providers.tf @@ -0,0 +1,11 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} + +provider "aws" { + region = "us-west-2" +} diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..c750667 --- /dev/null +++ b/variables.tf @@ -0,0 +1,4 @@ +#variable "instance_type" { +# description = "Type of EC2 instance to provision" +# default = "t3.nano" +#} From e7986f220c63c8ab4b4600e3801679aa7629fad1 Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:50:10 +0530 Subject: [PATCH 2/8] Update main.tf modified instance name to t2.micro --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 9b32ce0..df7eec0 100644 --- a/main.tf +++ b/main.tf @@ -16,7 +16,7 @@ data "aws_ami" "app_ami" { resource "aws_instance" "web" { ami = data.aws_ami.app_ami.id - instance_type = "t3.nano" + instance_type = "t2.micro" tags = { Name = "HelloWorld" From 081efd3eb9f13cc8703e34ab1d1ee8aef1cbcd11 Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 15:50:38 +0530 Subject: [PATCH 3/8] Update variables.tf --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index c750667..32e258d 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,4 @@ #variable "instance_type" { # description = "Type of EC2 instance to provision" -# default = "t3.nano" +# default = "t2.micro" #} From a57d7902ffe80bfa9f331ecaf44baf57b2e9be94 Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 15:51:48 +0530 Subject: [PATCH 4/8] Update providers.tf --- providers.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers.tf b/providers.tf index c41e365..e439ad6 100644 --- a/providers.tf +++ b/providers.tf @@ -7,5 +7,5 @@ terraform { } provider "aws" { - region = "us-west-2" + region = "ap-south-1" } From de4c73970cc9da04d1c8366cb1d8bc1c812d03de Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 15:59:05 +0530 Subject: [PATCH 5/8] second commit --- main.tf | 2 +- outputs.tf | 12 ++++++------ variables.tf | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main.tf b/main.tf index df7eec0..0bfc354 100644 --- a/main.tf +++ b/main.tf @@ -16,7 +16,7 @@ data "aws_ami" "app_ami" { resource "aws_instance" "web" { ami = data.aws_ami.app_ami.id - instance_type = "t2.micro" + instance_type = var.instance_type tags = { Name = "HelloWorld" diff --git a/outputs.tf b/outputs.tf index b35171b..c429b19 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,7 +1,7 @@ -#output "instance_ami" { -# value = aws_instance.web.ami -#} +output "instance_ami" { + value = aws_instance.web.ami +} -#output "instance_arn" { -# value = aws_instance.web.arn -#} +output "instance_arn" { + value = aws_instance.web.arn +} diff --git a/variables.tf b/variables.tf index 32e258d..676e5cf 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,4 @@ -#variable "instance_type" { -# description = "Type of EC2 instance to provision" -# default = "t2.micro" -#} +variable "instance_type" { + description = "Type of EC2 instance to provision" + default = "t2.micro" +} From 0b38057eb6a25f19510ae24b5a4b4ba9113b72e3 Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:07:46 +0530 Subject: [PATCH 6/8] test commit --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 0bfc354..833c547 100644 --- a/main.tf +++ b/main.tf @@ -17,7 +17,7 @@ data "aws_ami" "app_ami" { resource "aws_instance" "web" { ami = data.aws_ami.app_ami.id instance_type = var.instance_type - + #ok tags = { Name = "HelloWorld" } From 909f64d119da1ff0bcf3945ca4c30976a03ef4cb Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:16:57 +0530 Subject: [PATCH 7/8] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 833c547..ed6dfa0 100644 --- a/main.tf +++ b/main.tf @@ -14,7 +14,7 @@ data "aws_ami" "app_ami" { owners = ["979382823631"] # Bitnami } -resource "aws_instance" "web" { +resource "aws_instance" "blog" { ami = data.aws_ami.app_ami.id instance_type = var.instance_type #ok From 34b7316cef43e8ac6e2004e08f9025ed388a0b11 Mon Sep 17 00:00:00 2001 From: Bhaskar <38725403+bskr2020@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:20:13 +0530 Subject: [PATCH 8/8] Update outputs.tf --- outputs.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index c429b19..7e9410b 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,7 +1,7 @@ output "instance_ami" { - value = aws_instance.web.ami + value = aws_instance.blog.ami } output "instance_arn" { - value = aws_instance.web.arn + value = aws_instance.blog.arn }