Skip to content

Commit

Permalink
fix: fixed depends_on handling for edge_cache_setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreSilveiraAzion committed Dec 31, 2024
1 parent ee8bea7 commit 22d2b19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/akamai/converter_cache_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ def create_cache_setting(azion_resources: AzionResource, rules: List[Dict[str, A
"type": "azion_edge_application_cache_setting",
"name": name,
"attributes": {
"cache_settings": cache_attributes,
"edge_application_id": f"azion_edge_application_main_setting.{main_setting_name}.edge_application.application_id",
"cache_settings": cache_attributes,
"depends_on": [f"azion_edge_application_main_setting.{main_setting_name}"],
},
}

Expand Down
3 changes: 2 additions & 1 deletion src/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ def write_cache_setting_block(f, resource: dict):

# Write cache setting resource block
write_indented(f, f'resource "azion_edge_application_cache_setting" "{name}" {{', 0)
write_indented(f, f'edge_application_id = azion_edge_application_main_setting.{name}.edge_application.application_id', 1)
write_indented(f, "cache_settings = {", 1)
write_indented(f, f'browser_cache_settings = "{validated_settings["browser_cache_settings"]}"', 2)
write_indented(
Expand All @@ -407,7 +408,7 @@ def write_cache_setting_block(f, resource: dict):
write_indented(f, f'cache_by_cookies = "{validated_settings["cache_by_cookies"]}"', 2)
write_indented(f, f'enable_stale_cache = {validated_settings["enable_stale_cache"]}', 2)
write_indented(f, "}", 1)
write_indented(f, f'edge_application_id = azion_edge_application_main_setting.{name}.edge_application.application_id', 1)
write_depends_on(f, resource.get("attributes", {}))
write_indented(f, "}", 0)
write_indented(f, "", 0)

Expand Down

0 comments on commit 22d2b19

Please sign in to comment.