note: if we need information about resources like elastic IP, volume etc .
provider "aws" {
region = "us-east-1"
access_key = "AGQ"
secret_key = "Kkt1aurid"
}
resource "aws_instance" "web" {
ami = "ami-02e136e904f3da870"
instance_type = "t3.micro"
tags = {
Name = "moon"
}
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
instance_tenancy = "default"
tags = {
Name = "main"
}
}
=====================================================
VIM OUTPUT.TF
output "instance-wrnhole" {
value = aws_instance.web.arn
}
output "instance-id" {
value = aws_instance.web.id
}
output "instance-ami" {
value = aws_instance.web.ami
}
output "vpc-cidr" {
value = aws_vpc.main.cidr_block
}
output "vpc-tedency" {
value = aws_vpc.main.instance_tenancy
}
output "vpc-id" {
value = aws_vpc.main.id
sensitive = true
}
Comments
Post a Comment