Here, the security group for PostgreSQL access is created: https://github.com/dspace-group/simphera-reference-architecture-aws/blob/cea4c7c8dcb60952895f494dbd351ed92e53cede/network.tf#L40C71-L40C111.
It seems that data.aws_vpc.preconfigured[0].cidr_block returns any CIDR of the preconfigured VPC, but not all of them. When a kubernetes node randomly uses an IP from the first CIDR and the postgresql database uses an IP from the second CIDR, the security group does not allow communication from the Kubernetes node to the Postgresql database.
Here, the security group for PostgreSQL access is created: https://github.com/dspace-group/simphera-reference-architecture-aws/blob/cea4c7c8dcb60952895f494dbd351ed92e53cede/network.tf#L40C71-L40C111.
It seems that
data.aws_vpc.preconfigured[0].cidr_blockreturns any CIDR of the preconfigured VPC, but not all of them. When a kubernetes node randomly uses an IP from the first CIDR and the postgresql database uses an IP from the second CIDR, the security group does not allow communication from the Kubernetes node to the Postgresql database.