-
Notifications
You must be signed in to change notification settings - Fork 8
DEV-14916 #16
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
Merged
Merged
DEV-14916 #16
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1.0.0 | ||
| 2.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| vpc_id = "vpc-example" | ||
| subnet_ids = ["subnet-az1", "subnet-az2"] | ||
| ingress_sg_ids = ["example-spark-service-access-sg", "example-tamr-vm-sg"] | ||
| vpc_id = "vpc-example" | ||
| subnet_ids = ["subnet-az1", "subnet-az2"] | ||
| security_group_ids = ["example-spark-service-access-sg", "example-tamr-vm-sg"] | ||
| name_prefix = "test" # Replace me for a more specific prefix | ||
| ingress_cidr_blocks = ["1.2.3.0/24"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,32 @@ | ||
| module "rds_postgres" { | ||
| # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=0.4.0" | ||
| # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=2.0.0" | ||
| source = "../.." | ||
|
|
||
| identifier_prefix = "example-rds-pg-" | ||
| postgres_name = "example0" | ||
| parameter_group_name = "example-rds-postgres-pg" | ||
| username = "example-tamr-master" | ||
| password = "foo" #tfsec:ignore:GEN003 | ||
| username = "exampleUsername" | ||
| password = "examplePassword" #tfsec:ignore:GEN003 | ||
|
|
||
| vpc_id = var.vpc_id | ||
| subnet_group_name = "example_subnet_group" | ||
| # Network requirement: DB subnet group needs a subnet in at least two Availability Zones | ||
| rds_subnet_ids = var.subnet_ids | ||
| ingress_sg_ids = var.ingress_sg_ids | ||
| security_group_ids = module.rds-postgres-sg.security_group_ids | ||
| } | ||
|
|
||
| module "sg-ports" { | ||
| # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git//modules/rds-postgres-ports?ref=2.0.0" | ||
| source = "../../modules/rds-postgres-ports" | ||
| } | ||
|
|
||
| module "rds-postgres-sg" { | ||
| source = "git::git@github.com:Datatamer/terraform-aws-security-groups.git?ref=1.0.0" | ||
| vpc_id = var.vpc_id | ||
| ingress_cidr_blocks = var.ingress_cidr_blocks | ||
| egress_cidr_blocks = var.egress_cidr_blocks | ||
| ingress_ports = module.sg-ports.ingress_ports | ||
| sg_name_prefix = var.name_prefix | ||
| egress_protocol = "all" | ||
| ingress_protocol = "tcp" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| output "ingress_ports" { | ||
| value = module.sg-ports | ||
| description = "List of ingress ports" | ||
| } | ||
pkuber-tamr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| output "rds" { | ||
| value = module.rds_postgres | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Tamr AWS RDS Postgres Ports Module | ||
| This module returns a list of ports used by the RDS Postgres Service. | ||
|
|
||
| # Examples | ||
| ## Basic | ||
| 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//modules/rds-postgres-ports?ref=2.0.0" | ||
| } | ||
| ``` | ||
|
|
||
| # Resources Created | ||
| This module creates no resources. | ||
|
|
||
| <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| No provider. | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | additional\_ports | Additional ports to add to the output of this module | `list(number)` | `[]` | no | | ||
| | ports | Ports used by RDS Postgres | `list(number)` | <pre>[<br> 5432<br>]</pre> | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | ingress\_ports | List of ingress ports | | ||
|
|
||
| <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
|
|
||
| # References | ||
| This repo is based on: | ||
| * [terraform standard module structure](https://www.terraform.io/docs/modules/index.html#standard-module-structure) | ||
| * [templated terraform module](https://github.com/tmknom/template-terraform-module) | ||
|
|
||
| # License | ||
| Apache 2 Licensed. See LICENSE for full details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| output "ingress_ports" { | ||
| value = concat( | ||
| var.ports, | ||
| var.additional_ports, | ||
| ) | ||
| description = "List of ingress ports" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| variable "ports" { | ||
| type = list(number) | ||
| description = "Ports used by RDS Postgres" | ||
| default = [ | ||
| 5432 | ||
| ] | ||
| } | ||
|
|
||
| variable "additional_ports" { | ||
| type = list(number) | ||
| description = "Additional ports to add to the output of this module" | ||
| default = [] | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Now that you have a var.name-prefix you could probably include it in some of these fields in place of
exampleThere 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.
True but the limitation with username is that is does not accept any '-'s so while setting the name-prefix, we need to be mindful of that otherwise the apply would fail. Else we would need to massage the string to remove any special characters.