Skip to content

Commit

Permalink
feat(grit): add patterns for ZT upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Nov 14, 2024
1 parent e8a0e9d commit dd6e253
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit dd6e253

Please sign in to comment.