Skip to content

Commit c13e348

Browse files
committed
Update aws provider version, auto grab latest ami for ubuntu and update readme
1 parent 7cb419d commit c13e348

File tree

4 files changed

+38
-15
lines changed

4 files changed

+38
-15
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ This repository contains example Terraform modules for installing and configurin
33
Disclaimer: Please use these modules only if you're comfortable configuring Terraform.
44

55
# Prerequisites
6-
- All modules utilize **Hashicorp Terraform 3.50.0**
6+
7+
- All modules have been test on **Hashicorp Terraform v1.3.7**
8+
- The AWS Provider version is set to **v4.0**
79

810
# Usage
11+
912
Navigate to your desired cloud provider + deployment module for specific configuration options.

modules/aws_ec2_standalone/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# AWS EC2 Standalone Deployment
22

33
## Requirements
4+
45
- RDS instance with port, host, username, and password
5-
- VPC with desired subnets
6+
- VPC with desired subnets
67

78
## Usage
89

@@ -56,11 +57,14 @@ docker-ps
5657
```
5758

5859
8. Modify your environment variables. If you have an external RDS database (strongly recommended), replace the `POSTGRES_` environment variables with the new ones.
59-
- If testing out your instance for the first time without SSL/HTTPS, you should uncomment `# COOKIE_INSECURE = true`
60-
- Replace your `LICENSE_KEY` with your provided Retool license key
60+
61+
- If testing out your instance for the first time without SSL/HTTPS, you should uncomment `# COOKIE_INSECURE = true`
62+
- Replace your `LICENSE_KEY` with your provided Retool license key
6163

6264
9. Add any additional configuration needed. You can refer to our documentation for [all additional environment variables](https://docs.retool.com/docs/environment-variables).
6365

66+
10. Access your Retool instance on the ec2_public_dns that is given via the resource creation outputs. If no SSL certificate has been configured you need to access the instance on port 300 (append :300 to the end of the URL) and via http.
67+
6468
### Security Group
6569

6670
You can configure the security group ingress and egress rules using input variables:
@@ -112,5 +116,4 @@ egress_rules = [
112116
]
113117
```
114118

115-
By default, this module creates a publicly-accessible security group that enables inbound traffic on ports (`30`, `443`, `22`, and `8000`) and all outbound traffic.
116-
119+
By default, this module creates a publicly-accessible security group that enables inbound traffic on ports (`30`, `443`, `22`, and `3000`) and all outbound traffic.

modules/aws_ec2_standalone/main.tf

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "3.50.0"
5+
version = "~> 4.0"
66
}
77
}
88
}
@@ -11,6 +11,23 @@ provider "aws" {
1111
region = var.aws_region
1212
}
1313

14+
data "aws_ami" "this" {
15+
most_recent = true # get the latest version
16+
filter {
17+
name = "name"
18+
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
19+
}
20+
21+
filter {
22+
name = "virtualization-type"
23+
values = ["hvm"]
24+
}
25+
26+
owners = [
27+
"amazon" # only official images
28+
]
29+
}
30+
1431
resource "aws_security_group" "this" {
1532
name = "${var.instance_name}-sg"
1633
description = "Retool EC2 security group"
@@ -45,7 +62,7 @@ resource "aws_security_group" "this" {
4562
}
4663

4764
resource "aws_instance" "this" {
48-
ami = var.instance_ami
65+
ami = data.aws_ami.this.id
4966
instance_type = var.instance_type
5067
key_name = var.ssh_key_name
5168

modules/aws_ec2_standalone/variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ variable "instance_name" {
1818

1919
variable "version_number" {
2020
type = string
21-
default = "2.96.2"
22-
description = "Retool version number. Defaults to `2.96.2`."
21+
default = "2.106.2"
22+
description = "Retool version number. Defaults to `2.106.2`."
2323
}
2424

2525
variable "vpc_id" {
@@ -34,11 +34,11 @@ variable "subnet_id" {
3434
description = "VPC Subnet ID to launch in."
3535
}
3636

37-
variable "instance_ami" {
38-
type = string
39-
default = "ami-00399ec92321828f5" # Ubuntu Server 20.04 LTS 64-bit x86
40-
description = "AMI for EC2 instance. Defaults to `ami-00399ec92321828f5` (Ubuntu Server 20.04 LTS 64-bit x86)."
41-
}
37+
# variable "instance_ami" {
38+
# type = string
39+
# default = "ami-06bb3ee01d992f30d" # Ubuntu Server 22.04 LTS 64-bit x86
40+
# description = "AMI for EC2 instance. Defaults to `ami-06bb3ee01d992f30d` (Ubuntu Server 22.04 LTS 64-bit x86)."
41+
# }
4242

4343
variable "ssh_key_name" {
4444
type = string

0 commit comments

Comments
 (0)