-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy path850489-Kushagra.tf.txt
63 lines (49 loc) · 966 Bytes
/
850489-Kushagra.tf.txt
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
provider "aws" {
access_key=""
security_key=""
region= "us-east-1"
}
resource "aws_instance_EC2 "resource_1 " {
ami="${lookup(var.resource_1,var.aws_region)}"
instance_type="t2.micro"
}
resource "aws_route" "ELB" {
route_table_id="($aws_vps)
destination_cidr_block="0.0.0.0/0"
}
resource "aws_vps" "main"{
cidr_block="172.255.255.255"
}
resource "aws_gate_default"{
destination_cidr_block="0.0.0.0/0"
}
resource "aws_instance" "web_server" {
connection {
user="username"
host="hostname"
}
}
variable "aws_access_key" {}
variable "aws_security_key" {}
variable "aws_region_1" {
default="us-east-1"
}
data "template file" "server1" {
template="$$(aws.default.id)"
vars {
name="2tier"
destination_cidr_block="0.0.0.0/0"
}
}
provisioner "server"
{
inline={
"sudo -y update"
sudo -y start module"
}
}
connection {
type="ssh"
user="ec_user"
private_key="$file(pathname of the file)"
}