-
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?
Changes from all commits
834e624
08ad2a0
137a0c0
e3d7a44
aa8af35
d3795d4
c0a1034
0426610
f7c464b
f7a3e0a
bdde02a
b8a819b
24b23a0
2d66e8a
632fe33
48729ac
0cdcbff
51045c3
2dbfef4
d4f991d
42af6d1
18d578a
20c9b48
54d52df
56be0a8
fc820f6
45134ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,31 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# you may not use this file except in compliance with the License. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# You may obtain a copy of the License at | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Unless required by applicable law or agreed to in writing, software | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# See the License for the specific language governing permissions and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# limitations under the License. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Local values for resource names and tags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
locals { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resource_group_name = module.resource_names["resource_group"].standard | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
endpoint_name = "hygtmp-sandbox-004-neu-postgresql-001" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
private_endpoint_tags = merge({ resource_name = local.endpoint_name }, local.default_tags, var.tags) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
default_tags = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"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 commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -146,6 +146,56 @@ variable "delegated_subnet_id" { | |||||
type = string | ||||||
default = null | ||||||
} | ||||||
variable "subnet_id" { | ||||||
description = <<EOT | ||||||
The ID of the Subnet from which Private IP Addresses will be allocated for this Private Endpoint. | ||||||
Changing this forces a new resource to be created. | ||||||
EOT | ||||||
type = string | ||||||
default = null | ||||||
} | ||||||
|
||||||
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 commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
} | ||||||
|
||||||
|
||||||
variable "private_dns_zone_ids" { | ||||||
description = "A list of Private DNS Zone IDs to link with the Private Endpoint." | ||||||
type = list(string) | ||||||
default = [] | ||||||
} | ||||||
|
||||||
variable "is_manual_connection" { | ||||||
description = <<EOT | ||||||
Does the Private Endpoint require Manual Approval from the remote resource owner? Changing this forces a new resource | ||||||
to be created. | ||||||
EOT | ||||||
type = bool | ||||||
default = false | ||||||
} | ||||||
|
||||||
variable "subresource_names" { | ||||||
description = <<EOT | ||||||
A list of subresource names which the Private Endpoint is able to connect to. subresource_names corresponds to group_id. | ||||||
Possible values are detailed in the product documentation in the Subresources column. | ||||||
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 commentThe 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.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
} | ||||||
|
||||||
variable "request_message" { | ||||||
description = <<EOT | ||||||
A message passed to the owner of the remote resource when the private endpoint attempts to establish the connection | ||||||
to the remote resource. The request message can be a maximum of 140 characters in length. | ||||||
Only valid if `is_manual_connection=true` | ||||||
EOT | ||||||
type = string | ||||||
default = "" | ||||||
} | ||||||
|
||||||
variable "private_dns_zone_id" { | ||||||
description = "The ID of the private DNS zone. Required when `delegated_subnet_id` is set" | ||||||
|
@@ -339,4 +389,4 @@ variable "tags" { | |||||
description = "A mapping of tags to assign to the resource." | ||||||
type = map(string) | ||||||
default = {} | ||||||
} | ||||||
} |
Uh oh!
There was an error while loading. Please reload this page.