-
Notifications
You must be signed in to change notification settings - Fork 1
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
[GDB-10856] Added External AGW and context path support #91
Changes from 10 commits
95f9d83
92497fb
9e37766
e356d10
7365cba
137b501
07de5bd
81d79fb
68e72ff
c7980ef
9469dfa
0010028
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 |
---|---|---|
|
@@ -48,6 +48,11 @@ terraform.rc | |
*.pem | ||
*.p12 | ||
*.pub | ||
*.pfx | ||
*.crt | ||
|
||
#Licenses | ||
*.license | ||
|
||
#Private key | ||
*.key |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,12 +135,14 @@ az vm image terms accept --offer graphdb-ee --plan graphdb-byol --publisher onto | |
| gateway\_global\_request\_buffering\_enabled | Whether Application Gateway's Request buffer is enabled. | `bool` | `true` | no | | ||
| gateway\_global\_response\_buffering\_enabled | Whether Application Gateway's Response buffer is enabled. | `bool` | `true` | no | | ||
| gateway\_enable\_private\_access | Enable or disable private access to the application gateway | `bool` | `false` | no | | ||
| disable\_agw | Disables the creation of Application Gateway by the Terraform module. | `bool` | `false` | no | | ||
| gateway\_enable\_private\_link\_service | Set to true to enable Private Link service, false to disable it. | `bool` | `false` | no | | ||
| gateway\_private\_link\_service\_network\_policies\_enabled | Enable or disable private link service network policies | `string` | `false` | no | | ||
| gateway\_backend\_port | Backend port for the Application Gateway rules | `number` | `7201` | no | | ||
| gateway\_probe\_interval | Interval in seconds between the health probe checks | `number` | `10` | no | | ||
| gateway\_probe\_timeout | Timeout in seconds for the health probe checks | `number` | `1` | no | | ||
| gateway\_probe\_threshold | Number of consecutive health checks to consider the probe passing or failing | `number` | `2` | no | | ||
| context\_path | The context path for the Application Gateway. | `string` | `""` | no | | ||
| tls\_certificate\_path | Path to a TLS certificate that will be imported in Azure Key Vault and used in the Application Gateway TLS listener for GraphDB. Either tls\_certificate\_path or tls\_certificate\_id must be provided. | `string` | `null` | no | | ||
| tls\_certificate\_password | TLS certificate password for password-protected certificates. | `string` | `null` | no | | ||
| tls\_certificate\_id | Resource identifier for a TLS certificate secret from a Key Vault. Overrides tls\_certificate\_path. Either tls\_certificate\_id or tls\_certificate\_path must be provided. | `string` | `null` | no | | ||
|
@@ -368,6 +370,45 @@ To deploy in already existing Resource Group and Virtual Network you just need t | |
resource_group_name = "existing_rg" | ||
virtual_network_name = "existing_vnet" | ||
``` | ||
**Deploying GraphDB with External Application Gateway and Custom Context Path** | ||
|
||
You can deploy GraphDB without creating a new Application Gateway, allowing you to use your existing one. Additionally, you can configure a custom context path for your application. To do this, follow these steps: | ||
|
||
**_Prerequisites_**: | ||
- *Resource Group*: A resource group should already be created. | ||
- *Virtual Network*: A Virtual Network (VNet) should be set up and ready. | ||
- *Application Gateway*: Ensure your Application Gateway is deployed and fully operational. | ||
|
||
_Example Configuration:_ | ||
```hcl | ||
context_path = "/graphdb" | ||
disable_agw = true | ||
virtual_network_name = "your-VNet" | ||
resource_group_name = "your-resource-group" | ||
graphdb_external_address_fqdn = "your-fqdn-or-ip" | ||
``` | ||
|
||
_Notes_: | ||
- Setting `disable_agw` to true allows you to use your existing Application Gateway. | ||
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. Reword this, Setting |
||
- When using `disable_agw` you need to set `graphdb_external_adress_fqdn` as well. | ||
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. When using |
||
- The `context_path` variable sets the custom context path for your application. | ||
|
||
**_Post-Deployment Actions_**: | ||
After applying the Terraform code, you must perform the following steps: | ||
|
||
**1.** Configure the Application Gateway: | ||
- Path-Based Routing Rule: Set up a path-based routing rule on your Application Gateway to listen to the same context path. For example, if `context_path = "/graphdb"`, the path-based rule should be `/graphdb/*`. | ||
|
||
_Note_: | ||
- You can use your External Application Gateway without the context path. | ||
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. External should be with lower case |
||
|
||
**2.** Add VMs or VMSS to Backend Pool: | ||
- Manually add your Virtual Machine Scale Sets (VMSS) to the Application Gateway’s backend pool as targets. | ||
|
||
**3.** Upgrade VM Instances: | ||
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. Upgrade VMSS Instances 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 not is still valid |
||
- After assigning the VMSS to the backend pool and verifying that the Application Gateway can access the VMSS, upgrade your VM instances to the latest model or version. This is essential for the Application Gateway to identify them as valid targets within the backend pool. | ||
**4.** Network Security Group (NSG) Configuration: | ||
- Configure NSG rules to allow traffic between the Application Gateway and the VMSS, ensuring the necessary access is in place. | ||
|
||
## Local Development | ||
|
||
|
@@ -391,8 +432,6 @@ Here is the procedure for migrating your single node deployment to cluster e.g., | |
4. Validate the import is successful by checking the `terraform.tfstate` file, should contain `azurerm_managed_disk` | ||
resource with the name of the disk you've imported. | ||
5. Run `terraform plan` and review the plan carefully if everything seems fine run `terraform apply` | ||
|
||
|
||
## Release History | ||
|
||
All notable changes between version are tracked and documented at [CHANGELOG.md](CHANGELOG.md). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,8 @@ module "tls" { | |
module "application_gateway" { | ||
source = "./modules/gateway" | ||
|
||
count = var.disable_agw ? 0 : 1 | ||
|
||
resource_name_prefix = var.resource_name_prefix | ||
location = var.location | ||
resource_group_name = local.resource_group_name | ||
|
@@ -179,6 +181,9 @@ module "application_gateway" { | |
# Public / Private toggle | ||
gateway_enable_private_access = var.gateway_enable_private_access | ||
|
||
disable_agw = var.disable_agw | ||
context_path = var.context_path | ||
|
||
# TLS | ||
gateway_tls_certificate_secret_id = var.tls_certificate_id != null ? var.tls_certificate_id : module.tls[0].tls_certificate_id | ||
gateway_tls_certificate_identity_id = var.tls_certificate_id != null ? var.tls_certificate_identity_id : module.tls[0].tls_identity_id | ||
|
@@ -222,10 +227,11 @@ module "monitoring" { | |
location = var.location | ||
node_count = var.node_count | ||
|
||
web_test_availability_request_url = module.application_gateway.public_ip_address_fqdn | ||
web_test_availability_request_url = var.disable_agw ? var.graphdb_external_address_fqdn : module.application_gateway[0].public_ip_address_fqdn | ||
web_test_geo_locations = var.web_test_geo_locations | ||
web_test_ssl_check_enabled = var.web_test_ssl_check_enabled | ||
graphdb_external_address_fqdn = var.graphdb_external_address_fqdn != null ? var.graphdb_external_address_fqdn : module.application_gateway.public_ip_address_fqdn | ||
|
||
graphdb_external_address_fqdn = var.graphdb_external_address_fqdn != null ? var.graphdb_external_address_fqdn : module.application_gateway[0].public_ip_address_fqdn | ||
|
||
monitor_reader_principal_id = var.monitor_reader_principal_id | ||
|
||
|
@@ -270,14 +276,16 @@ module "graphdb" { | |
graphdb_outbound_address_prefixes = var.outbound_allowed_address_prefixes | ||
|
||
# Gateway | ||
application_gateway_backend_address_pool_ids = [module.application_gateway.gateway_backend_address_pool_id] | ||
application_gateway_backend_address_pool_ids = var.disable_agw ? [] : [module.application_gateway[0].gateway_backend_address_pool_id] | ||
|
||
context_path = var.context_path | ||
|
||
# App Configuration | ||
app_configuration_id = module.appconfig.app_configuration_id | ||
app_configuration_endpoint = module.appconfig.app_configuration_endpoint | ||
|
||
# GraphDB Configurations | ||
graphdb_external_address_fqdn = var.graphdb_external_address_fqdn != null ? var.graphdb_external_address_fqdn : module.application_gateway.public_ip_address_fqdn | ||
graphdb_external_address_fqdn = var.graphdb_external_address_fqdn != null ? var.graphdb_external_address_fqdn : (var.disable_agw ? null : module.application_gateway[0].public_ip_address_fqdn) | ||
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. How does the 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 comment is still valid 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. When disabled_agw is true, I have added new validations (will push soon). It uses the Frontend public IP address of the external Application Gateway. It also adds the context path if there is one. 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. I think this will produce wrong 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. Yes, external fdqn variable is needed. I will add a note that it is required when 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. I still want to see the outputted |
||
graphdb_password = var.graphdb_password | ||
graphdb_license_path = var.graphdb_license_path | ||
graphdb_cluster_token = var.graphdb_cluster_token | ||
|
@@ -317,5 +325,7 @@ module "graphdb" { | |
appi_connection_string = var.deploy_monitoring ? module.monitoring[0].appi_connection_string : "" | ||
|
||
# Wait for the configurations to be created in the App Configuration store | ||
disable_agw = var.disable_agw | ||
|
||
depends_on = [module.appconfig] | ||
} |
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.
These updates should not be here if you rebased properly, also you need to update the Changelog with your changes
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 is still valid
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 is still valid.
Also you need to add a new version with your changes to the CHANGELOG.md