Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: meltano implementation #155

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions catalog/aws/meltano/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions catalog/aws/meltano/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Meltano is an open source platform for dataops workflows. More information here: [meltano.com](https://meltano.com)
*
*/

locals {
meltano_url = "http://${module.airflow_ecs_task.load_balancer_dns}:8080"
}

module "meltano_ecs_cluster" {
source = "../../../components/aws/ecs-cluster"
name_prefix = var.name_prefix
environment = var.environment
resource_tags = var.resource_tags
}

module "meltano_ecs_task" {
source = "../../../components/aws/ecs-task"
name_prefix = var.name_prefix
environment = var.environment
resource_tags = var.resource_tags
use_fargate = true
ecs_cluster_name = module.airflow_ecs_cluster.ecs_cluster_name
container_image = var.container_image
container_num_cores = var.container_num_cores
container_ram_gb = var.container_ram_gb
admin_ports = ["8080"]
always_on = true
use_load_balancer = true
}
23 changes: 23 additions & 0 deletions catalog/aws/meltano/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
output "meltano_url" {
description = "Link to the meltano web UI."
value = local.meltano_url
}
output "logging_url" {
description = "Link to Meltano logs in Cloudwatch."
value = module.meltano_ecs_task.ecs_logging_url
}
output "server_launch_cli" {
description = "Command to launch the Meltano web server via ECS."
value = module.meltano_ecs_task.ecs_runtask_cli
}
output "summary" {
description = "Summary of resources created by this module."
value = <<EOF


Meltano Summary:
- Meltano URL: ${coalesce(local.meltano_url, "n/a")}
- Logging URL: ${coalesce(module.meltano_ecs_task.ecs_logging_url, "n/a")}
- Launch command: ${coalesce(module.meltano_ecs_task.ecs_runtask_cli, "n/a")}
EOF
}
61 changes: 61 additions & 0 deletions catalog/aws/meltano/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
##############################################
### Standard variables for all AWS modules ###
##############################################

variable "name_prefix" {
description = "Standard `name_prefix` module input. (Prefix counts towards 64-character max length for certain resource types.)"
type = string
}
variable "environment" {
description = "Standard `environment` module input."
type = object({
vpc_id = string
aws_region = string
public_subnets = list(string)
private_subnets = list(string)
})
}
variable "resource_tags" {
description = "Standard `resource_tags` module input."
type = map(string)
}

########################################
### Custom variables for this module ###
########################################

variable "container_command" {
description = "The command to run on the Meltano container."
type = string
}
variable "container_image" {
description = "Optional. Overrides the docker image used for Meltano execution."
type = string
default = "meltano"
}
variable "container_num_cores" {
description = "Optional. The number of CPU cores."
default = 2
}
variable "container_ram_gb" {
description = "Optional. The amount of RAM to use, in GB."
default = 4
}
variable "environment_vars" {
description = "A map of environment variables to pass to the Meltano image."
type = map(string)
default = {}
}
variable "environment_secrets" {
description = <<EOF
A map of environment variable secrets to pass to the Meltano image. Each secret value should be either a
Secrets Manager URI or a local JSON or YAML file reference in the form `/path/to/file.yml:name_of_secret`.
EOF
type = map(string)
default = {}
}
variable "github_repo_ref" {
description = "The git repo reference to clone onto the meltano server"
type = string
default = null
}