Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion integration/v4_to_v5/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import (
_ "github.com/cloudflare/tf-migrate/internal/resources/account_member"
_ "github.com/cloudflare/tf-migrate/internal/resources/api_token"
_ "github.com/cloudflare/tf-migrate/internal/resources/dns_record"
_ "github.com/cloudflare/tf-migrate/internal/resources/load_balancer_monitor"
_ "github.com/cloudflare/tf-migrate/internal/resources/logpull_retention"
_ "github.com/cloudflare/tf-migrate/internal/resources/r2_bucket"
_ "github.com/cloudflare/tf-migrate/internal/resources/workers_kv"
_ "github.com/cloudflare/tf-migrate/internal/resources/workers_kv_namespace"
_ "github.com/cloudflare/tf-migrate/internal/resources/zero_trust_access_service_token"
_ "github.com/cloudflare/tf-migrate/internal/resources/zero_trust_gateway_policy"
_ "github.com/cloudflare/tf-migrate/internal/resources/zero_trust_dlp_custom_profile"
_ "github.com/cloudflare/tf-migrate/internal/resources/zero_trust_gateway_policy"
_ "github.com/cloudflare/tf-migrate/internal/resources/zero_trust_list"
_ "github.com/cloudflare/tf-migrate/internal/resources/zone_dnssec"
)
Expand Down Expand Up @@ -48,6 +49,7 @@ func TestV4ToV5Migration(t *testing.T) {
"account_member",
"api_token",
"dns_record",
"load_balancer_monitor",
"logpull_retention",
"r2_bucket",
"workers_kv",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resource "cloudflare_load_balancer_monitor" "test" {
account_id = "f037e56e89293a057740de681ac9abbe"
type = "https"
description = "Test HTTPS monitor"
method = "GET"
path = "/health"
interval = 30
retries = 3
timeout = 10
expected_codes = "2xx"
expected_body = "healthy"
allow_insecure = true


header = {
"Host" = ["api.example.com"]
"Authorization" = ["Bearer token123"]
}
}

resource "cloudflare_load_balancer_monitor" "minimal" {
account_id = "f037e56e89293a057740de681ac9abbe"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"version": 4,
"terraform_version": "1.0.0",
"serial": 1,
"lineage": "test",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "cloudflare_load_balancer_monitor",
"name": "test",
"provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "abc123def456",
"account_id": "f037e56e89293a057740de681ac9abbe",
"type": "https",
"description": "Test HTTPS monitor",
"method": "GET",
"path": "/health",
"interval": 30.0,
"retries": 3.0,
"timeout": 10.0,
"expected_codes": "2xx",
"expected_body": "healthy",
"allow_insecure": true,
"header": {
"Host": ["api.example.com"],
"Authorization": ["Bearer token123"]
},
"created_on": "2023-01-01T00:00:00Z",
"modified_on": "2023-01-01T00:00:00Z"
}
}
]
},
{
"mode": "managed",
"type": "cloudflare_load_balancer_monitor",
"name": "minimal",
"provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "minimal123",
"account_id": "f037e56e89293a057740de681ac9abbe",
"type": "http",
"interval": 60.0,
"retries": 2.0,
"timeout": 5.0,
"created_on": "2023-01-01T00:00:00Z",
"modified_on": "2023-01-01T00:00:00Z"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "cloudflare_load_balancer_monitor" "test" {
account_id = "f037e56e89293a057740de681ac9abbe"
type = "https"
description = "Test HTTPS monitor"
method = "GET"
path = "/health"
interval = 30
retries = 3
timeout = 10
expected_codes = "2xx"
expected_body = "healthy"
allow_insecure = true

header {
header = "Host"
values = ["api.example.com"]
}

header {
header = "Authorization"
values = ["Bearer token123"]
}
}

resource "cloudflare_load_balancer_monitor" "minimal" {
account_id = "f037e56e89293a057740de681ac9abbe"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"version": 4,
"terraform_version": "1.0.0",
"serial": 1,
"lineage": "test",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "cloudflare_load_balancer_monitor",
"name": "test",
"provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "abc123def456",
"account_id": "f037e56e89293a057740de681ac9abbe",
"type": "https",
"description": "Test HTTPS monitor",
"method": "GET",
"path": "/health",
"interval": 30,
"retries": 3,
"timeout": 10,
"expected_codes": "2xx",
"expected_body": "healthy",
"allow_insecure": true,
"consecutive_up": 0,
"consecutive_down": 0,
"header": [
{
"header": "Host",
"values": ["api.example.com"]
},
{
"header": "Authorization",
"values": ["Bearer token123"]
}
],
"created_on": "2023-01-01T00:00:00Z",
"modified_on": "2023-01-01T00:00:00Z"
}
}
]
},
{
"mode": "managed",
"type": "cloudflare_load_balancer_monitor",
"name": "minimal",
"provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"id": "minimal123",
"account_id": "f037e56e89293a057740de681ac9abbe",
"type": "http",
"interval": 60,
"retries": 2,
"timeout": 5,
"consecutive_up": 0,
"consecutive_down": 0,
"created_on": "2023-01-01T00:00:00Z",
"modified_on": "2023-01-01T00:00:00Z"
}
}
]
}
]
}
4 changes: 3 additions & 1 deletion internal/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/cloudflare/tf-migrate/internal/resources/account_member"
"github.com/cloudflare/tf-migrate/internal/resources/api_token"
"github.com/cloudflare/tf-migrate/internal/resources/dns_record"
"github.com/cloudflare/tf-migrate/internal/resources/load_balancer_monitor"
"github.com/cloudflare/tf-migrate/internal/resources/logpull_retention"
"github.com/cloudflare/tf-migrate/internal/resources/r2_bucket"
"github.com/cloudflare/tf-migrate/internal/resources/workers_kv"
Expand All @@ -22,7 +23,7 @@ func RegisterAllMigrations() {
account_member.NewV4ToV5Migrator()
api_token.NewV4ToV5Migrator()
dns_record.NewV4ToV5Migrator()
zone_dnssec.NewV4ToV5Migrator()
load_balancer_monitor.NewV4ToV5Migrator()
logpull_retention.NewV4ToV5Migrator()
r2_bucket.NewV4ToV5Migrator()
workers_kv.NewV4ToV5Migrator()
Expand All @@ -31,4 +32,5 @@ func RegisterAllMigrations() {
zero_trust_dlp_custom_profile.NewV4ToV5Migrator()
zero_trust_gateway_policy.NewV4ToV5Migrator()
zero_trust_list.NewV4ToV5Migrator()
zone_dnssec.NewV4ToV5Migrator()
}
Loading
Loading