Automatic security group creation
By default, the module creates one security group and associates it with the cluster:Core variables
Determines whether to create a security group for the RDS cluster.
ID of the VPC where the security group will be created. Required when
create_security_group is true.Name for the security group. Defaults to the module
name variable.When
true, the value of security_group_name is used as a name prefix, resulting in a unique name. When false, the exact name is used.Additional existing security groups to associate with the cluster, alongside any created by the module.
Ingress and egress rules
Usesecurity_group_ingress_rules and security_group_egress_rules to define traffic rules. Each is a map of rule objects keyed by an arbitrary name.
Ingress rule attributes
IPv4 CIDR block to allow traffic from.
IPv6 CIDR block to allow traffic from.
Human-readable description for the rule.
Start of the port range. Defaults to the cluster port when omitted (5432 for PostgreSQL, 3306 for MySQL).
End of the port range. Defaults to
from_port or the cluster port when omitted.IP protocol. Defaults to
tcp.ID of a managed prefix list to allow traffic from.
ID of another security group to allow traffic from. Use the special value
"self" to reference the security group created by this module.When
from_port and to_port are omitted, the module automatically resolves the correct database port: 5432 for aurora-postgresql/postgres engines, and 3306 for all other engines.Examples
- CIDR-based ingress
- Security group reference
Allow traffic from each private subnet CIDR in your VPC — the pattern used in the
autoscaling and postgresql examples:Network type
The network stack for the cluster. Valid values:
IPV4— IPv4 only (default behavior)DUAL— dual-stack (IPv4 and IPv6)
IAM database authentication
Enables IAM-based authentication to the database. When enabled, AWS IAM users and roles can authenticate to the database using an IAM token instead of a password.
Storage encryption
Storage encryption is enabled by default.Whether the DB cluster storage is encrypted. The default is
true.The ARN of a KMS key to use for storage encryption. When specified,
storage_encrypted must be true. If omitted, the default RDS KMS key (aws/rds) is used.
