-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/update private endpoint #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/update private endpoint #3
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: payasam-raghuramakrishna-nttd <340229@nttdata.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds private endpoint functionality to a PostgreSQL module, allowing the service to be accessed through private connectivity instead of public endpoints.
- Introduces new variables for configuring private endpoint settings including subnet ID, DNS zones, and connection parameters
- Adds a new private endpoint module instance that conditionally creates when public network access is disabled
- Creates a locals.tf file to manage resource naming and tagging for private endpoint resources
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.
File | Description |
---|---|
variables.tf | Adds variables for private endpoint configuration including subnet, DNS zones, and connection settings |
main.tf | Implements private endpoint module instantiation with conditional creation logic |
locals.tf | Defines local values for private endpoint resource naming and tagging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
"provisioner" = "terraform" | ||
} | ||
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | ||
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint name is hardcoded. This should be generated dynamically or made configurable to avoid conflicts when the module is used multiple times or in different environments.
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" | |
endpoint_name = var.endpoint_name | |
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | |
private_service_connection_name = "${local.endpoint_name}-psc" | |
default_tags = { | |
"provisioner" = "terraform" | |
} |
Copilot uses AI. Check for mistakes.
"provisioner" = "terraform" | ||
} | ||
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | ||
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is duplicated and will cause a Terraform configuration error. The same local value 'private_endpoint_tags' is defined multiple times.
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" | |
endpoint_name = var.endpoint_name | |
default_tags = { | |
"provisioner" = "terraform" | |
} | |
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | |
private_service_connection_name = "${local.endpoint_name}-psc" |
Copilot uses AI. Check for mistakes.
"provisioner" = "terraform" | ||
} | ||
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | ||
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line redefines 'endpoint_name' but references 'var.endpoint_name' which doesn't exist in the variables.tf file. This will cause a Terraform validation error.
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" | |
default_tags = { | |
"provisioner" = "terraform" | |
} | |
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | |
private_service_connection_name = "${local.endpoint_name}-psc" |
Copilot uses AI. Check for mistakes.
"provisioner" = "terraform" | ||
} | ||
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | ||
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'default_tags' local value definition is malformed and duplicated, missing proper block structure. This will cause a syntax error.
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" | |
default_tags = { | |
provisioner = "terraform" | |
} | |
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | |
private_service_connection_name = "${local.endpoint_name}-psc" |
Copilot uses AI. Check for mistakes.
"provisioner" = "terraform" | ||
} | ||
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | ||
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The private service connection name is hardcoded. This should be generated dynamically based on the endpoint name to maintain consistency and avoid conflicts.
private_service_connection_name = "hygtmp-sandbox-004-neu-postgresql-001-psc" | |
private_service_connection_name = "${local.endpoint_name}-psc" |
Copilot uses AI. Check for mistakes.
variable "private_dns_zone_group_name" { | ||
description = "Specifies the Name of the Private DNS Zone Group." | ||
type = string | ||
default = "vault" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value 'vault' is incorrect for a PostgreSQL private endpoint. It should be 'postgresqlServer' according to Azure documentation for PostgreSQL subresources.
default = "vault" | |
default = "postgresqlServer" |
Copilot uses AI. Check for mistakes.
https://docs.microsoft.com/azure/private-link/private-endpoint-overview#private-link-resource | ||
EOT | ||
type = list(string) | ||
default = ["vault"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default subresource name 'vault' is incorrect for PostgreSQL. It should be 'postgresqlServer' for Azure Database for PostgreSQL.
default = ["vault"] | |
default = ["postgresqlServer"] |
Copilot uses AI. Check for mistakes.
No description provided.