How to Produce an AWS EC2 Circumstances in Terraform

The following Terraform code bit develops an EC2 circumstances for you.

 supplier "aws" {
area="us-west-2".
}

resource "aws_instance" "example" {
ami="ami-0c94855ba95c71c99" # Amazon Linux 2 AMI.
instance_type="t2.micro".
key_name="example-keypair".

tags = {
Call="example-instance".
}
}

In this example, we’re utilizing the aws_instance resource type to produce an EC2 circumstances in the us-west-2 area. We’re utilizing the ami criterion to define the Amazon Linux 2 AMI ID, and the instance_type criterion to define a t2.micro circumstances type. We’re likewise defining a crucial set to utilize for SSH gain access to with the key_name criterion.

Lastly, we’re including a tags obstruct to define a Name tag for the circumstances. You can personalize this block with any extra tags that you wish to include.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: