Lambda Function (aws_lambda_function.check_rds_ip): The AWS Lambda function that checks the IP address of an RDS instance and updates the Network Load Balancer (NLB) target group if the IP address has changed.
Lambda IAM Role (aws_iam_role.lambda_execution_role): The IAM role that the Lambda function assumes when it is executed. This role provides the function with the necessary permissions to read RDS details and update the NLB target group.
Lambda IAM Role Policy (aws_iam_role_policy.lambda_execution_role_policy): The IAM policy attached to the Lambda execution role. This policy grants the necessary permissions to the role.
Lambda Function Event Source Mapping (aws_lambda_event_source_mapping.check_rds_ip_mapping): A mapping that triggers the Lambda function based on an EventBridge (CloudWatch Events) rule.
CloudWatch Event Rule (aws_cloudwatch_event_rule.every_five_minutes): A rule that triggers an event every five minutes.
CloudWatch Event Target (aws_cloudwatch_event_target.check_rds_ip_every_five_minutes): An event target that associates the CloudWatch Events rule with the Lambda function.
Lambda Permission (aws_lambda_permission.allow_cloudwatch_to_call_check_rds_ip): A permission that allows CloudWatch Events to invoke the Lambda function.
Adding a few things:
Lambda Function (
aws_lambda_function.check_rds_ip
): The AWS Lambda function that checks the IP address of an RDS instance and updates the Network Load Balancer (NLB) target group if the IP address has changed.Lambda IAM Role (
aws_iam_role.lambda_execution_role
): The IAM role that the Lambda function assumes when it is executed. This role provides the function with the necessary permissions to read RDS details and update the NLB target group.Lambda IAM Role Policy (
aws_iam_role_policy.lambda_execution_role_policy
): The IAM policy attached to the Lambda execution role. This policy grants the necessary permissions to the role.Lambda Function Event Source Mapping (
aws_lambda_event_source_mapping.check_rds_ip_mapping
): A mapping that triggers the Lambda function based on an EventBridge (CloudWatch Events) rule.CloudWatch Event Rule (
aws_cloudwatch_event_rule.every_five_minutes
): A rule that triggers an event every five minutes.CloudWatch Event Target (
aws_cloudwatch_event_target.check_rds_ip_every_five_minutes
): An event target that associates the CloudWatch Events rule with the Lambda function.Lambda Permission (
aws_lambda_permission.allow_cloudwatch_to_call_check_rds_ip
): A permission that allows CloudWatch Events to invoke the Lambda function.