Skip to content
Merged
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: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
bin/
.terraformrc-tf-migrate

# Binaries (should be in bin/ directory only)
/tf-migrate
/e2e-runner

# Local provider dev overrides
.terraformrc-tf-migrate

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ lint-testdata:
clean:
@echo "Cleaning build artifacts..."
@rm -rf bin/
@rm -f tf-migrate e2e-runner
@echo "Clean complete"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Test Case 1: Basic account member
resource "cloudflare_account_member" "basic_am" {
account_id = var.cloudflare_account_id
Expand All @@ -28,4 +33,4 @@ resource "cloudflare_account_member" "full_am" {
"e58cefd75d7adae0b761796c28815e5c",
"a4154d230e664f8b3e6e5c95a8cc812f"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Test Case 1: Basic account member
resource "cloudflare_account_member" "basic_am" {
account_id = var.cloudflare_account_id
Expand All @@ -28,4 +33,4 @@ resource "cloudflare_account_member" "full_am" {
"e58cefd75d7adae0b761796c28815e5c",
"a4154d230e664f8b3e6e5c95a8cc812f"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Test Case 1: Basic API token with single policy
resource "cloudflare_api_token" "basic_token" {
name = "${local.name_prefix} Basic API Token"
Expand Down Expand Up @@ -268,4 +273,4 @@ resource "cloudflare_api_token" "variable_resources_token" {
id = "c8fed203ed3043cba015a93ad1616f1f"
}]
}]
}
}
7 changes: 6 additions & 1 deletion integration/v4_to_v5/testdata/api_token/input/api_token.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Test Case 1: Basic API token with single policy
resource "cloudflare_api_token" "basic_token" {
name = "${local.name_prefix} Basic API Token"
Expand Down Expand Up @@ -268,4 +273,4 @@ resource "cloudflare_api_token" "variable_resources_token" {
"com.cloudflare.api.account.zone.${var.cloudflare_zone_id}" = "*"
}
}
}
}
5 changes: 5 additions & 0 deletions integration/v4_to_v5/testdata/argo/expected/argo.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

resource "cloudflare_argo_smart_routing" "both_with_lifecycle" {
zone_id = var.cloudflare_zone_id
value = "on"
Expand Down
5 changes: 5 additions & 0 deletions integration/v4_to_v5/testdata/argo/input/argo.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

resource "cloudflare_argo" "both_with_lifecycle" {
zone_id = var.cloudflare_zone_id
smart_routing = "on"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Comprehensive bot management test with available fields
# Note: bot_management is a singleton per zone - only one config per zone
resource "cloudflare_bot_management" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Comprehensive bot management test with available fields
# Note: bot_management is a singleton per zone - only one config per zone
resource "cloudflare_bot_management" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Basic zone-scoped custom page with real URL
resource "cloudflare_custom_pages" "error_500" {
zone_id = var.cloudflare_zone_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Basic zone-scoped custom page with real URL
resource "cloudflare_custom_pages" "error_500" {
zone_id = var.cloudflare_zone_id
type = "500_errors"
url = "https://custom-pages-500-error-for-e2e.terraform-testing-a09.workers.dev/"
state = "customized"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Standard DNS records
resource "cloudflare_dns_record" "example_a" {
zone_id = var.cloudflare_zone_id
Expand Down Expand Up @@ -306,4 +311,4 @@ resource "cloudflare_dns_record" "tagged_record" {
ttl = 1
comment = "This is a test record for e2e migration testing"
content = "192.0.2.200"
}
}
7 changes: 6 additions & 1 deletion integration/v4_to_v5/testdata/dns_record/input/dns_record.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Standard DNS records
resource "cloudflare_record" "example_a" {
zone_id = var.cloudflare_zone_id
Expand Down Expand Up @@ -299,4 +304,4 @@ resource "cloudflare_record" "tagged_record" {
proxied = true
ttl = 1
comment = "This is a test record for e2e migration testing"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Variable for test IP - override if default doesn't work
variable "healthcheck_test_ip" {
description = "IP for healthcheck test DNS record - use an IP you control if needed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Variable for test IP - override if default doesn't work
variable "healthcheck_test_ip" {
description = "IP for healthcheck test DNS record - use an IP you control if needed"
Expand Down
5 changes: 5 additions & 0 deletions integration/v4_to_v5/testdata/list/expected/list.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

locals {
name_prefix = "cftftest_list"
common_account = var.cloudflare_account_id
Expand Down
5 changes: 5 additions & 0 deletions integration/v4_to_v5/testdata/list/input/list.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

locals {
name_prefix = "cftftest_list"
common_account = var.cloudflare_account_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

variable "cloudflare_account_id" {
description = "Cloudflare account ID"
type = string
Expand Down Expand Up @@ -249,4 +254,4 @@ resource "cloudflare_load_balancer_monitor" "consecutive_values" {
retries = 4
timeout = 8
expected_codes = "200"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

variable "cloudflare_account_id" {
description = "Cloudflare account ID"
type = string
Expand Down Expand Up @@ -263,4 +268,4 @@ resource "cloudflare_load_balancer_monitor" "consecutive_values" {
retries = 4
timeout = 8
expected_codes = "200"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

variable "cloudflare_account_id" {
description = "Cloudflare account ID"
type = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

variable "cloudflare_account_id" {
description = "Cloudflare account ID"
type = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Minimal logpush job
resource "cloudflare_logpush_job" "minimal" {
account_id = var.cloudflare_account_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Minimal logpush job
resource "cloudflare_logpush_job" "minimal" {
account_id = var.cloudflare_account_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Single comprehensive test covering all valid header types
resource "cloudflare_managed_transforms" "test" {
zone_id = var.cloudflare_zone_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Single comprehensive test covering all valid header types
resource "cloudflare_managed_headers" "test" {
zone_id = var.cloudflare_zone_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Use Cloudflare trace endpoint for webhook testing
# URL: https://www.cloudflare.com/cdn-cgi/trace
# This endpoint responds with 200 OK to all requests for webhook validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ variable "cloudflare_zone_id" {
type = string
}

variable "cloudflare_domain" {
description = "Cloudflare domain for testing"
type = string
}

# Use Cloudflare trace endpoint for webhook testing
# URL: https://www.cloudflare.com/cdn-cgi/trace
# This endpoint responds with 200 OK to all requests for webhook validation
Expand Down
Loading