Tuesday, August 11, 2026

Terraform

https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code

 

Click  Amazon Web Services à Create Infrastructure àShow Terminal àLunch and Start

 

==Installation=====

Click Install Terraform à Linux à CentOS/RHEL

 

root@staging ~]# sudo yum install -y yum-utils

[root@staging ~]# sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

[root@staging ~]# sudo yum -y install terraform

 

[root@staging ~]# terraform –version 

 

[root@staging ~]# mkdir first

[root@staging ~]# cd first

[root@staging first]# vi main.tf

 

 

 

 

 

 

Note:

 

Change region west to east 

access_key                  = "test"
secret_key                  = "test"
 

[root@staging first]# terraform init

 

 [root@staging ~]# terraform plan

 

 

 

 

http://192.168.184.132:4500/cloud-explorer/aws/storage

 

 

 

 

 

 

For reference

 

 

Terraform Providers

https://registry.terraform.io/browse/providers

 

https://registry.terraform.io/providers/hashicorp/aws/latest/docs

 

 

 

resource "aws_instance" "example" {

  ami           = "resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64"

  instance_type = "t3.micro"

 

  tags = {

    Name = "HelloWorld"

  }

}

 

Floci AMI id

https://floci.io/floci/services/ec2/

[root@staging ~]# vi mail.tf

resource "aws_instance" "example" {

  ami           = "ami-0abcdef1234567890"

  instance_type = "t3.micro"

 

  tags = {

    Name = "HelloWorld"

  }

}