- Mais recentes
- Mais votos
- Mais comentários
You mention that "the DB is set to public access". This means that the DNS Name of the database will resolve to a public IP address. Unfortunately, this means that the traffic will need to go out of the VPC and then back in again. It also means that the security groups cannot refer to each other, since this only permits access via private IP address.
For good security, you should not configure the database for 'public access'. The Lambda function will then resolve the database DNS Name to a private IP address, which should allow the connection.
So, you really have two options:
- Public database, Lambda function not connected to the VPC, security group permits access from entire Internet, or
- Private database, Lambda function connected to private subnet(s) of the same VPC as the RDS database, security group permits access from Lambda function's security group
Does your Lambda security group have an egress rule for port 5432? Can you post your Lambda code? It's not clear to me where "errorMessage" and its contents are coming from.
Conteúdo relevante
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 2 meses