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

RDS MsSQL source changes to terraform registry #75

Merged
merged 2 commits into from
Jan 26, 2023
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ The following table lists the released DSFKit versions, their release date and a
<td>1. Refactored directory structure. <br>2. Released to terraform registry. <br>3. Supported hub/gw on RedHat 7 ami. <br>4. Restricted permissions for Sonar installation. <br>5. Added the module's version to the examples.
</td>
</tr>
<tr>
<td>26 Jan 2023
</td>
<td>1.3.5
</td>
<td>1. Enable creating RDS MsSQL with synthetic data for POC purposes. <br>2. Fix manual and automatic installer machine deployments.
</td>
</tr>

</table>

Expand Down
11 changes: 5 additions & 6 deletions examples/poc/basic_deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ module "key_pair" {

data "aws_availability_zones" "available" { state = "available" }

data "aws_region" "current" {}

locals {
workstation_cidr_24 = [format("%s.0/24", regex("\\d*\\.\\d*\\.\\d*", module.globals.my_ip))]
}
Expand Down Expand Up @@ -139,7 +137,7 @@ module "rds_mysql" {
security_group_ingress_cidrs = local.workstation_cidr
}

module "db_onboarding" {
module "db_onboarding_mysql" {
for_each = { for idx, val in module.rds_mysql : idx => val }
source = "imperva/dsf-poc-db-onboarder/aws"
version = "1.3.5" # latest release tag
Expand Down Expand Up @@ -169,15 +167,16 @@ module "db_onboarding" {
# create a RDS SQL Server DB
module "rds_mssql" {
count = contains(var.db_types_to_onboard, "RDS MsSQL") ? 1 : 0
source = "../../../modules/aws/rds-mssql-db"
source = "imperva/dsf-poc-db-onboarder/aws//modules/rds-mssql-db"
version = "1.3.5" # latest release tag
rds_subnet_ids = module.vpc.public_subnets
security_group_ingress_cidrs = local.workstation_cidr
friendly_name = local.deployment_name_salted
}

module "db_onboarding_mssql" {
for_each = { for idx, val in module.rds_mssql : idx => val }
source = "imperva/dsf-poc-db-onboarder/aws"
version = "1.3.5" # latest release tag
sonar_version = module.globals.tarball_location.version
hub_info = {
hub_ip_address = module.hub.public_ip
Expand All @@ -199,7 +198,7 @@ module "db_onboarding_mssql" {
depends_on = [
module.federation,
module.rds_mssql,
module.db_onboarding
module.db_onboarding_mysql
]
}

Expand Down
8 changes: 4 additions & 4 deletions examples/poc/hadr_deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ module "rds_mysql" {
security_group_ingress_cidrs = local.workstation_cidr
}

module "db_onboarding" {
module "db_onboarding_mysql" {
for_each = { for idx, val in module.rds_mysql : idx => val }
source = "imperva/dsf-poc-db-onboarder/aws"
version = "1.3.5" # latest release tag
Expand Down Expand Up @@ -219,10 +219,10 @@ module "db_onboarding" {
# create a RDS SQL Server DB
module "rds_mssql" {
count = contains(var.db_types_to_onboard, "RDS MsSQL") ? 1 : 0
source = "../../../modules/aws/rds-mssql-db"
source = "imperva/dsf-poc-db-onboarder/aws//modules/rds-mssql-db"
version = "1.3.5" # latest release tag
rds_subnet_ids = module.vpc.public_subnets
security_group_ingress_cidrs = local.workstation_cidr
friendly_name = local.deployment_name_salted
}

module "db_onboarding_mssql" {
Expand Down Expand Up @@ -250,7 +250,7 @@ module "db_onboarding_mssql" {
depends_on = [
module.federation,
module.rds_mssql,
module.db_onboarding
module.db_onboarding_mysql
]
}

Expand Down
1 change: 0 additions & 1 deletion modules/aws/rds-mssql-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ module "rds_mssql" {
source = "imperva/dsf-poc-db-onboarder/aws//modules/rds-mssql-db"
rds_subnet_ids = "${aws_subnet.example.id}"
security_group_ingress_cidrs = "${aws_cidr.example}"
friendly_name = "${var.db_name}"
}
```

Expand Down
4 changes: 2 additions & 2 deletions modules/aws/rds-mssql-db/iam_role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

resource "aws_iam_role" "rds_db_og_role" {
name_prefix = replace("${local.db_identifier}-og-role", "_", "-")
description = replace("${local.db_identifier}-og-role-${var.friendly_name}", "_", "-")
description = replace("${local.db_identifier}-og-role", "_", "-")
managed_policy_arns = null
assume_role_policy = local.rds_db_og_role_assume_role_policy
inline_policy {
Expand All @@ -144,7 +144,7 @@ resource "aws_iam_instance_profile" "lambda_mssql_infra_instance_iam_profile" {
resource "aws_iam_role" "lambda_mssql_infra_role" {
count = var.role_arn != null ? 0 : 1
name_prefix = "imperva-mssql-infra-role"
description = "imperva-mssql-infra-role-${var.friendly_name}"
description = "imperva-mssql-infra-role"
managed_policy_arns = null
assume_role_policy = local.role_assume_role_policy
inline_policy {
Expand Down
9 changes: 0 additions & 9 deletions modules/aws/rds-mssql-db/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,3 @@ variable "role_arn" {
description = "IAM role to assign to the RDS SQL Server DB"
}

variable "friendly_name" {
type = string
default = "imperva-dsf-mssql"
description = "Friendly name, MsSQL Instance Name"
validation {
condition = length(var.friendly_name) > 3
error_message = "Deployment name must be at least 3 characters"
}
}