Skip to content

insight-infrastructure/terraform-aws-mongodb-ec2

Repository files navigation

terraform-aws-mongodb-ec2

open-issues open-pr

Features

This module sets up an ec2 instance running mongodb with ansible. Runs the popular undergreen.mongodb ansible role to configure the machine. Further configuration settings can be provided in a mongodb.json file.

Please refer to https://github.com/UnderGreen/ansible-role-mongodb for details on how to configure the additional variables supplied by mongodb.json.

Terraform Versions

For Terraform v0.12.0+

Usage

See examples directory for a working example.

module "defaults" {
  source = "../.."

  private_key_path = var.private_key_path
  public_key_path  = var.public_key_path

  vpc_id                 = module.default_vpc.vpc_id
  subnet_ids             = module.default_vpc.subnet_ids
  vpc_security_group_ids = [aws_security_group.this.id]

  playbook_vars_file = "${path.cwd}/mongodb.yaml"

  root_volume_size = 100 # in gb 
}

Examples

Known Issues

No issue is creating limit on this module.

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
create_efs Boolean to create EFS file system bool true no
id The id to give to rds db, falls back to name string "" no
instance_type Instance type string "t2.medium" no
key_name The key pair to import string "" no
name A unique name to give all the resources string "superset" no
playbook_vars Extra vars to include, can be hcl or json any {} no
playbook_vars_file json or yaml to run string "" no
private_key_path The path to the private ssh key string n/a yes
public_key_path The path to the public ssh key string n/a yes
root_volume_size Root volume size string 8 no
subnet_ids The id of the subnet list(string) n/a yes
tags Tags to attach to all resources map(string) {} no
vpc_id The vpc to deploy into string n/a yes
vpc_security_group_ids List of security groups list(string) n/a yes

Outputs

Name Description
instance_id The instance ID created
key_name The key pair name created
public_ip The public IP of the instance created
ssh_command n/a

Testing

This module has been packaged with terratest tests

To run them:

  1. Install Go
  2. Run make test-init from the root of this repo
  3. Run make test again from root

Authors

Module managed by insight-infrastructure

Credits

License

Apache 2 Licensed. See LICENSE for full details.

About

Terraform module to spin up mongodb ec2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published