-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
44 lines (34 loc) · 974 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
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.14.0"
}
}
}
provider "aws" {
region = var.region
}
# Provide a static IP address to the Lightsail instance
resource "aws_lightsail_static_ip_attachment" "static_ip_attachment" {
instance_name = aws_lightsail_instance.instance.name
static_ip_name = var.static_ip_attachment
}
resource "aws_lightsail_static_ip" "static_ip" {
name = var.static_ip
}
# Create a new Lightsail SSH Key Pair
resource "aws_lightsail_key_pair" "intance_key_pair" {
name = var.intance_key_pair
}
# Create a new Wordpress Lightsail Instance
resource "aws_lightsail_instance" "instance" {
name = var.instance
availability_zone = var.instance_availability_zone
blueprint_id = var.instance_blueprintid
bundle_id = var.instance_bundleid
key_pair_name = var.intance_key_pair
tags = {
Environment = "Development"
}
}