diff --git a/README.md b/README.md index da3cd80..a6bf8f1 100644 --- a/README.md +++ b/README.md @@ -339,6 +339,7 @@ No modules. | [security\_group\_description](#input\_security\_group\_description) | The description of the security group. If value is set to empty string it will contain cluster name in the description | `string` | `null` | no | | [security\_group\_egress\_rules](#input\_security\_group\_egress\_rules) | A map of security group egress rule defintions to add to the security group created | `map(any)` | `{}` | no | | [security\_group\_tags](#input\_security\_group\_tags) | Additional tags for the security group | `map(string)` | `{}` | no | +| [security\_group\_use\_name\_prefix](#input\_security\_group\_use\_name\_prefix) | Determines whether the security group name (`name`) is used as a prefix | `bool` | `true` | no | | [serverlessv2\_scaling\_configuration](#input\_serverlessv2\_scaling\_configuration) | Map of nested attributes with serverless v2 scaling properties. Only valid when `engine_mode` is set to `provisioned` | `map(string)` | `{}` | no | | [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final snapshot is created before the cluster is deleted. If true is specified, no snapshot is created | `bool` | `null` | no | | [snapshot\_identifier](#input\_snapshot\_identifier) | Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot | `string` | `null` | no | diff --git a/examples/mysql/main.tf b/examples/mysql/main.tf index 21c54a3..7c99974 100644 --- a/examples/mysql/main.tf +++ b/examples/mysql/main.tf @@ -80,6 +80,8 @@ module "aurora" { db_cluster_parameter_group_name = aws_rds_cluster_parameter_group.example.id enabled_cloudwatch_logs_exports = ["audit", "error", "general", "slowquery"] + security_group_use_name_prefix = false + tags = local.tags } diff --git a/main.tf b/main.tf index 665b5b9..93ce6df 100644 --- a/main.tf +++ b/main.tf @@ -294,7 +294,8 @@ resource "aws_appautoscaling_policy" "this" { resource "aws_security_group" "this" { count = local.create_cluster && var.create_security_group ? 1 : 0 - name_prefix = "${var.name}-" + name = var.security_group_use_name_prefix ? null : var.name + name_prefix = var.security_group_use_name_prefix ? "${var.name}-" : null vpc_id = var.vpc_id description = coalesce(var.security_group_description, "Control traffic to/from RDS Aurora ${var.name}") diff --git a/variables.tf b/variables.tf index 27208fd..f474d43 100644 --- a/variables.tf +++ b/variables.tf @@ -510,6 +510,12 @@ variable "security_group_egress_rules" { default = {} } +variable "security_group_use_name_prefix" { + description = "Determines whether the security group name (`name`) is used as a prefix" + type = bool + default = true +} + variable "putin_khuylo" { description = "Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo!" type = bool