generated from pagopa/terraform-infrastructure-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fix app service ha prod (#2177)
* prepared node-forwarder prod release, fix pdf engine app service * fix dns forwarder * wip * change rg * created node fw snet * enabled node forwarder ha uat * changed pdf engine resource group * prepared switch * fixed ha app service
- Loading branch information
Showing
22 changed files
with
160 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import re | ||
import argparse | ||
|
||
|
||
def get_target_from_file(file_path): | ||
with open(file_path, 'r') as file: | ||
content = file.read() | ||
|
||
# resource regex | ||
pattern_resource = r'resource\s+"([^"]+)"\s+"([^"]+)"' | ||
resources = re.findall(pattern_resource, content) | ||
|
||
# Regex per trovare i moduli | ||
pattern_module = r'module\s+"([^"]+)"' | ||
modules = re.findall(pattern_module, content) | ||
|
||
# generate target list | ||
target = [] | ||
for r_type, r_name in resources: | ||
target.append(f'"{r_type}.{r_name}"') | ||
for m_name in modules: | ||
target.append(f'"module.{m_name}"') | ||
|
||
return target | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Get target from terraform file') | ||
parser.add_argument('file_path', help='Path to tf file') | ||
args = parser.parse_args() | ||
|
||
target_list = get_target_from_file(args.file_path) | ||
|
||
# print all targets on a single line | ||
print(' '.join([f'-target={target}' for target in target_list])) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
data "azurerm_app_service" "node_forwarder_ha" { | ||
count = var.enabled_features.node_forwarder_ha ? 1 : 0 | ||
name = "${local.project}-${var.location_short}-core-app-node-forwarder-ha" | ||
resource_group_name = "${local.project}-node-forwarder-rg" | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.