From dd6e25329abdb26d1f9c0488ff24a960e8a45ce9 Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Thu, 14 Nov 2024 14:43:43 +1100 Subject: [PATCH] feat(grit): add patterns for ZT upgrades --- ...trust_namespace_renames_configuration.grit | 77 +++++++++++++++++++ ..._0_zero_trust_namespace_renames_state.grit | 77 +++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 .grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_configuration.grit create mode 100644 .grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_state.grit diff --git a/.grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_configuration.grit b/.grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_configuration.grit new file mode 100644 index 0000000000..86dbdbf1fa --- /dev/null +++ b/.grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_configuration.grit @@ -0,0 +1,77 @@ +engine marzano(0.1) +language hcl + +pattern cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_configuration() { + any { + `"cloudflare_access_application"` => `"clouflare_zero_trust_access_application"`, + `"cloudflare_access_ca_certificate"` => `"clouflare_zero_trust_access_short_lived_certificate"`, + `"cloudflare_access_custom_page"` => `"clouflare_zero_trust_access_custom_page"`, + `"cloudflare_access_group"` => `"clouflare_zero_trust_access_group"`, + `"cloudflare_access_identity_provider"` => `"clouflare_zero_trust_access_identity_provider"`, + `"cloudflare_access_keys_configuration"` => `"clouflare_zero_trust_access_key_configuration"`, + `"cloudflare_access_mutual_tls_certificate"` => `"clouflare_zero_trust_access_mtls_certificate"`, + `"cloudflare_access_mutual_tls_hostname_settings"` => `"clouflare_zero_trust_access_mtls_hostname_settings"`, + `"cloudflare_access_organization"` => `"clouflare_zero_trust_organization"`, + `"cloudflare_access_policy"` => `"clouflare_zero_trust_access_policy"`, + `"cloudflare_access_service_token"` => `"clouflare_zero_trust_access_service_token"`, + `"cloudflare_access_tag"` => `"clouflare_zero_trust_access_tag"`, + `"cloudflare_device_dex_test"` => `"clouflare_zero_trust_dex_test"`, + `"cloudflare_device_managed_networks"` => `"clouflare_zero_trust_device_managed_networks"`, + `"cloudflare_device_policy_certificates"` => `"clouflare_zero_trust_device_certificates"`, + `"cloudflare_device_posture_integration"` => `"clouflare_zero_trust_device_posture_integration"`, + `"cloudflare_device_posture_rule"` => `"clouflare_zero_trust_device_posture_rule"`, + `"cloudflare_device_settings_policy"` => `"clouflare_zero_trust_device_profiles"`, + `"cloudflare_dlp_profile"` => `"clouflare_zero_trust_dlp_profile"`, + `"cloudflare_dlp_custom_profile"` => `"clouflare_zero_trust_dlp_custom_profile"`, + `"cloudflare_dlp_predefined_profile"` => `"clouflare_zero_trust_dlp_predefined_profile"`, + `"cloudflare_fallback_domain"` => `"clouflare_zero_trust_local_domain_fallback"`, + `"cloudflare_risk_behavior"` => `"clouflare_zero_trust_risk_behavior"`, + `"cloudflare_split_tunnel"` => `"clouflare_zero_trust_split_tunnels"`, + `"cloudflare_teams_account"` => `"clouflare_zero_trust_gateway_settings"`, + `"cloudflare_teams_list"` => `"clouflare_zero_trust_list"`, + `"cloudflare_teams_location"` => `"clouflare_zero_trust_dns_location"`, + `"cloudflare_teams_proxy_endpoint"` => `"clouflare_zero_trust_gateway_proxy_endpoint"`, + `"cloudflare_teams_rule"` => `"clouflare_zero_trust_gateway_policy"`, + `"cloudflare_tunnel"` => `"clouflare_zero_trust_tunnel_cloudflared"`, + `"cloudflare_tunnel_config"` => `"clouflare_zero_trust_tunnel_cloudflared_config"`, + `"cloudflare_tunnel_route"` => `"clouflare_zero_trust_tunnel_route"`, + `"cloudflare_tunnel_virtual_network"` => `"clouflare_zero_trust_tunnel_virtual_network"`, + + // handle references + `cloudflare_access_application` => `clouflare_zero_trust_access_application`, + `cloudflare_access_ca_certificate` => `clouflare_zero_trust_access_short_lived_certificate`, + `cloudflare_access_custom_page` => `clouflare_zero_trust_access_custom_page`, + `cloudflare_access_group` => `clouflare_zero_trust_access_group`, + `cloudflare_access_identity_provider` => `clouflare_zero_trust_access_identity_provider`, + `cloudflare_access_keys_configuration` => `clouflare_zero_trust_access_key_configuration`, + `cloudflare_access_mutual_tls_certificate` => `clouflare_zero_trust_access_mtls_certificate`, + `cloudflare_access_mutual_tls_hostname_settings` => `clouflare_zero_trust_access_mtls_hostname_settings`, + `cloudflare_access_organization` => `clouflare_zero_trust_organization`, + `cloudflare_access_policy` => `clouflare_zero_trust_access_policy`, + `cloudflare_access_service_token` => `clouflare_zero_trust_access_service_token`, + `cloudflare_access_tag` => `clouflare_zero_trust_access_tag`, + `cloudflare_device_dex_test` => `clouflare_zero_trust_dex_test`, + `cloudflare_device_managed_networks` => `clouflare_zero_trust_device_managed_networks`, + `cloudflare_device_policy_certificates` => `clouflare_zero_trust_device_certificates`, + `cloudflare_device_posture_integration` => `clouflare_zero_trust_device_posture_integration`, + `cloudflare_device_posture_rule` => `clouflare_zero_trust_device_posture_rule`, + `cloudflare_device_settings_policy` => `clouflare_zero_trust_device_profiles`, + `cloudflare_dlp_profile` => `clouflare_zero_trust_dlp_profile`, + `cloudflare_dlp_custom_profile` => `clouflare_zero_trust_dlp_custom_profile`, + `cloudflare_dlp_predefined_profile` => `clouflare_zero_trust_dlp_predefined_profile`, + `cloudflare_fallback_domain` => `clouflare_zero_trust_local_domain_fallback`, + `cloudflare_risk_behavior` => `clouflare_zero_trust_risk_behavior`, + `cloudflare_split_tunnel` => `clouflare_zero_trust_split_tunnels`, + `cloudflare_teams_account` => `clouflare_zero_trust_gateway_settings`, + `cloudflare_teams_list` => `clouflare_zero_trust_list`, + `cloudflare_teams_location` => `clouflare_zero_trust_dns_location`, + `cloudflare_teams_proxy_endpoint` => `clouflare_zero_trust_gateway_proxy_endpoint`, + `cloudflare_teams_rule` => `clouflare_zero_trust_gateway_policy`, + `cloudflare_tunnel` => `clouflare_zero_trust_tunnel_cloudflared`, + `cloudflare_tunnel_config` => `clouflare_zero_trust_tunnel_cloudflared_config`, + `cloudflare_tunnel_route` => `clouflare_zero_trust_tunnel_route`, + `cloudflare_tunnel_virtual_network` => `clouflare_zero_trust_tunnel_virtual_network`, + } +} + +cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_configuration() diff --git a/.grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_state.grit b/.grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_state.grit new file mode 100644 index 0000000000..22336d214a --- /dev/null +++ b/.grit/patterns/cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_state.grit @@ -0,0 +1,77 @@ +engine marzano(0.1) +language json + +pattern cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_state() { + any { + `"cloudflare_access_application"` => `"clouflare_zero_trust_access_application"`, + `"cloudflare_access_ca_certificate"` => `"clouflare_zero_trust_access_short_lived_certificate"`, + `"cloudflare_access_custom_page"` => `"clouflare_zero_trust_access_custom_page"`, + `"cloudflare_access_group"` => `"clouflare_zero_trust_access_group"`, + `"cloudflare_access_identity_provider"` => `"clouflare_zero_trust_access_identity_provider"`, + `"cloudflare_access_keys_configuration"` => `"clouflare_zero_trust_access_key_configuration"`, + `"cloudflare_access_mutual_tls_certificate"` => `"clouflare_zero_trust_access_mtls_certificate"`, + `"cloudflare_access_mutual_tls_hostname_settings"` => `"clouflare_zero_trust_access_mtls_hostname_settings"`, + `"cloudflare_access_organization"` => `"clouflare_zero_trust_organization"`, + `"cloudflare_access_policy"` => `"clouflare_zero_trust_access_policy"`, + `"cloudflare_access_service_token"` => `"clouflare_zero_trust_access_service_token"`, + `"cloudflare_access_tag"` => `"clouflare_zero_trust_access_tag"`, + `"cloudflare_device_dex_test"` => `"clouflare_zero_trust_dex_test"`, + `"cloudflare_device_managed_networks"` => `"clouflare_zero_trust_device_managed_networks"`, + `"cloudflare_device_policy_certificates"` => `"clouflare_zero_trust_device_certificates"`, + `"cloudflare_device_posture_integration"` => `"clouflare_zero_trust_device_posture_integration"`, + `"cloudflare_device_posture_rule"` => `"clouflare_zero_trust_device_posture_rule"`, + `"cloudflare_device_settings_policy"` => `"clouflare_zero_trust_device_profiles"`, + `"cloudflare_dlp_profile"` => `"clouflare_zero_trust_dlp_profile"`, + `"cloudflare_dlp_custom_profile"` => `"clouflare_zero_trust_dlp_custom_profile"`, + `"cloudflare_dlp_predefined_profile"` => `"clouflare_zero_trust_dlp_predefined_profile"`, + `"cloudflare_fallback_domain"` => `"clouflare_zero_trust_local_domain_fallback"`, + `"cloudflare_risk_behavior"` => `"clouflare_zero_trust_risk_behavior"`, + `"cloudflare_split_tunnel"` => `"clouflare_zero_trust_split_tunnels"`, + `"cloudflare_teams_account"` => `"clouflare_zero_trust_gateway_settings"`, + `"cloudflare_teams_list"` => `"clouflare_zero_trust_list"`, + `"cloudflare_teams_location"` => `"clouflare_zero_trust_dns_location"`, + `"cloudflare_teams_proxy_endpoint"` => `"clouflare_zero_trust_gateway_proxy_endpoint"`, + `"cloudflare_teams_rule"` => `"clouflare_zero_trust_gateway_policy"`, + `"cloudflare_tunnel"` => `"clouflare_zero_trust_tunnel_cloudflared"`, + `"cloudflare_tunnel_config"` => `"clouflare_zero_trust_tunnel_cloudflared_config"`, + `"cloudflare_tunnel_route"` => `"clouflare_zero_trust_tunnel_route"`, + `"cloudflare_tunnel_virtual_network"` => `"clouflare_zero_trust_tunnel_virtual_network"`, + + // handle dependencies + `"cloudflare_access_application.$dep"` => `"clouflare_zero_trust_access_application.$dep"`, + `"cloudflare_access_ca_certificate.$dep"` => `"clouflare_zero_trust_access_short_lived_certificate.$dep"`, + `"cloudflare_access_custom_page.$dep"` => `"clouflare_zero_trust_access_custom_page.$dep"`, + `"cloudflare_access_group.$dep"` => `"clouflare_zero_trust_access_group.$dep"`, + `"cloudflare_access_identity_provider.$dep"` => `"clouflare_zero_trust_access_identity_provider.$dep"`, + `"cloudflare_access_keys_configuration.$dep"` => `"clouflare_zero_trust_access_key_configuration.$dep"`, + `"cloudflare_access_mutual_tls_certificate.$dep"` => `"clouflare_zero_trust_access_mtls_certificate.$dep"`, + `"cloudflare_access_mutual_tls_hostname_settings.$dep"` => `"clouflare_zero_trust_access_mtls_hostname_settings.$dep"`, + `"cloudflare_access_organization.$dep"` => `"clouflare_zero_trust_organization.$dep"`, + `"cloudflare_access_policy.$dep"` => `"clouflare_zero_trust_access_policy.$dep"`, + `"cloudflare_access_service_token.$dep"` => `"clouflare_zero_trust_access_service_token.$dep"`, + `"cloudflare_access_tag.$dep"` => `"clouflare_zero_trust_access_tag.$dep"`, + `"cloudflare_device_dex_test.$dep"` => `"clouflare_zero_trust_dex_test.$dep"`, + `"cloudflare_device_managed_networks.$dep"` => `"clouflare_zero_trust_device_managed_networks.$dep"`, + `"cloudflare_device_policy_certificates.$dep"` => `"clouflare_zero_trust_device_certificates.$dep"`, + `"cloudflare_device_posture_integration.$dep"` => `"clouflare_zero_trust_device_posture_integration.$dep"`, + `"cloudflare_device_posture_rule.$dep"` => `"clouflare_zero_trust_device_posture_rule.$dep"`, + `"cloudflare_device_settings_policy.$dep"` => `"clouflare_zero_trust_device_profiles.$dep"`, + `"cloudflare_dlp_profile.$dep"` => `"clouflare_zero_trust_dlp_profile.$dep"`, + `"cloudflare_dlp_custom_profile.$dep"` => `"clouflare_zero_trust_dlp_custom_profile.$dep"`, + `"cloudflare_dlp_predefined_profile.$dep"` => `"clouflare_zero_trust_dlp_predefined_profile.$dep"`, + `"cloudflare_fallback_domain.$dep"` => `"clouflare_zero_trust_local_domain_fallback.$dep"`, + `"cloudflare_risk_behavior.$dep"` => `"clouflare_zero_trust_risk_behavior.$dep"`, + `"cloudflare_split_tunnel.$dep"` => `"clouflare_zero_trust_split_tunnels.$dep"`, + `"cloudflare_teams_account.$dep"` => `"clouflare_zero_trust_gateway_settings.$dep"`, + `"cloudflare_teams_list.$dep"` => `"clouflare_zero_trust_list.$dep"`, + `"cloudflare_teams_location.$dep"` => `"clouflare_zero_trust_dns_location.$dep"`, + `"cloudflare_teams_proxy_endpoint.$dep"` => `"clouflare_zero_trust_gateway_proxy_endpoint.$dep"`, + `"cloudflare_teams_rule.$dep"` => `"clouflare_zero_trust_gateway_policy.$dep"`, + `"cloudflare_tunnel.$dep"` => `"clouflare_zero_trust_tunnel_cloudflared.$dep"`, + `"cloudflare_tunnel_config.$dep"` => `"clouflare_zero_trust_tunnel_cloudflared_config.$dep"`, + `"cloudflare_tunnel_route.$dep"` => `"clouflare_zero_trust_tunnel_route.$dep"`, + `"cloudflare_tunnel_virtual_network.$dep"` => `"clouflare_zero_trust_tunnel_virtual_network.$dep"`, + } +} + +cloudflare_terraform_v4_40_0_zero_trust_namespace_renames_state()