Skip to content
Merged
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
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,54 @@ This repo follows the [terraform standard module structure](https://www.terrafor
Inline example implementation of the module. This is the most basic example of what it would look like to use this module.
```
module "rds_postgres" {
source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=0.3.0"
postgres_name = "example_rds_postgres"
parameter_group_name = "example-rds-postgres-pg"
identifier_prefix = "example-rds-"
username = "exampleUsername"
password = "examplePassword"
source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=0.3.0"
postgres_name = "example_rds_postgres"
parameter_group_name = "example-rds-postgres-pg"
identifier_prefix = "example-rds-"
username = "exampleUsername"
password = "examplePassword"

subnet_group_name = "example_subnet"
rds_subnet_ids = ["example-subnet-1", "example-subnet-2"]
spark_cluster_sg_ids = ["sg-examplesecuritygroup1", "sg-examplesecuritygroup2"]
tamr_vm_sg_id = "sg-exampletamrsecuritygroup"
vpc_id = "vpc-examplevpcnetworkid"
subnet_group_name = "example_subnet"
rds_subnet_ids = ["example-subnet-1", "example-subnet-2"]
spark_cluster_sg_ids = ["sg-examplesecuritygroup1", "sg-examplesecuritygroup2"]
tamr_vm_sg_id = "sg-exampletamrsecuritygroup"
vpc_id = "vpc-examplevpcnetworkid"
}
```
## Minimal
Smallest complete fully working example. This example might require extra resources to run the example.
- [Minimal](https://github.com/Datatamer/terraform-aws-rds-postgres/tree/master/examples/minimal)

# Resources Created
This terraform module will create:
* an AWS RDS Postgres instance
* database parameter group
* A security group for the rds instance
* a database parameter group
* a security group for the rds instance

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 0.12 |
| aws | >= 2.45.0 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| aws | >= 2.45.0 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| password | The postgres password | `string` | n/a | yes |
| rds\_subnet\_ids | VPC subnet IDs in subnet group | `list(string)` | n/a | yes |
| spark\_cluster\_sg\_ids | Security group is attached to the ec2 instances of EMR Spark | `list(string)` | n/a | yes |
| subnet\_group\_name | The name of the subnet group to add the RDS instance to | `string` | n/a | yes |
| tamr\_vm\_sg\_id | Security group id attached to the tamr vm | `string` | n/a | yes |
| vpc\_id | VPC ID for the rds security group | `string` | n/a | yes |
| subnet\_group\_name | The name of the subnet group to add the RDS instance to | `string` | n/a | yes |
| rds\_subnet\_ids | List of subnet IDs to add to subnet group | `list(string)` | n/a | yes |
| additional\_cidrs | Additional CIDR to connect to RDS Postgres instance | `list(string)` | `[]` | no |
| additional\_tags | Additional tags to set on the RDS instance | `map` | `{}` | no |
| allocated\_storage | Allocate storage | `number` | `20` | no |
Expand Down Expand Up @@ -90,6 +94,7 @@ This terraform module will create:
## Releasing new versions
* Updated version contained in `VERSION`
* Documented changes in `CHANGELOG.md`
* Create a tag in github for the commit associated with the version

# License
Apache 2 Licensed. See LICENSE for full details.
30 changes: 16 additions & 14 deletions modules/rds-postgres-sg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,33 @@ This terraform module creates the security group and the security group rules fo
# Example
```
module "rds_sg" {
source = "./modules/rds-postgres-sg"
spark_cluster_sg_ids = ["sg-examplesparksecuritygroup1", "sg-examplesparksecuritygroup2"]
tamr_vm_sg_id = "sg-exampletamrvmsecuritygroup"
vpc_id = "vpc-examplevpcid"
security_group_name = "examplerdssecuritygroup"
additional_cidrs = ["1.2.3.4/32"]
source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git//modules/rds-postgres-sg?ref=0.3.0"
spark_cluster_sg_ids = ["sg-examplesparksecuritygroup1", "sg-examplesparksecuritygroup2"]
tamr_vm_sg_id = "sg-exampletamrvmsecuritygroup"
vpc_id = "vpc-examplevpcid"
security_group_name = "examplerdssecuritygroup"
additional_cidrs = ["1.2.3.4/32"]
}
```

# Resources Created
This terraform module will create:
* a security group for the RDS instance
* security group rules if additional CIDRs are provided

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12 |
| aws | >= 2.45.0 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| aws | >= 2.45.0 |

## Inputs

Expand All @@ -42,9 +50,3 @@ No requirements.
| rds\_sg\_id | n/a |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

# AWS Resources created
This terraform module creates 1 Security Group:
* A security group for the RDS instance

This terraform module also creates Security Group Rules. The number of Security Group rules vary depending on the additional CIDRs provided.
6 changes: 6 additions & 0 deletions modules/rds-postgres-sg/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
terraform {
required_version = ">= 0.12"
required_providers {
aws = ">= 2.45.0"
}
}
4 changes: 3 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

terraform {
required_version = ">= 0.12"
required_providers {
aws = ">= 2.45.0"
}
}