How to Develop an AWS EC2 Circumstances in Terraform

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

 service provider "aws" {

resource "aws_instance" "example" {
ami="ami-0c94855ba95c71c99" # Amazon Linux 2 AMI.

tags = {

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 specification to define the Amazon Linux 2 AMI ID, and the instance_type specification to define a t2.micro circumstances type. We’re likewise defining an essential set to utilize for SSH gain access to with the key_name specification.

Lastly, we’re including a tags obstruct to define a Name tag for the circumstances. You can tailor 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: :???: :?: :!: