🔥Terraform | init, tags, name, EC2, Security groups, Dynamic Blocks episode artwork

EPISODE · Jun 19, 2022 · 8 MIN

🔥Terraform | init, tags, name, EC2, Security groups, Dynamic Blocks

from Programmers · host Software Engineering

📚 Book - https://amzn.to/39ty0Tq - "Terraform: Up & Running: Writing Infrastructure as Code" Terraform init will download all the dependencies needed by the terraform project like when you have a clean maven project, and running almost any mvn command will pull down the dependencies. tags in terraform helps you set the additional tag properties of the resources, if you want to set the name of the resource that would appear in aws then you need to set the tag with specific key and this key is Name actual names of resources, so if you would like to create a vpc resource in aws with name "myvpc" you need to actually set its tags which is different from aws tags you would set the tags { Name = "MyVpc" } and this would set the name of the resource in aws and not the tags in aws. Create EC2The terraform name aws_instance The 2 mandatory arguments are ami and instance_type Example resource "aws_instance "MyEc2Instance" { ami = "ami_287428346" // some aws ami instance_type = "t2.micro" } Note to reference an id of a terraform instance need to specify <aws key>.<name>.id so aws_vpc.myvpc.id When we set an "aws_eip" which is elastic ip we have to tell it for which ec2 instance we assign it to, so the resource contains the "instance" property that we have to set. Aws account can give us up to 5 elastic ips. Security group - statefull firewall - stateful means if we allowed some traffic going in it would automatically allow traffic to go out, in stateless we have to set explicitly the input to the firewall and the output. resource "aws_security_group" "MySecurityGroup" { name = "Allow HTTPS" ingress { from_port = 443 to_port = 443 # This is a range of ports from to to is not output. protocol = "TCP" cird_blocks = ["0.0.0.0/0"] # All traffic. } egress { } } Then we can reference this MySecurityGroup from various resources such as ec2 instances. Dynamic Blocks - iterator, for_each var.mylistvar , content = port.value This allows us to use for_each.prefix the block you want to use the list for each in dynamic example variable "ingressrules" { # Here you set the list variable holding the data to be dynamically included. type = list(number) default = [80, 443] } dynamic "ingress" { # Now iterate and use the above list defined above. iterator = port for_each = var.ingressrules content { from_port = port.value } } Terraform dynamic blocks and security groups definition in Terraform and AWS elastic IP definition in Terraform and EC2 We continue also to investigate what does terraform init means.

📚 Book - https://amzn.to/39ty0Tq - "Terraform: Up & Running: Writing Infrastructure as Code" Terraform init will download all the dependencies needed by the terraform project like when you have a clean maven project, and running almost any mvn command will pull down the dependencies. tags in terraform helps you set the additional tag properties of the resources, if you want to set the name of the resource that would appear in aws then you need to set the tag with specific key and this key is Name actual names of resources, so if you would like to create a vpc resource in aws with name "myvpc" you need to actually set its tags which is different from aws tags you would set the tags { Name = "MyVpc" } and this would set the name of the resource in aws and not the tags in aws. Create EC2The terraform name aws_instance The 2 mandatory arguments are ami and instance_type Example resource "aws_instance "MyEc2Instance" { ami = "ami_287428346" // some aws ami instance_type = "t2.micro" } Note to reference an id of a terraform instance need to specify <aws key>.<name>.id so aws_vpc.myvpc.id When we set an "aws_eip" which is elastic ip we have to tell it for which ec2 instance we assign it to, so the resource contains the "instance" property that we have to set. Aws account can give us up to 5 elastic ips. Security group - statefull firewall - stateful means if we allowed some traffic going in it would automatically allow traffic to go out, in stateless we have to set explicitly the input to the firewall and the output. resource "aws_security_group" "MySecurityGroup" { name = "Allow HTTPS" ingress { from_port = 443 to_port = 443 # This is a range of ports from to to is not output. protocol = "TCP" cird_blocks = ["0.0.0.0/0"] # All traffic. } egress { } } Then we can reference this MySecurityGroup from various resources such as ec2 instances. Dynamic Blocks - iterator, for_each var.mylistvar , content = port.value This allows us to use for_each.prefix the block you want to use the list for each in dynamic example variable "ingressrules" { # Here you set the list variable holding the data to be dynamically included. type = list(number) default = [80, 443] } dynamic "ingress" { # Now iterate and use the above list defined above. iterator = port for_each = var.ingressrules content { from_port = port.value } } Terraform dynamic blocks and security groups definition in Terraform and AWS elastic IP definition in Terraform and EC2 We continue also to investigate what does terraform init means.

NOW PLAYING

🔥Terraform | init, tags, name, EC2, Security groups, Dynamic Blocks

0:00 8:10

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

Khanyisa Keke TV Khanyisa Keke On Khanyisa Keke TV, developers can learn and improve their Android for Kotlin Development skills. On this podcast, programmers can learn Android for Kotlin coding from scratch, improve their existing programming skills, get tips, be kept up to date with all the latest happenings and get access to free resources. Powered by Firstory Hosting Android Developers Backstage Android Developers Android Backstage, a podcast by and for Android developers. Hosted by developers from the Android engineering team, this show covers topics of interest to Android programmers, with in-depth discussions and interviews with engineers on the Android team at Google.Subscribe to Android Developers YouTube → https://goo.gle/AndroidDevs Command Line Heroes Red Hat Hear the epic true tales of how developers, programmers, hackers, geeks, and open source rebels are revolutionizing the technology landscape. Command Line Heroes is an award-winning podcast hosted by Saron Yitbarek and produced by Red Hat. Get root access to show notes, transcripts, and other associated content at https://redhat.com/commandlineheroes Startup Data Science Edderic Ugaddan, Apurva Naik, Alex Au Startup Data Science is the podcast where you learn startup-ready data science with programming basics. We discuss how to bootstrap data science techniques and understand their underlying mechanics by discussing open-source learning materials. Startup Data Science helps forward-thinking entrepreneurs, novice programmers, and seasoned software engineers to use Data Science to make a bigger impact.

Frequently Asked Questions

How long is this episode of Programmers?

This episode is 8 minutes long.

When was this Programmers episode published?

This episode was published on June 19, 2022.

What is this episode about?

📚 Book - https://amzn.to/39ty0Tq - "Terraform: Up & Running: Writing Infrastructure as Code" Terraform init will download all the dependencies needed by the terraform project like when you have a clean maven project, and running almost any mvn...

Can I download this Programmers episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!