Git Product home page Git Product logo

terraform-retool-modules's Introduction

This repository contains example Terraform modules for installing and configuring Retool. For full documentation on all the ways you can deploy Retool on your own infrastructure, please see the Setup Guide.

Disclaimer: Please use these modules only if you're comfortable configuring Terraform.

Prerequisites

  • All modules have been test on Hashicorp Terraform v1.3.7
  • The AWS Provider version is set to v5.0

Usage

Navigate to your desired cloud provider + deployment module for specific configuration options.

terraform-retool-modules's People

Contributors

alexmaras avatar andre347 avatar anna-yn avatar ayalamansky avatar briferz avatar demitrin avatar gopalraman avatar jbankes avatar michaelcramer avatar mswezey23 avatar prashantmital avatar roberto-retool avatar yilinjuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

terraform-retool-modules's Issues

sql schema version compatibility check failed: pq: no pg_hba.conf entry for host "172.20.21.107", user "db_admin", database "temporal", no encryption

Hi,

I am deploying retool service with temporal cluster using this repository. I successfully deployed Retool service to aws ecs fargate cluster ( main backend, jobs runner, workflows worker, workflows backend) from this docker image tryretool/backend:3.16.7 with aws postgresql database version 15.4. But i am facing the following error

Unable to start server. Error: could not build arguments for function "go.uber.org/fx".(*App).constructCustomLogger.func2 (/go/pkg/mod/go.uber.org/[email protected]/app.go:415): failed to build fxevent.Logger: could not build arguments for function "go.temporal.io/server/temporal".glob..func8 (/home/builder/temporal/temporal/fx.go:921): failed to build log.Logger: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider (/home/builder/temporal/temporal/fx.go:163): sql schema version compatibility check failed: pq: no pg_hba.conf entry for host "172.20.21.107", user "db_admin", database "temporal", no encryption

when deploying Temporal cluster on aws ecs fargate services ( frontend, history, worker, matching) using this docker image tryretool/one-offs:retool-temporal-1.1.4 with aws postgresql 15.4 database.

More details can be found on this ticket

If you can help me to fix this error it would be much appreciated

I will be very happy to provide more details about the terraform code setup i am using

Thank you in advance

cc @roberto-retool

Incorrect/outdated documentation for required vars

The documentation for this module at https://docs.retool.com/self-hosted/quickstarts/ecs-fargate/terraform provides a sample code block but it doesn't appear to be valid. For instance, subnet_ids is marked as a required field, and is listed in the documentation. But using this module, private_subnet_ids and public_subnet_ids are also marked required, but are not referred to in the documentation. I can take a guess at what private_subnet_ids and public_subnet_ids should be, but their presence makes the function of subnet_ids unclear.

Can you please provide a known-working config example here? Other settings like aws_ecs_capacity_provider_name are unclear because they're marked required but are not required fields in ECS itself, so it's not clear whether this module will only work with one made.

Update AWS Providers to be ~> 5.0

๐Ÿ‘‹ Terraform's AWS Provider was updated to 5.0 on May 25th, 2023 (See changelog), but only ~> 4.0 is supported by these modules (See modules/aws_ecs/main.tf as an example).

Given the AWS provider 5.0 update has a large number of breaking changes (and essential bug fixes) we unfortunately cannot downgrade our Terraform configuration and pin to the latest ~> 4.0 version.

Could these module's AWS providers be updated to ~> 5.0 to address?

Invalid Postgres version. v10.6 is no longer a valid option within AWS RDS

โ”‚ Error: Error creating DB Instance: InvalidParameterCombination: Cannot find version 10.6 for postgres
โ”‚       status code: 400, request id: 0c9a89d8-63ea-4121-9f0f-f30cab6194b0
โ”‚ 
โ”‚   with module.retool.aws_db_instance.this,
โ”‚   on modules/retool_ecs_ec2/main.tf line 138, in resource "aws_db_instance" "this":
โ”‚  138: resource "aws_db_instance" "this" {
โ”‚ 

Side notes:

  • I noticed in the docker-compose that Postgres is set to 11.X. I would suggest standardizing the Postgres versions across deployments
  • The docs do not state which versions of Postgres are supported for Retool's onprem installation. Please update the docs to include a support matrix

Missing vpc_id argument on aws_security_group resource in aws_ecs /security.tf

The aws_security_group.temporal_aurora resource defined below is missing the vpc_id argument:

resource "aws_security_group" "temporal_aurora" {

This results in Terraform being unable to create the resource because no VPC ID has been specified:

โ”‚ Error: creating Security Group (retool-prod-temporal-rds-security-group): VPCIdNotSpecified: No default VPC for this user
โ”‚       status code: 400, request id: c448adb9-ac28-4e14-84ed-5450130d1e6a
โ”‚ 
โ”‚   with module.retool.aws_security_group.temporal_aurora[0],
โ”‚   on .terraform/modules/retool/modules/aws_ecs/security.tf line 26, in resource "aws_security_group" "temporal_aurora":
โ”‚   26: resource "aws_security_group" "temporal_aurora" {

If you look at the aws_security_group resource immediately following this one, the vpc_id argument is present:

resource "aws_security_group" "alb" {

I believe you just need to add the following to the aws_security_group.temporal_aurora resource to resolve the problem:
vpc_id = var.vpc_id

Thank you.

EC2 Standalone Module ec2_id output producing incorrect value

The Retool Standalone EC2 Module output for ec2_id returns the arn which causes later resources to fail when needing the instance id.

e.g.:

Error registering targets with target group: ValidationError: Instance ID 'arn:aws:ec2:us-west-2:xxxxxxxxxxxx:instance/i-xxxxxxxxxxxxxxxxx' is not valid

Update ECS module to enable Dynamic Port Mapping

Currently, as provided, one cannot do rolling deployments on the ECS-EC2 module.

This is due to the hostPort being configured (port 80) and not allowing AWS/Docker magic to occur.

The fix is simple. Update hostPort: 0 instead of hostPort: 80 on both task definitions.

Doing this one update allowed for a smooth rolling update to occur.
Verified by monitoring the ECS Cluster -> Services -> Event logs and checking which task definitions were active.

Example Error:

service [alpha-retool-main-service](https://us-east-1.console.aws.amazon.com/ecs/home?region=us-east-1#/clusters/alpha-retool-ecs/services/alpha-retool-main-service) 
was unable to place a task because no container instance met all of its requirements. 
The closest matching container-instance is already using a port required by your task. For more information, see the [Troubleshooting section]
(http://docs.aws.amazon.com/AmazonECS/latest/developerguide/troubleshooting.html).

AWS ECS - propagate tags to tasks

In the AWS ECS setup, the aws_ecs_service resource doesn't propagate tags to the tasks. This results in large amounts of fargate VCPU usage going untagged and potentially not visible in AWS Cost Explorer.

Could we get this added as per the AWS terraform documentation documentation on the service resource. There are two options, so perhaps defaulting to one and allowing a variable for the other would make sense.

Unpinned resource error when using tflint

module "retool" {
  source  = "[email protected]:tryretool/retool-terraform.git//modules/aws_ecs"
  deployment_name = var.app_name
  launch_type     = "EC2"

  ecs_cluster_name   = var.environment
  ecs_cluster_region = var.region

  workflows_enabled = false
}

TF Lint warning/error:

> TFLint in ./:
> 1 issue(s) found:
> 
> Warning: Module source "[email protected]:tryretool/retool-terraform.git//modules/aws_ecs" is not pinned (terraform_module_pinned_source)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.