forked from lakshmiprasad2019/myweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
48 lines (37 loc) · 761 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
# Configure the AWS Provider
provider "aws" {
region = "ap-south-1"
}
resource "aws_instance" "myec2" {
instance_type = "t2.medium"
ami = data.aws_ami.app_ami.id
tags = {
Name = "import"
}
}
resource "aws_instance" "myec2-poll" {
instance_type = "t2.medium"
ami = data.aws_ami.app_ami.id
tags = {
Name = "Poll"
}
}
#resource "aws_eip" "lb" {
# instance = aws_instance.myec2.id
# vpc = true
#}
data "aws_ami" "app_ami" {
owners = ["amazon"]
most_recent = true
filter {
name = "name"
values = ["amzn2-ami-kernel-5.10**"]
}
}