From 91d81a7ac3299ee1d23cf37cc07ba5ab37608ff1 Mon Sep 17 00:00:00 2001 From: Rustie Lin Date: Tue, 27 Sep 2022 10:31:36 -0700 Subject: [PATCH] [tf/helm] delete old indexer deployment configs (#4565) --- terraform/helm/indexer/.helmignore | 2 - terraform/helm/indexer/Chart.lock | 6 -- terraform/helm/indexer/Chart.yaml | 8 -- terraform/helm/indexer/README.md | 12 --- .../prometheus-postgres-exporter-3.0.0.tgz | Bin 9891 -> 0 bytes terraform/helm/indexer/files/nginx.conf | 12 --- terraform/helm/indexer/templates/_helpers.tpl | 63 ----------- terraform/helm/indexer/templates/indexer.yaml | 73 ------------- terraform/helm/indexer/templates/nginx.yaml | 63 ----------- terraform/helm/indexer/templates/psp.yaml | 69 ------------ .../indexer/templates/serviceaccount.yaml | 10 -- terraform/helm/indexer/values.yaml | 38 ------- terraform/modules/indexer/auth.tf | 52 ---------- terraform/modules/indexer/helm.tf | 47 --------- terraform/modules/indexer/main.tf | 18 ---- terraform/modules/indexer/output.tf | 17 --- terraform/modules/indexer/rds.tf | 77 -------------- terraform/modules/indexer/variables.tf | 98 ------------------ terraform/modules/indexer/versions.tf | 11 -- 19 files changed, 676 deletions(-) delete mode 100644 terraform/helm/indexer/.helmignore delete mode 100644 terraform/helm/indexer/Chart.lock delete mode 100644 terraform/helm/indexer/Chart.yaml delete mode 100644 terraform/helm/indexer/README.md delete mode 100644 terraform/helm/indexer/charts/prometheus-postgres-exporter-3.0.0.tgz delete mode 100644 terraform/helm/indexer/files/nginx.conf delete mode 100644 terraform/helm/indexer/templates/_helpers.tpl delete mode 100644 terraform/helm/indexer/templates/indexer.yaml delete mode 100644 terraform/helm/indexer/templates/nginx.yaml delete mode 100644 terraform/helm/indexer/templates/psp.yaml delete mode 100644 terraform/helm/indexer/templates/serviceaccount.yaml delete mode 100644 terraform/helm/indexer/values.yaml delete mode 100644 terraform/modules/indexer/auth.tf delete mode 100644 terraform/modules/indexer/helm.tf delete mode 100644 terraform/modules/indexer/main.tf delete mode 100644 terraform/modules/indexer/output.tf delete mode 100644 terraform/modules/indexer/rds.tf delete mode 100644 terraform/modules/indexer/variables.tf delete mode 100644 terraform/modules/indexer/versions.tf diff --git a/terraform/helm/indexer/.helmignore b/terraform/helm/indexer/.helmignore deleted file mode 100644 index b72f9be2042aa..0000000000000 --- a/terraform/helm/indexer/.helmignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.swp diff --git a/terraform/helm/indexer/Chart.lock b/terraform/helm/indexer/Chart.lock deleted file mode 100644 index e27bc6c560b46..0000000000000 --- a/terraform/helm/indexer/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: prometheus-postgres-exporter - repository: https://prometheus-community.github.io/helm-charts - version: 3.0.0 -digest: sha256:33437ac3391ed4ebf3281b01916fea80c314a6a39d94bdb63e5e6748b3df0d76 -generated: "2022-05-23T11:31:04.019359-07:00" diff --git a/terraform/helm/indexer/Chart.yaml b/terraform/helm/indexer/Chart.yaml deleted file mode 100644 index 65a1d8eb401a7..0000000000000 --- a/terraform/helm/indexer/Chart.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v2 -appVersion: 0.1.0 -name: indexer -version: 0.2.0 -dependencies: - - name: prometheus-postgres-exporter - version: 3.0.0 - repository: https://prometheus-community.github.io/helm-charts diff --git a/terraform/helm/indexer/README.md b/terraform/helm/indexer/README.md deleted file mode 100644 index d8ffcf189f013..0000000000000 --- a/terraform/helm/indexer/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Aptos Indexer - -Aptos Indexer helm chart simply installs the aptos indexer with database connection URI stored in `indexer_credentials` secret. - -Since the DB and indexer may exist in a private network, developers can utilize the provided nginx to port-foward locally the DB connection. For example: - -``` -# ensure nginx.enabled=true -$ kubectl port-forward deployment/indexer-nginx 5432:5432 -``` - -Then, you may connect to `localhost:5432` using the configured username and password in the upstream database. For example, you could use `psql` or even Postico. diff --git a/terraform/helm/indexer/charts/prometheus-postgres-exporter-3.0.0.tgz b/terraform/helm/indexer/charts/prometheus-postgres-exporter-3.0.0.tgz deleted file mode 100644 index d6b0e6d1d6af6f3dbd51b283cd7fffd08e74ef1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9891 zcmV;UCS2JciwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PKBhciT9!;C$w)q?N)rs%;HIm)EvpG2m zL_!kUB*6fnY<1%O?R)Sb2|o1jBc7hS<_BBEqpDCSR24v=5HlKLF~tdQ#*~W*!@P-a zW6A_(t-~o|!kwcq_|s#acDvnv`}(!|-)^_d|J!fhz5P??_3qxAcDud1_wG;a&bv-~ z?@!Qv6xKDLgbT#})P6Lsa^wC@9u$*bFyn+qU6}1UD2}t&w%cjD9mmJqVJuV%}}FCPYk=k?Ya0Wl5b!!!U`6n77jU!>s-_p5IXB z^RCm(pnnPEOIF`$LRLIPBoc^3n5h~#L?r0KgrJBeBSQakA`>Kj2OvU{v@9<#{yU1M zoZx9q=`_pHugivx!)d}itmt@n`^7xQT|jXh5D&=?aAs-e?73~X?L5B!myZ7#3KGm8 ztpJvf|JS?kc6ZC;e{b*I%lLneX9JG#7$t!K-Pxra2$Y*4LDbN4h6v+c#J(Vo&$;iF^1+q$Dk;>NP=L1J%$B$buIG-VZw!MW{9Fh z!SEPHLNyq~6e~5tW8`5|kKu8y9;Bg3VhBzWk#aZ0PH%1b`-l^S&wTdfF}M865ceESr9nDp}=h3l%-S^m4pSGUm!8C`SnFg(Xo*23M_(>(6DmL`7f`6#QLSc~>b1r{y z6vk5fjPRH;3?!OhuI#9+9on@?G|AygvYAdFdIl`w5M!2&)?EE$qcu-zDU~L&k*kEi z^tMq%pzyL1Elv)yp9E@HR^%M{KG8bs#2$2(05=*^g(d+`8>n>8Omf99D zn!!MaCZGUI9rGcX;6BdWpc6DPB|v(AtPAmE$nyMQfF@rJto_Ep~~Y-t(cM-vKzDVMfHf3mzkacqqs+Z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z*<5E^w==jK|`8T3wi zhnFCBT}IXHXeSLvCH7n&i9(XXNBr#FLqWjv3RIwAC?~Vff=;{L*7F~3Wem9vk(bp8 zNmQw!>ZBRf8t8UG4Uat%oJNLSg@Ret@@>-Vg|1ApF!P3Cjtha}o`01nQM(oqA)12{XsgtM!Y z6ZouEr_ndNslLGwGZG>;H#!DLq%(nNwWv+-!NoC*84Y39k(y$*>*}eH)Ewp@F;^yg z&vkx6-t`S)zShG?5OuP64yw3-NrD)P1jarjQGhvzIZYs>J{ju^AI*}cx&x9%xyIh) zmg~Y@=Zb4Zbwk-TVl;_-ZN1cuib}&`LvyMTV}@sH8Y2t`WGis4wE*9uFb=S^8YNoowG0F_o9Y_c-#Cq+8Sig?{Mw*#qYDjf^%^_S zkkd<<(&91pTIs4#%UTd>>903;pEmQpKNnN!ev*i0mLg?VjTJUrEO{Rv4?i6AFF!%E zX-uB&UDy>@8%78J1LH%5FI95(2)F|dZb!Vf5KxqgEwv!i6#qZP{y^T{Mn(R zXT!_kHN_Nbf3P`H@Y04#7s-|5hhwZ9kIa`E1sG_ozc(pU=wpFMfPK{}DX=>*Q#WSRlHm6G(M#_Is`R;pr81!o|C;iFVD;K V@;t}${{jF2|Np2vY&-ze006XYNw@$2 diff --git a/terraform/helm/indexer/files/nginx.conf b/terraform/helm/indexer/files/nginx.conf deleted file mode 100644 index f6ab674eeb6e6..0000000000000 --- a/terraform/helm/indexer/files/nginx.conf +++ /dev/null @@ -1,12 +0,0 @@ -events { - worker_connections 1024; -} -stream { - upstream main { - server {{ $.Values.nginx.upstream.main }}; - } - server { - listen 5432; - proxy_pass main; - } -} diff --git a/terraform/helm/indexer/templates/_helpers.tpl b/terraform/helm/indexer/templates/_helpers.tpl deleted file mode 100644 index 4e8725ef6cdc4..0000000000000 --- a/terraform/helm/indexer/templates/_helpers.tpl +++ /dev/null @@ -1,63 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "aptos-indexer.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "aptos-indexer.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "aptos-indexer.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "aptos-indexer.labels" -}} -helm.sh/chart: {{ include "aptos-indexer.chart" . }} -{{ include "aptos-indexer.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Selector labels -*/}} -{{- define "aptos-indexer.selectorLabels" -}} -app.kubernetes.io/part-of: {{ include "aptos-indexer.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "aptos-indexer.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (include "aptos-indexer.fullname" .) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} diff --git a/terraform/helm/indexer/templates/indexer.yaml b/terraform/helm/indexer/templates/indexer.yaml deleted file mode 100644 index 0677b51114f9f..0000000000000 --- a/terraform/helm/indexer/templates/indexer.yaml +++ /dev/null @@ -1,73 +0,0 @@ - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "aptos-indexer.fullname" . }} - labels: - {{- include "aptos-indexer.labels" . | nindent 4 }} - app.kubernetes.io/name: indexer -spec: - selector: - matchLabels: - {{- include "aptos-indexer.selectorLabels" . | nindent 6 }} - app.kubernetes.io/name: indexer - template: - metadata: - labels: - {{- include "aptos-indexer.selectorLabels" . | nindent 8 }} - app.kubernetes.io/name: indexer - annotations: - seccomp.security.alpha.kubernetes.io/pod: runtime/default - spec: - containers: - - name: indexer - resources: - {{- toYaml .Values.indexer.resources | nindent 10 }} - env: - - name: RUST_BACKTRACE - value: "1" - - name: DATABASE_URI - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-credentials - key: pg_db_uri - image: {{ .Values.indexer.image.repo }}:{{ .Values.indexer.image.tag }} - imagePullPolicy: {{ .Values.indexer.image.pullPolicy }} - command: - - sh - - -c - - | - aptos-indexer --pg-uri=$DATABASE_URI --node-url={{ .Values.nodeUrl }} \ - {{- if .Values.indexTokenData }} - --index-token-data \ - {{- end }} - --emit-every {{ .Values.emitEvery }} \ - --batch-size {{ .Values.batchSize }} - securityContext: - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - securityContext: - runAsNonRoot: true - runAsUser: 6180 - runAsGroup: 6180 - serviceAccountName: {{ include "aptos-indexer.serviceAccountName" . }} - ---- - -apiVersion: v1 -kind: Service -metadata: - name: {{ include "aptos-indexer.fullname" . }} - labels: - {{- include "aptos-indexer.labels" . | nindent 4 }} -spec: - selector: - app.kubernetes.io/name: indexer - ports: - - port: 80 - targetPort: 8080 - type: NodePort - externalTrafficPolicy: Local diff --git a/terraform/helm/indexer/templates/nginx.yaml b/terraform/helm/indexer/templates/nginx.yaml deleted file mode 100644 index b7eff6560ba1d..0000000000000 --- a/terraform/helm/indexer/templates/nginx.yaml +++ /dev/null @@ -1,63 +0,0 @@ -{{- if .Values.nginx.enabled }} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "aptos-indexer.fullname" . }}-nginx - labels: - {{- include "aptos-indexer.labels" . | nindent 4 }} -data: - nginx.conf: |- -{{ (tpl (.Files.Get "files/nginx.conf") .) | indent 4 }} - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "aptos-indexer.fullname" . }}-nginx - labels: - {{- include "aptos-indexer.labels" . | nindent 4 }} - app.kubernetes.io/name: nginx -spec: - selector: - matchLabels: - {{- include "aptos-indexer.selectorLabels" . | nindent 6 }} - app.kubernetes.io/name: nginx - template: - metadata: - labels: - {{- include "aptos-indexer.selectorLabels" . | nindent 8 }} - app.kubernetes.io/name: nginx - annotations: - seccomp.security.alpha.kubernetes.io/pod: runtime/default - spec: - containers: - - name: nginx - image: {{ .Values.nginx.image.repo }}:{{ .Values.nginx.image.tag }} - imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} - volumeMounts: - - name: nginx - mountPath: /etc/nginx/nginx.conf - subPath: nginx.conf - readOnly: true - - name: nginx-data - mountPath: /var/run - securityContext: - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - securityContext: - runAsNonRoot: true - runAsUser: 6180 - runAsGroup: 6180 - serviceAccountName: {{ include "aptos-indexer.serviceAccountName" . }} - volumes: - - name: nginx-data - emptyDir: {} - - name: nginx - configMap: - name: {{ include "aptos-indexer.fullname" . }}-nginx -{{- end}} \ No newline at end of file diff --git a/terraform/helm/indexer/templates/psp.yaml b/terraform/helm/indexer/templates/psp.yaml deleted file mode 100644 index 4643bb9ad46d9..0000000000000 --- a/terraform/helm/indexer/templates/psp.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: {{ include "aptos-indexer.fullname" . }} - annotations: - seccomp.security.alpha.kubernetes.io/allowedProfileNames: runtime/default -spec: - privileged: false - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - requiredDropCapabilities: - - ALL - hostNetwork: false - hostIPC: false - hostPID: false - runAsUser: - rule: MustRunAsNonRoot - runAsGroup: - rule: MustRunAs - ranges: - - min: 1 - max: 65535 - supplementalGroups: - rule: MayRunAs - ranges: - - min: 1 - max: 65535 - fsGroup: - rule: MayRunAs - ranges: - - min: 1 - max: 65535 - seLinux: - rule: RunAsAny - volumes: - - configMap - - emptyDir - - projected - - secret - - downwardAPI - - persistentVolumeClaim - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ include "aptos-indexer.fullname" . }}-psp -rules: -- apiGroups: ["policy"] - resources: ["podsecuritypolicies"] - verbs: ["use"] - resourceNames: - - {{ include "aptos-indexer.fullname" . }} - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ include "aptos-indexer.fullname" . }}-psp -roleRef: - kind: ClusterRole - name: {{ include "aptos-indexer.fullname" . }}-psp - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - namespace: {{ .Release.Namespace }} - name: {{ include "aptos-indexer.serviceAccountName" . }} diff --git a/terraform/helm/indexer/templates/serviceaccount.yaml b/terraform/helm/indexer/templates/serviceaccount.yaml deleted file mode 100644 index ae1634034a7a0..0000000000000 --- a/terraform/helm/indexer/templates/serviceaccount.yaml +++ /dev/null @@ -1,10 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "aptos-indexer.serviceAccountName" . }} - labels: - {{ include "aptos-indexer.labels" . | nindent 4 }} - annotations: - {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} -{{- end -}} diff --git a/terraform/helm/indexer/values.yaml b/terraform/helm/indexer/values.yaml deleted file mode 100644 index abfe923b043ab..0000000000000 --- a/terraform/helm/indexer/values.yaml +++ /dev/null @@ -1,38 +0,0 @@ -nodeUrl: https://fullnode.devnet.aptoslabs.com -emitEvery: 1000 -batchSize: 10 -indexTokenData: false - -indexer: - image: - repo: aptoslabs/indexer - tag: devnet - pullPolicy: IfNotPresent - -nginx: - enabled: false - upstream: - main: - image: - repo: nginx - tag: latest - pullPolicy: IfNotPresent - -nodeSelector: {} -tolerations: [] -affinity: {} - -serviceAccount: - # Specifies whether a service account should be created - create: true - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: - annotations: {} - -service: - # Change this to LoadBalancer to expose the indexer server endpoint externally - type: ClusterIP - externalTrafficPolicy: - loadBalancerSourceRanges: [] - annotations: {} diff --git a/terraform/modules/indexer/auth.tf b/terraform/modules/indexer/auth.tf deleted file mode 100644 index d5c1e53533e1a..0000000000000 --- a/terraform/modules/indexer/auth.tf +++ /dev/null @@ -1,52 +0,0 @@ - -# access control -data "aws_iam_policy_document" "indexer-assume-role" { - statement { - actions = ["sts:AssumeRoleWithWebIdentity"] - - principals { - type = "Federated" - identifiers = [ - "arn:aws:iam::${data.aws_caller_identity.current.account_id}:oidc-provider/${var.oidc_provider}" - ] - } - - condition { - test = "StringEquals" - variable = "${var.oidc_provider}:sub" - # the name of the default indexer service account - values = ["system:serviceaccount:default:indexer"] - } - - condition { - test = "StringEquals" - variable = "${var.oidc_provider}:aud" - values = ["sts.amazonaws.com"] - } - } -} - -data "aws_iam_policy_document" "indexer" { - statement { - sid = "RDSWrite" - actions = [ - "rds:*", - ] - resources = [ - aws_db_instance.indexer.arn - ] - } -} - -resource "aws_iam_role" "indexer" { - name = "aptos-${local.workspace_name}-indexer" - path = var.iam_path - permissions_boundary = var.permissions_boundary_policy - assume_role_policy = data.aws_iam_policy_document.indexer-assume-role.json -} - -resource "aws_iam_role_policy" "indexer" { - name = "Helm" - role = aws_iam_role.indexer.name - policy = data.aws_iam_policy_document.indexer.json -} diff --git a/terraform/modules/indexer/helm.tf b/terraform/modules/indexer/helm.tf deleted file mode 100644 index ee7d9fcbb769f..0000000000000 --- a/terraform/modules/indexer/helm.tf +++ /dev/null @@ -1,47 +0,0 @@ -locals { - indexer_helm_chart_path = "${path.module}/../../helm/indexer" -} - -resource "helm_release" "indexer" { - name = "indexer-${local.workspace_name}" - chart = local.indexer_helm_chart_path - max_history = 2 - wait = false - - values = [ - jsonencode({ - nodeUrl = var.node_url - indexer = { - image = { - tag = var.image_tag - } - } - nginx = { - enabled = true - upstream = { - main = "${aws_db_instance.indexer.address}:5432" - } - } - serviceAccount = { - annotations = { - "eks.amazonaws.com/role-arn" = aws_iam_role.indexer.arn - } - } - prometheus-postgres-exporter = { - config = { - datasourceSecret = { - name = kubernetes_secret.indexer_credentials.metadata[0].name - key = "pg_db_uri" - } - } - } - }), - jsonencode(var.indexer_helm_values), - ] - - # inspired by https://stackoverflow.com/a/66501021 to trigger redeployment whenever any of the charts file contents change. - set { - name = "chart_sha1" - value = sha1(join("", [for f in fileset(local.indexer_helm_chart_path, "**") : filesha1("${local.indexer_helm_chart_path}/${f}")])) - } -} diff --git a/terraform/modules/indexer/main.tf b/terraform/modules/indexer/main.tf deleted file mode 100644 index acfbcbd22c706..0000000000000 --- a/terraform/modules/indexer/main.tf +++ /dev/null @@ -1,18 +0,0 @@ -# provider "aws" { -# region = var.region -# } - -data "aws_availability_zones" "available" { - state = "available" -} - -locals { - aws_availability_zones = slice(sort(data.aws_availability_zones.available.names), 0, min(3, length(data.aws_availability_zones.available.names))) - default_tags = { - Terraform = "indexer" - Workspace = local.workspace_name - } - workspace_name = var.workspace_name_override == "" ? terraform.workspace : var.workspace_name_override -} - -data "aws_caller_identity" "current" {} diff --git a/terraform/modules/indexer/output.tf b/terraform/modules/indexer/output.tf deleted file mode 100644 index 6d77c0be7b96d..0000000000000 --- a/terraform/modules/indexer/output.tf +++ /dev/null @@ -1,17 +0,0 @@ -output "rds_hostname" { - description = "RDS instance hostname" - value = aws_db_instance.indexer.address - sensitive = true -} - -output "rds_port" { - description = "RDS instance port" - value = aws_db_instance.indexer.port - sensitive = true -} - -output "rds_username" { - description = "RDS instance root username" - value = aws_db_instance.indexer.username - sensitive = true -} diff --git a/terraform/modules/indexer/rds.tf b/terraform/modules/indexer/rds.tf deleted file mode 100644 index 5e262d3473536..0000000000000 --- a/terraform/modules/indexer/rds.tf +++ /dev/null @@ -1,77 +0,0 @@ -resource "aws_db_subnet_group" "indexer" { - name = "indexer-${local.workspace_name}" - subnet_ids = var.subnet_ids - - tags = local.default_tags -} - -resource "aws_security_group" "indexer" { - name = "indexer-${local.workspace_name}" - vpc_id = var.vpc_id - tags = local.default_tags - - ingress { - from_port = 5432 - to_port = 5432 - protocol = "tcp" - cidr_blocks = var.db_sources_ipv4 - } -} - -resource "aws_db_parameter_group" "indexer" { - name = "indexer-${local.workspace_name}" - # family parameter must correspond with the engine version of aws_db_instance.indexer - # aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily" - family = var.db_parameter_group_family - - parameter { - name = "log_connections" - value = "1" - } - - parameter { - name = "rds.logical_replication" - apply_method = "pending-reboot" - value = "1" - } - - lifecycle { - ignore_changes = [ - parameter - ] - } -} - - -resource "aws_db_instance" "indexer" { - identifier = "indexer-${local.workspace_name}" - - instance_class = var.db_instance_class - allocated_storage = var.db_allocated_storage - max_allocated_storage = var.db_max_allocated_storage - - iops = var.db_iops > 0 ? var.db_iops : null - - engine = var.db_engine - engine_version = var.db_engine_version - username = "indexer" - password = var.db_password - db_subnet_group_name = aws_db_subnet_group.indexer.name - vpc_security_group_ids = [aws_security_group.indexer.id] - parameter_group_name = aws_db_parameter_group.indexer.name - publicly_accessible = var.db_publicly_accessible - skip_final_snapshot = true - performance_insights_enabled = var.performance_insights_enabled -} - -resource "kubernetes_secret" "indexer_credentials" { - metadata { - name = "indexer-${local.workspace_name}-credentials" - namespace = "default" - } - - # TODO(rustielin): replace assumptions on db name - data = { - pg_db_uri = "postgresql://${aws_db_instance.indexer.username}:${var.db_password}@${aws_db_instance.indexer.address}:5432/postgres" - } -} diff --git a/terraform/modules/indexer/variables.tf b/terraform/modules/indexer/variables.tf deleted file mode 100644 index 4ae6c30297191..0000000000000 --- a/terraform/modules/indexer/variables.tf +++ /dev/null @@ -1,98 +0,0 @@ -variable "region" { - description = "AWS region" - type = string -} - -variable "image_tag" { - default = "devnet" - description = "Image tag for indexer" -} - -variable "iam_path" { - default = "/" - description = "Path to use when naming IAM objects" -} - -variable "permissions_boundary_policy" { - default = "" - description = "ARN of IAM policy to set as permissions boundary on created roles" -} - -variable "workspace_name_override" { - description = "If specified, overrides the usage of Terraform workspace for naming purposes" - default = "" -} - -variable "subnet_ids" { - description = "Subnet IDs to create the DB subnet groups" -} - -variable "vpc_id" { - description = "VPC ID to create resources in" -} - -variable "db_sources_ipv4" { - description = "List of CIDR subnets which can access the DB" - default = ["0.0.0.0/0"] -} - -variable "indexer_helm_values" { - default = {} -} - -variable "db_password" { - description = "RDS root user password" - type = string - sensitive = true -} - -variable "oidc_provider" {} - -variable "node_url" { - description = "REST API endpoint to pull blockchain data from" -} - -variable "db_instance_class" { - description = "Instance class of the RDS DB" - default = "db.t3.micro" -} - -variable "db_engine_version" { - description = "Engine version for the RDS DB" - default = "14.1" -} - -variable "db_engine" { - description = "Engine name for the RDS DB" - default = "postgres" -} - -variable "db_allocated_storage" { - description = "Allocated storage in GB for the RDS DB" - default = 100 -} - -variable "db_max_allocated_storage" { - description = "Max allocated storage in GB for the RDS DB, enabling autoscaling" - default = 500 -} - -variable "db_iops" { - description = "IOPS for the RDS DB" - default = 0 -} - -variable "db_parameter_group_family" { - description = "Parameter group family name for the RDS DB. Must be compatible with the db_engine and db_engine_version. https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithDBInstanceParamGroups.html" - default = "postgres14" -} - -variable "db_publicly_accessible" { - default = false - description = "Determines if RDS instance is publicly accessible" -} - -variable "performance_insights_enabled" { - default = false - description = "Determines if performance insights are enabled for the RDS DB" -} diff --git a/terraform/modules/indexer/versions.tf b/terraform/modules/indexer/versions.tf deleted file mode 100644 index fead1eaa92476..0000000000000 --- a/terraform/modules/indexer/versions.tf +++ /dev/null @@ -1,11 +0,0 @@ -terraform { - required_version = "~> 1.2.0" - required_providers { - helm = { - source = "hashicorp/helm" - } - kubernetes = { - source = "hashicorp/kubernetes" - } - } -}