Provides a reusable Terraform module to publish services via Cloudflare, compatible with ORM.
Examples
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"records": [
{
"name": "example.service.example.com",
"value": "198.51.100.4",
"type": "A",
"ttl": 1,
"proxied": false
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"tunnels": [
{
"account_id": "699d98642c564d2e855e9661899b7252",
"name": "example.service.example.com",
"config": {
"ingress_rules": [
{
"hostname": "example.service.example.com",
"service": "hello_world"
},
{
"service": "http_status:404"
}
]
}
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"records": [
{
"name": "example.service.example.com",
"ttl": 1,
"proxied": true
}
],
"tunnels": [
{
"account_id": "699d98642c564d2e855e9661899b7252",
"name": "example.service.example.com",
"config": {
"ingress_rules": [
{
"hostname": "example.service.example.com",
"service": "hello_world"
},
{
"service": "http_status:404"
}
]
}
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"records": [
{
"name": "example.service.example.com",
"ttl": 1,
"proxied": true
}
],
"tunnels": [
{
"account_id": "699d98642c564d2e855e9661899b7252",
"name": "example.service.example.com",
"config": {
"ingress_rules": [
{
"hostname": "example.service.example.com",
"service": "http://127.0.0.1:8080"
},
{
"service": "http_status:404"
}
]
}
}
],
"access_applications": [
{
"name": "example.service.example.com",
"domain": "example.service.example.com",
"type": "self_hosted",
"auto_redirect_to_identity": true,
"allowed_idps": [
"76a06b02-7c6b-474d-886e-b743a61be458"
]
}
],
"access_policies": [
{
"name" : "example.service.example.com",
"precedence" : 1,
"decision" : "allow",
"include" : {
"login_method": [
"76a06b02-7c6b-474d-886e-b743a61be458"
],
"email_domain": [
"example.com"
]
}
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"records": [
{
"name": "example.service.example.com",
"ttl": 1,
"proxied": true
}
],
"tunnels": [
{
"account_id": "699d98642c564d2e855e9661899b7252",
"name": "example.service.example.com",
"config": {
"ingress_rules": [
{
"hostname": "example.service.example.com",
"service": "http://127.0.0.1:8080"
},
{
"service": "http_status:404"
}
]
}
}
],
"access_applications": [
{
"name": "example.service.example.com",
"domain": "example.service.example.com",
"type": "self_hosted",
"auto_redirect_to_identity": false,
"session_duration": "1h"
}
],
"access_policies": [
{
"name" : "example.service.example.com",
"precedence" : 1,
"decision" : "non_identity",
"include" : {}
}
],
"access_service_tokens": [
{
"account_id": "699d98642c564d2e855e9661899b7252",
"name": "example.service.example.com"
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"spectrum_applications": [
{
"name": "example.service.example.com",
"protocol": "tcp/443",
"origin_dns": {
"name": "grafana.service.example.com"
},
"origin_port": 443,
"tls": "full"
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"spectrum_applications": [
{
"name": "example.service.example.com",
"protocol": "tcp/587",
"origin_direct": [
"tcp://198.51.100.4"
],
"tls": "full"
}
]
}
}
service-publishing.auto.tfvars.json
:
{
"service_publishing": {
"records": [
{
"name": "grafana.service.example.com",
"ttl": 1,
"proxied": true
}
],
"tunnels": [
{
"account_id": "699d98642c564d2e855e9661899b7252",
"name": "grafana.service.example.com",
"config": {
"ingress_rules": [
{
"hostname": "grafana.service.example.com",
"service": "http://127.0.0.1:9000"
},
{
"service": "http_status:404"
}
]
}
}
],
"access_applications": [
{
"name": "grafana.service.example.com",
"domain": "grafana.service.example.com",
"type": "saas",
"auto_redirect_to_identity": true,
"allowed_idps": [
"76a06b02-7c6b-474d-886e-b743a61be458"
],
"saas_app": {
"auth_type": "oidc",
"redirect_uris": ["https://grafana.service.example.com/login/generic_oauth"],
"grant_types": ["authorization_code"],
"scopes": ["openid", "email", "profile", "groups"],
"app_launcher_url": "https://grafana.service.example.com"
}
}
],
"access_policies": [
{
"name" : "grafana.service.example.com",
"precedence" : 1,
"decision" : "allow",
"include" : {
"login_method": [
"76a06b02-7c6b-474d-886e-b743a61be458"
],
"email_domain": [
"example.com"
]
}
}
]
}
}
Name | Version |
---|---|
terraform | ~> 1.2.9 |
cloudflare | = 4.29.0 |
random | ~> 3.6.0 |
Name | Version |
---|---|
cloudflare | = 4.29.0 |
random | ~> 3.6.0 |
No modules.
Name | Type |
---|---|
cloudflare_access_application.these | resource |
cloudflare_access_policy.these | resource |
cloudflare_access_service_token.these | resource |
cloudflare_load_balancer.these | resource |
cloudflare_load_balancer_monitor.these | resource |
cloudflare_load_balancer_pool.these | resource |
cloudflare_record.these | resource |
cloudflare_spectrum_application.these | resource |
cloudflare_tunnel.these | resource |
cloudflare_tunnel_config.these | resource |
random_id.these | resource |
cloudflare_zone.these | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
service_publishing | Service Publishing input object. | object({ |
n/a | yes |
Name | Description |
---|---|
service_publishing | Service Publishing output object. |