marcus-bcl / cloud-platform-terraform-opensearch

A Terraform module to create an OpenSearch cluster on the Cloud Platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cloud-platform-terraform-opensearch

Releases

This Terraform module will create an AWS OpenSearch domain for use on the Cloud Platform.

It also creates an IRSA to allow access via your Cloud Platform namespace pods, and a proxy webserver to automatically sign requests to your OpenSearch domain from your pods.

Usage

module "opensearch" {
  source = "github.com/ministryofjustice/cloud-platform-terraform-opensearch?ref=version" # use the latest release

  # VPC/EKS configuration
  vpc_name         = var.vpc_name
  eks_cluster_name = var.eks_cluster_name

  # Cluster configuration
  engine_version = "OpenSearch_2.5"

  cluster_config   = {
    instance_count = 2
    instance_type  = "t3.small.search"
  }

  ebs_options = {
    volume_size = 10
  }

  # Tags
  business_unit          = var.business_unit
  application            = var.application
  is_production          = var.is_production
  team_name              = var.team_name
  namespace              = var.namespace
  environment_name       = var.environment
  infrastructure_support = var.infrastructure_support
}

See the examples/ folder for more information.

Requirements

Name Version
terraform >= 1.2.5
aws >= 4.0.0
kubernetes >= 2.0.0
random >= 3.0.0

Providers

Name Version
aws >= 4.0.0
kubernetes >= 2.0.0
random >= 3.0.0

Modules

Name Source Version
irsa github.com/ministryofjustice/cloud-platform-terraform-irsa 1.1.0

Resources

Name Type
aws_iam_policy.irsa resource
aws_kms_key.this resource
aws_opensearch_domain.this resource
aws_opensearch_domain_policy.this resource
aws_security_group.this resource
kubernetes_deployment.proxy resource
kubernetes_service.proxy resource
random_id.name resource
aws_iam_policy_document.domain_policy data source
aws_iam_policy_document.irsa data source
aws_subnet.private data source
aws_subnets.private data source
aws_vpc.this data source

Inputs

Name Description Type Default Required
advanced_options Key-value string pairs to specify advanced configuration options map(string) {} no
application Application name string n/a yes
business_unit Area of the MOJ responsible for the service string n/a yes
cluster_config Configuration block for the cluster of the domain map(any) n/a yes
ebs_options Configuration block for EBS options for the domain map(any) n/a yes
eks_cluster_name The name of the eks cluster to retrieve the OIDC information string n/a yes
engine_version OpenSearch engine version string n/a yes
environment_name Environment name string n/a yes
infrastructure_support The team responsible for managing the infrastructure. Should be of the form () string n/a yes
is_production Whether this is used for production or not string n/a yes
namespace Namespace name string n/a yes
proxy_count Replica count for OpenSearch proxy number 1 no
team_name Team name string n/a yes
vpc_name The name of the vpc (eg.: live-1) string n/a yes

Outputs

Name Description
proxy_url URL for opensearch-proxy service

Tags

Some of the inputs for this module are tags. All infrastructure resources must be tagged to meet the MOJ Technical Guidance on Documenting owners of infrastructure.

You should use your namespace variables to populate these. See the Usage section for more information.

Reading Material

About

A Terraform module to create an OpenSearch cluster on the Cloud Platform

License:MIT License


Languages

Language:HCL 100.0%