Closed Joonalai closed 2 years ago
While at it, fix the conflict between lb security group and security group rule resources. Causes recreating/destroying resources between runs.
From https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule
Terraform currently provides both a standalone Security Group Rule resource (a single ingress or egress rule), and a Security Group resource with ingress and egress rules defined in-line. At this time you cannot use a Security Group with in-line rules in conjunction with any Security Group Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.
Lambda needs VPC connections:
https://www.maxivanov.io/deploy-aws-lambda-to-vpc-with-terraform/
VPC and security group rules implemented. DB can only be accessed from the ec2 instance in the same VPC.
Some examples:
Useful links: