-
Notifications
You must be signed in to change notification settings - Fork 4
feat: terraform deployment #64
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
Changes from 7 commits
4d47c1e
49ae81c
fe17f98
9992af7
2d114f0
5491be8
d7992ba
50ef5b4
f71d952
adf1bf2
57397a5
ad6c803
04d481c
b981bac
f0c25ec
37c63ae
9d9d830
18eacf9
2ebd17a
9ce323c
7473105
005ad37
40d6688
54ec2f7
79112b1
f3ae27b
d03aa79
f6dcd51
0e46d14
9a9b7d7
7fbbe84
52b5600
4badb8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Directorio de dependencias locales de Terraform | ||
| .terraform/ | ||
|
|
||
| # Archivos de estado de Terraform (contienen información sensible) | ||
| terraform.tfstate | ||
| terraform.tfstate.backup | ||
|
|
||
| # Logs y archivos de crash | ||
| crash.log | ||
|
|
||
| # Archivos de override (no versionables) | ||
| override.tf | ||
| override.tf.json | ||
| *_override.tf | ||
| *_override.tf.json | ||
|
|
||
| # Archivos de configuración local de Terraform CLI | ||
| .terraformrc | ||
| terraform.rc | ||
|
|
||
| # Archivos de variables sensibles | ||
| *.tfvars | ||
| *.tfvars.json | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| terraform { | ||
| backend "s3" { | ||
| bucket = "gitcoin-datalayer-staging-terraform-state" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great that we use remote state 💯 |
||
| key = "state" | ||
| region = "us-east-2" | ||
| encrypt = true | ||
| } | ||
|
|
||
| required_providers { | ||
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = "5.84.0" | ||
| } | ||
| } | ||
|
Comment on lines
+9
to
+14
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should also pin or set a min version for Terraform itself https://developer.hashicorp.com/terraform/tutorials/configuration-language/versions |
||
| } | ||
|
|
||
| provider "aws" { | ||
| region = "us-east-2" | ||
| } | ||
|
|
||
|
|
||
| data "aws_caller_identity" "current" {} | ||
|
|
||
| module "container_registry" { | ||
| source = "../../modules/container-registry" | ||
| app_name = var.app_name | ||
| } | ||
|
|
||
|
|
||
|
|
||
| module "networking" { | ||
| source = "../../modules/networking" | ||
| app_environment = var.app_environment | ||
| app_name = var.app_name | ||
| region = var.region | ||
| } | ||
|
|
||
| module "iam" { | ||
| source = "../../modules/iam" | ||
| app_name = var.app_name | ||
| app_environment = var.app_environment | ||
| region = var.region | ||
| account_id = data.aws_caller_identity.current.account_id | ||
| db_name = var.DATALAYER_PG_DB_NAME | ||
| } | ||
|
|
||
| module "storage" { | ||
| source = "../../modules/storage" | ||
| app_name = var.app_name | ||
| app_environment = var.app_environment | ||
| region = var.region | ||
| db_name = var.DATALAYER_PG_DB_NAME | ||
| rds_username = var.DATALAYER_PG_USER | ||
| rds_password = var.DATALAYER_PG_PASSWORD | ||
| rds_security_group_id = module.networking.rds_security_group_id | ||
| rds_subnet_ids = module.networking.private_subnets | ||
| rds_subnet_group_name = module.networking.rds_subnet_group_name | ||
| } | ||
|
|
||
| module "bastion" { | ||
| source = "../../modules/bastion" | ||
| app_environment = var.app_environment | ||
| app_name = var.app_name | ||
| subnet_id = module.networking.private_subnets[0] | ||
| bastion_instance_profile_name = module.iam.bastion_instance_profile_name | ||
| } | ||
|
|
||
| module "compute" { | ||
| source = "../../modules/compute" | ||
| app_name = var.app_name | ||
| app_environment = var.app_environment | ||
| region = var.region | ||
| processing_repository_url = module.container_registry.processing_repository_url | ||
| processing_service_role_arn = module.iam.processing_service_role_arn | ||
| processing_image_tag = var.processing_image_tag | ||
| processing_security_group_id = module.networking.processing_security_group_id | ||
| api_image_tag = var.api_image_tag | ||
| api_repository_url = var.api_repository_url | ||
| api_service_role_arn = module.iam.api_service_role_arn | ||
| api_security_group_id = module.networking.api_security_group_id | ||
| NODE_ENV = var.NODE_ENV | ||
| RETRY_BASE_DELAY_MS = var.RETRY_BASE_DELAY_MS | ||
| RETRY_MAX_DELAY_MS = var.RETRY_MAX_DELAY_MS | ||
| RETRY_FACTOR = var.RETRY_FACTOR | ||
| RETRY_MAX_ATTEMPTS = var.RETRY_MAX_ATTEMPTS | ||
| DATALAYER_HASURA_DATABASE_URL = "postgresql://${var.DATALAYER_PG_USER}:${var.DATALAYER_PG_PASSWORD}@${module.storage.rds_endpoint}/${var.DATALAYER_PG_DB_NAME}" | ||
| DATALAYER_HASURA_EXPOSED_PORT = var.DATALAYER_HASURA_EXPOSED_PORT | ||
| DATALAYER_HASURA_ENABLE_CONSOLE = var.DATALAYER_HASURA_ENABLE_CONSOLE | ||
| DATALAYER_HASURA_ADMIN_SECRET = var.DATALAYER_HASURA_ADMIN_SECRET | ||
| DATALAYER_HASURA_UNAUTHORIZED_ROLE = var.DATALAYER_HASURA_UNAUTHORIZED_ROLE | ||
| DATALAYER_HASURA_CORS_DOMAIN = var.DATALAYER_HASURA_CORS_DOMAIN | ||
| DATALAYER_HASURA_ENABLE_TELEMETRY = var.DATALAYER_HASURA_ENABLE_TELEMETRY | ||
| DATALAYER_HASURA_DEV_MODE = var.DATALAYER_HASURA_DEV_MODE | ||
| DATALAYER_HASURA_ADMIN_INTERNAL_ERRORS = var.DATALAYER_HASURA_ADMIN_INTERNAL_ERRORS | ||
| DATALAYER_HASURA_CONSOLE_ASSETS_DIR = var.DATALAYER_HASURA_CONSOLE_ASSETS_DIR | ||
| DATALAYER_HASURA_ENABLED_LOG_TYPES = var.DATALAYER_HASURA_ENABLED_LOG_TYPES | ||
| DATALAYER_HASURA_DEFAULT_NAMING_CONVENTION = var.DATALAYER_HASURA_DEFAULT_NAMING_CONVENTION | ||
| DATALAYER_HASURA_BIGQUERY_STRING_NUMERIC_INPUT = var.DATALAYER_HASURA_BIGQUERY_STRING_NUMERIC_INPUT | ||
| DATALAYER_HASURA_EXPERIMENTAL_FEATURES = var.DATALAYER_HASURA_EXPERIMENTAL_FEATURES | ||
| CHAINS = var.CHAINS | ||
|
|
||
| DATABASE_URL = "postgresql://${var.DATALAYER_PG_USER}:${var.DATALAYER_PG_PASSWORD}@${module.storage.rds_endpoint}/${var.DATALAYER_PG_DB_NAME}" | ||
| INDEXER_GRAPHQL_URL = var.INDEXER_GRAPHQL_URL | ||
| # INDEXER_ADMIN_SECRET = var.INDEXER_ADMIN_SECRET | ||
| PUBLIC_GATEWAY_URLS = var.PUBLIC_GATEWAY_URLS | ||
| METADATA_SOURCE = var.METADATA_SOURCE | ||
| PRICING_SOURCE = var.PRICING_SOURCE | ||
| COINGECKO_API_KEY = var.COINGECKO_API_KEY | ||
| COINGECKO_API_TYPE = var.COINGECKO_API_TYPE | ||
| LOG_LEVEL = var.LOG_LEVEL | ||
| public_subnets = module.networking.public_subnets | ||
| private_subnets = module.networking.private_subnets | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be in english 😅 (hope Maradona isn't watching this from heaven)