migrate
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
resource "cloudflare_zero_trust_access_application" "<< resource_name >>" {
|
||||
zone_id = data.cloudflare_zone.main.zone_id
|
||||
name = "<< app_name >>"
|
||||
domain = "<< domain >>"
|
||||
type = "self_hosted"
|
||||
session_duration = "<< session_duration >>"
|
||||
policies = [
|
||||
<%- if service_token_enabled %>
|
||||
{
|
||||
id = cloudflare_zero_trust_access_policy.<< resource_name >>_service_token.id
|
||||
}
|
||||
<%- if ip_policy_enabled %>
|
||||
,
|
||||
<%- endif %>
|
||||
<%- endif %>
|
||||
<%- if ip_policy_enabled %>
|
||||
{
|
||||
id = cloudflare_zero_trust_access_policy.<< resource_name >>_ip.id
|
||||
}
|
||||
<%- endif %>
|
||||
]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<%- if service_token_enabled %>
|
||||
resource "cloudflare_zero_trust_access_policy" "<< resource_name >>_service_token" {
|
||||
account_id = data.cloudflare_account.main.account_id
|
||||
name = "<< service_token_policy_name >>"
|
||||
decision = "non_identity"
|
||||
include = [{
|
||||
service_token = {
|
||||
token_id = "<< service_token_id >>"
|
||||
}
|
||||
}]
|
||||
session_duration = "<< session_duration >>"
|
||||
}
|
||||
<%- endif %>
|
||||
<%- if ip_policy_enabled %>
|
||||
resource "cloudflare_zero_trust_access_policy" "<< resource_name >>_ip" {
|
||||
account_id = data.cloudflare_account.main.account_id
|
||||
name = "<< ip_policy_name >>"
|
||||
decision = "non_identity"
|
||||
include = [
|
||||
for ip_range in split(",", "<< ip_ranges >>") : {
|
||||
ip = {
|
||||
ip = trimspace(ip_range)
|
||||
}
|
||||
}
|
||||
]
|
||||
session_duration = "<< session_duration >>"
|
||||
}
|
||||
<%- endif %>
|
||||
@@ -0,0 +1,7 @@
|
||||
data "cloudflare_account" "main" {
|
||||
account_id = "<< account_id_value >>"
|
||||
}
|
||||
|
||||
data "cloudflare_zone" "main" {
|
||||
zone_id = "<< zone_id_value >>"
|
||||
}
|
||||
Reference in New Issue
Block a user