Skip to content
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

AWS Aurora MySQL and PostgreSQL modules #7

Merged
merged 7 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-mysql-kinesis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An AWS account asset will need to be onboarded to your DSF hub prior to using th
| Name | Source | Version |
|------|--------|---------|
| <a name="module_aws-aurora-mysql-kinesis"></a> [aws-aurora-mysql-kinesis](#module\_aws-aurora-mysql-kinesis) | ../../modules/onboard-aws-rds-aurora-mysql-kinesis | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | ../../modules/dsfhub-aws-cloud-account | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account | n/a |

## Inputs

Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-mysql-kinesis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ provider "dsfhub" {
################################################################################
# 1. AWS cloud account
module "aws-default-account-asset" {
source = "../../modules/dsfhub-aws-cloud-account"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave these paths (and probably correct the existing ones) as relative file paths so that we know the automated validation is checking things against our local changes, and not just downloading working copies from the registry. What do you think?

source = "imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account"

admin_email = local.admin_email
asset_display_name = "aws-account-asset"
Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-mysql-slowquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An AWS account asset will need to be onboarded to your DSF hub prior to using th
| Name | Source | Version |
|------|--------|---------|
| <a name="module_aws-aurora-mysql-slowquery"></a> [aws-aurora-mysql-slowquery](#module\_aws-aurora-mysql-slowquery) | ../../modules/onboard-aws-rds-aurora-mysql-slowquery | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | ../../modules/dsfhub-aws-cloud-account | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account | n/a |

## Inputs

Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-mysql-slowquery/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ provider "dsfhub" {
################################################################################

module "aws-default-account-asset" {
source = "../../modules/dsfhub-aws-cloud-account"
source = "imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account"

admin_email = local.admin_email
asset_display_name = "aws-account-asset"
Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An AWS account asset will need to be onboarded to your DSF hub prior to using th
| Name | Source | Version |
|------|--------|---------|
| <a name="module_aws-aurora-mysql"></a> [aws-aurora-mysql](#module\_aws-aurora-mysql) | ../../modules/onboard-aws-rds-aurora-mysql | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | ../../modules/dsfhub-aws-cloud-account | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account | n/a |

## Inputs

Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ provider "dsfhub" {
################################################################################

module "aws-default-account-asset" {
source = "../../modules/dsfhub-aws-cloud-account"
source = "imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account"

admin_email = local.admin_email
asset_display_name = "aws-account-asset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An AWS account asset will need to be onboarded to your DSF hub prior to using th
| Name | Source | Version |
|------|--------|---------|
| <a name="module_aws-aurora-postgresql-kinesis"></a> [aws-aurora-postgresql-kinesis](#module\_aws-aurora-postgresql-kinesis) | ../../modules/onboard-aws-rds-aurora-postgresql-kinesis | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | ../../modules/dsfhub-aws-cloud-account | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account | n/a |

## Inputs

Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-postgresql-kinesis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ provider "dsfhub" {
################################################################################
# 1. AWS cloud account
module "aws-default-account-asset" {
source = "../../modules/dsfhub-aws-cloud-account"
source = "imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account"

admin_email = local.admin_email
asset_display_name = "aws-account-asset"
Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Part of the onboarding process involves connecting to your Aurora PostgreSQL clu
| Name | Source | Version |
|------|--------|---------|
| <a name="module_aurora-postgresql"></a> [aurora-postgresql](#module\_aurora-postgresql) | ../../modules/onboard-aws-rds-aurora-postgresql | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | ../../modules/dsfhub-aws-cloud-account | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account | n/a |

## Resources

Expand Down
2 changes: 1 addition & 1 deletion examples/onboard-aws-rds-aurora-postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ provider "dsfhub" {
################################################################################
# 1. AWS cloud account
module "aws-default-account-asset" {
source = "../../modules/dsfhub-aws-cloud-account"
source = "imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account"

admin_email = local.admin_email
asset_display_name = "aws-account-asset"
Expand Down
8 changes: 6 additions & 2 deletions modules/aws-rds-cluster-activity-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ No requirements.
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
Expand All @@ -19,14 +23,14 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_engine_native_audit_fields_included"></a> [engine\_native\_audit\_fields\_included](#input\_engine\_native\_audit\_fields\_included) | Specifies whether the database activity stream includes engine-native audit fields. This option only applies to an Oracle DB instance. By default, no engine-native audit fields are included. | `string` | `null` | no |
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | The AWS KMS key identifier for encrypting messages in the database activity stream. The AWS KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. | `string` | n/a | yes |
| <a name="input_mode"></a> [mode](#input\_mode) | Specifies the mode of the database activity stream. Database events such as a change or access generate an activity stream event. The database session can handle these events either synchronously or asynchronously. One of: sync, async. | `string` | n/a | yes |
| <a name="input_resource_arn"></a> [resource\_arn](#input\_resource\_arn) | The Amazon Resource Name (ARN) of the DB cluster | `string` | n/a | yes |
| <a name="input_engine_native_audit_fields_included"></a> [engine\_native\_audit\_fields\_included](#input\_engine\_native\_audit\_fields\_included) | Specifies whether the database activity stream includes engine-native audit fields. This option only applies to an Oracle DB instance. By default, no engine-native audit fields are included. | `string` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_this"></a> [this](#output\_this) | RDS cluster activity stream |
| <a name="output_this"></a> [this](#output\_this) | RDS Cluster activity stream |
<!-- END_TF_DOCS -->
2 changes: 1 addition & 1 deletion modules/aws-rds-cluster-activity-stream/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ resource "aws_rds_cluster_activity_stream" "this" {
resource_arn = var.resource_arn
mode = var.mode
kms_key_id = var.kms_key_id
engine_native_audit_fields_included = var.engine_native_audit_fields_included # oracle specific
engine_native_audit_fields_included = var.engine_native_audit_fields_included # Oracle-specific
}
10 changes: 7 additions & 3 deletions modules/aws-rds-cluster-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ No requirements.
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
Expand All @@ -19,12 +23,12 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The name of the RDS cluster | `string` | n/a | yes |
| <a name="input_identifier"></a> [identifier](#input\_identifier) | The name of the aurora cluster instance | `string` | n/a | yes |
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is true | `bool` | `null` | no |
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The name of the RDS cluster | `string` | n/a | yes |
| <a name="input_db_engine"></a> [db\_engine](#input\_db\_engine) | Cluster engine e.g., aurora-mysql | `string` | `null` | no |
| <a name="input_db_instance_class"></a> [db\_instance\_class](#input\_db\_instance\_class) | The instance type of the RDS cluster. Example: 'db.t3.micro' | `string` | `null` | no |
| <a name="input_db_subnet_group_name"></a> [db\_subnet\_group\_name](#input\_db\_subnet\_group\_name) | Name of DB subnet group. DB instance will be created in the VPC associated with the DB subnet group. If unspecified, will be created in the default VPC, or in EC2 Classic, if available. | `string` | `null` | no |
| <a name="input_identifier"></a> [identifier](#input\_identifier) | The name of the aurora cluster instance | `string` | n/a | yes |
| <a name="input_maintenance_schedule"></a> [maintenance\_schedule](#input\_maintenance\_schedule) | Weekly time range during which system maintenance can occur, in (UTC). | `string` | `null` | no |
| <a name="input_minor_version_upgrade"></a> [minor\_version\_upgrade](#input\_minor\_version\_upgrade) | Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. | `bool` | `null` | no |
| <a name="input_publicly_accessible"></a> [publicly\_accessible](#input\_publicly\_accessible) | If instance is publicly accessible. Default false | `bool` | `null` | no |
Expand All @@ -33,5 +37,5 @@ No requirements.

| Name | Description |
|------|-------------|
| <a name="output_this"></a> [this](#output\_this) | aurora mysql cluster instance |
| <a name="output_this"></a> [this](#output\_this) | Aurora MySQL Cluster instance |
<!-- END_TF_DOCS -->
1 change: 0 additions & 1 deletion modules/aws-rds-cluster-instance/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resource "aws_rds_cluster_instance" "this" {

apply_immediately = var.apply_immediately
auto_minor_version_upgrade = var.minor_version_upgrade
cluster_identifier = var.cluster_id
Expand Down
6 changes: 5 additions & 1 deletion modules/aws-rds-cluster-parameter-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ No requirements.
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
Expand All @@ -19,9 +23,9 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_description"></a> [description](#input\_description) | The description of the DB cluster parameter group. | `string` | `null` | no |
| <a name="input_family"></a> [family](#input\_family) | The family of the DB cluster parameter group. | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | The name of the DB cluster parameter group | `string` | n/a | yes |
| <a name="input_description"></a> [description](#input\_description) | The description of the DB cluster parameter group. | `string` | `null` | no |
| <a name="input_parameters"></a> [parameters](#input\_parameters) | List of objects containing parameters for the DB cluster parameter group. | <pre>list(<br> object({<br> name = string<br> apply_method = optional(string, "immediate")<br> value = any<br> })<br> )</pre> | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resource. | `map(string)` | `null` | no |

Expand Down
12 changes: 8 additions & 4 deletions modules/aws-rds-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ No requirements.
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
Expand All @@ -19,14 +23,14 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The name of the RDS cluster | `string` | n/a | yes |
| <a name="input_db_master_password"></a> [db\_master\_password](#input\_db\_master\_password) | Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Cannot be set if manage\_master\_user\_password is set to true | `string` | n/a | yes |
| <a name="input_db_master_username"></a> [db\_master\_username](#input\_db\_master\_username) | Username for the master DB user, must not use rdsadmin as that is reserved. | `string` | n/a | yes |
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is true | `bool` | `null` | no |
| <a name="input_backup_retention"></a> [backup\_retention](#input\_backup\_retention) | Days to retain backups for, Default is 1 day. | `number` | `null` | no |
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The name of the RDS cluster | `string` | n/a | yes |
| <a name="input_db_enabled_cloudwatch_logs_exports"></a> [db\_enabled\_cloudwatch\_logs\_exports](#input\_db\_enabled\_cloudwatch\_logs\_exports) | Set of log types to enable for exporting to CloudWatch logs. Valid values: audit, error, general, slowquery. | `list(any)` | `null` | no |
| <a name="input_db_engine"></a> [db\_engine](#input\_db\_engine) | Cluster engine e.g., aurora-mysql | `string` | `null` | no |
| <a name="input_db_engine_version"></a> [db\_engine\_version](#input\_db\_engine\_version) | Database engine version, e.g., 8.0.mysql\_aurora.3.05.1 | `string` | `null` | no |
| <a name="input_db_master_password"></a> [db\_master\_password](#input\_db\_master\_password) | Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Cannot be set if manage\_master\_user\_password is set to true | `string` | n/a | yes |
| <a name="input_db_master_username"></a> [db\_master\_username](#input\_db\_master\_username) | Username for the master DB user, must not use rdsadmin as that is reserved. | `string` | n/a | yes |
| <a name="input_db_port"></a> [db\_port](#input\_db\_port) | Port on which the DB accepts connections. | `number` | `null` | no |
| <a name="input_db_subnet_group_name"></a> [db\_subnet\_group\_name](#input\_db\_subnet\_group\_name) | Name of DB subnet group. DB instance will be created in the VPC associated with the DB subnet group. If unspecified, will be created in the default VPC, or in EC2 Classic, if available. | `string` | `null` | no |
| <a name="input_final_snapshot"></a> [final\_snapshot](#input\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from final\_snapshot\_identifier. Default is false | `bool` | `null` | no |
Expand All @@ -39,5 +43,5 @@ No requirements.

| Name | Description |
|------|-------------|
| <a name="output_this"></a> [this](#output\_this) | Aurora Mysql cluster |
| <a name="output_this"></a> [this](#output\_this) | Aurora MySQL cluster |
<!-- END_TF_DOCS -->
34 changes: 13 additions & 21 deletions modules/aws-rds-cluster/main.tf
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
resource "aws_rds_cluster" "this" {

# Cluster settings
cluster_identifier = var.cluster_id
engine = var.db_engine
engine_version = var.db_engine_version
port = var.db_port
backup_retention_period = var.backup_retention
preferred_maintenance_window = var.maintenance_schedule
skip_final_snapshot = var.final_snapshot

# credentials
master_username = var.db_master_username
master_password = var.db_master_password

# network
network_type = var.network_type
db_subnet_group_name = var.db_subnet_group_name
vpc_security_group_ids = var.vpc_security_group_ids

# audit
apply_immediately = var.apply_immediately
backup_retention_period = var.backup_retention
cluster_identifier = var.cluster_id
enabled_cloudwatch_logs_exports = var.db_enabled_cloudwatch_logs_exports
engine = var.db_engine
engine_version = var.db_engine_version
master_password = var.db_master_password
master_username = var.db_master_username
port = var.db_port
db_subnet_group_name = var.db_subnet_group_name
skip_final_snapshot = var.final_snapshot
preferred_maintenance_window = var.maintenance_schedule
db_cluster_parameter_group_name = var.parameter_group_name
apply_immediately = var.apply_immediately
network_type = var.network_type
vpc_security_group_ids = var.vpc_security_group_ids
}
Loading
Loading