-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
39 lines (35 loc) · 957 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
resource "aws_lightsail_instance" "main" {
availability_zone = var.availability_zone
blueprint_id = var.blueprint_id
bundle_id = var.bundle_id
name = var.name
user_data = var.user_data
tags = var.tags
}
resource "aws_key_pair" "key" {
key_name = var.key_name
public_key = var.public_key
}
resource "aws_lightsail_static_ip" "static" {
name = var.static_ip_name
}
resource "aws_lightsail_static_ip_attachment" "static_ip_attachment" {
static_ip_name = aws_lightsail_static_ip.static.id
instance_name = aws_lightsail_instance.main.id
}
resource "aws_lightsail_domain" "domain_test" {
domain_name = var.domain_name
}
resource "aws_lightsail_instance_public_ports" "public_ports" {
instance_name = aws_lightsail_instance.main.name
port_info {
protocol = "tcp"
from_port = 80
to_port = 80
}
port_info {
protocol = "tcp"
from_port = 22
to_port = 22
}
}