Skip to content

Commit

Permalink
lint all .tf files
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Sep 30, 2024
1 parent fed7cb7 commit 621e98d
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 104 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
data "cloudflare_infrastructure_access_targets" "example" {
account_id = "f037e56e89293a057740de681ac9abbe"
# Query parameters
hostname_contains = "example"
ipv4 = "210.26.29.230"
account_id = "f037e56e89293a057740de681ac9abbe"
hostname_contains = "example"
ipv4 = "210.26.29.230"
}

# output the list of targets the data source contains
output "targets" {
value = data.cloudflare_infrastructure_access_targets.example.targets
value = data.cloudflare_infrastructure_access_targets.example.targets
}
16 changes: 8 additions & 8 deletions examples/resources/cloudflare_access_application/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ resource "cloudflare_access_application" "staging_app" {
type = "self_hosted"
session_duration = "24h"
auto_redirect_to_identity = false
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
]
}

Expand All @@ -18,9 +18,9 @@ resource "cloudflare_access_application" "staging_app" {
domain = "staging.example.com"
type = "self_hosted"
session_duration = "24h"
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
]
cors_headers {
allowed_methods = ["GET", "POST", "OPTIONS"]
Expand All @@ -35,12 +35,12 @@ resource "cloudflare_zero_trust_access_application" "infra-app-example" {
account_id = "0da42c8d2132a9ddaf714f9e7c920711"
name = "infra-app"
type = "infrastructure"

target_criteria {
port = 22
protocol = "SSH"
target_attributes {
name = "hostname"
name = "hostname"
values = ["tfgo-tests-useast", "tfgo-tests-uswest"]
}
}
Expand Down
24 changes: 12 additions & 12 deletions examples/resources/cloudflare_access_policy/resource.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Allowing access to `[email protected]` email address only
resource "cloudflare_access_policy" "test_policy" {
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"

include {
email = ["[email protected]"]
Expand All @@ -16,9 +16,9 @@ resource "cloudflare_access_policy" "test_policy" {
# Allowing `[email protected]` to access but only when coming from a
# specific IP.
resource "cloudflare_access_policy" "test_policy" {
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"

include {
email = ["[email protected]"]
Expand All @@ -32,10 +32,10 @@ resource "cloudflare_access_policy" "test_policy" {
# Access policy for an infrastructure application
resource "cloudflare_access_policy" "infra-app-example-allow" {
application_id = cloudflare_zero_trust_access_application.infra-app-example.id
account_id = "0da42c8d2132a9ddaf714f9e7c920711"
name = "infra-app-example-allow"
decision = "allow"
precedence = 1
account_id = "0da42c8d2132a9ddaf714f9e7c920711"
name = "infra-app-example-allow"
decision = "allow"
precedence = 1

include {
email = ["[email protected]"]
Expand All @@ -53,12 +53,12 @@ resource "cloudflare_zero_trust_access_application" "infra-app-example" {
account_id = "0da42c8d2132a9ddaf714f9e7c920711"
name = "infra-app"
type = "infrastructure"

target_criteria {
port = 22
protocol = "SSH"
target_attributes {
name = "hostname"
name = "hostname"
values = ["tfgo-tests-useast", "tfgo-tests-uswest"]
}
}
Expand Down
48 changes: 24 additions & 24 deletions examples/resources/cloudflare_healthcheck/resource.tf
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# HTTPS Healthcheck
resource "cloudflare_healthcheck" "http_health_check" {
zone_id = var.cloudflare_zone_id
name = "http-health-check"
zone_id = var.cloudflare_zone_id
name = "http-health-check"
description = "example http health check"
address = "example.com"
suspended = false
address = "example.com"
suspended = false
check_regions = [
"WEU",
"EEU"
]
type = "HTTPS"
port = 443
method = "GET"
path = "/health"
type = "HTTPS"
port = 443
method = "GET"
path = "/health"
expected_body = "alive"
expected_codes = [
"2xx",
"301"
]
follow_redirects = true
allow_insecure = false
allow_insecure = false
header {
header = "Host"
values = ["example.com"]
}
timeout = 10
retries = 2
interval = 60
consecutive_fails = 3
timeout = 10
retries = 2
interval = 60
consecutive_fails = 3
consecutive_successes = 2
}

# TCP Healthcheck
resource "cloudflare_healthcheck" "tcp_health_check" {
zone_id = var.cloudflare_zone_id
name = "tcp-health-check"
zone_id = var.cloudflare_zone_id
name = "tcp-health-check"
description = "example tcp health check"
address = "example.com"
suspended = false
address = "example.com"
suspended = false
check_regions = [
"WEU",
"EEU"
]
type = "TCP"
port = 22
method = "connection_established"
timeout = 10
retries = 2
interval = 60
consecutive_fails = 3
type = "TCP"
port = 22
method = "connection_established"
timeout = 10
retries = 2
interval = 60
consecutive_fails = 3
consecutive_successes = 2
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
resource "cloudflare_infrastructure_access_target" "example" {
account_id = "f037e56e89293a057740de681ac9abbe"
hostname = "example-target"
ip = {
ipv4 = {
ip_addr = "210.26.29.230"
virtual_network_id = "238dccd1-149b-463d-8228-560ab83a54fd"
}
ipv6 = {
ip_addr = "24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0"
virtual_network_id = "238dccd1-149b-463d-8228-560ab83a54fd"
}
}
hostname = "example-target"
ip = {
ipv4 = {
ip_addr = "210.26.29.230"
virtual_network_id = "238dccd1-149b-463d-8228-560ab83a54fd"
}
ipv6 = {
ip_addr = "24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0"
virtual_network_id = "238dccd1-149b-463d-8228-560ab83a54fd"
}
}
}

resource "cloudflare_infrastructure_access_target" "ipv4_only_example" {
account_id = "f037e56e89293a057740de681ac9abbe"
hostname = "example-ipv4-only"
ip = {
ipv4 = {
ip_addr = "210.26.29.230"
virtual_network_id = "238dccd1-149b-463d-8228-560ab83a54fd"
}
}
hostname = "example-ipv4-only"
ip = {
ipv4 = {
ip_addr = "210.26.29.230"
virtual_network_id = "238dccd1-149b-463d-8228-560ab83a54fd"
}
}
}
2 changes: 1 addition & 1 deletion examples/resources/cloudflare_list/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ resource "cloudflare_list" "example" {

item {
value {
asn = 989
asn = 989
}
comment = "two"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/cloudflare_list_item/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "cloudflare_list_item" "example_asn_item" {
account_id = "f037e56e89293a057740de681ac9abbe"
list_id = cloudflare_list.example_asn_list.id
comment = "List Item Comment"
asn = 6789
asn = 6789
}

# Hostname List
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "cloudflare_observatory_scheduled_test" "example" {
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
url = "example.com"
region = "us-central1"
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
url = "example.com"
region = "us-central1"
frequency = "WEEKLY"
}

4 changes: 2 additions & 2 deletions examples/resources/cloudflare_ruleset/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ resource "cloudflare_ruleset" "cache_settings_example" {
include = ["habc", "hdef"]
check_presence = ["habc_t", "hdef_t"]
exclude_origin = true
contains = {
contains = {
"accept" = ["image/webp", "image/png"]
"accept-encoding" = ["br", "zstd"]
"some-header" = ["some-value", "some-other-value"]
Expand All @@ -295,7 +295,7 @@ resource "cloudflare_ruleset" "cache_settings_example" {
}
}
cache_reserve = {
eligible = true
eligible = true
minimum_file_size = 100000
}
origin_error_page_passthru = false
Expand Down
8 changes: 4 additions & 4 deletions examples/resources/cloudflare_teams_account/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ resource "cloudflare_teams_account" "example" {
}

proxy {
tcp = true
udp = true
root_ca = true
virtual_ip = false
tcp = true
udp = true
root_ca = true
virtual_ip = false
disable_for_time = 3600
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "cloudflare_tunnel_virtual_network" "example" {
account_id = "f037e56e89293a057740de681ac9abbe"
name = "vnet-for-documentation"
comment = "New tunnel virtual network for documentation"
name = "vnet-for-documentation"
comment = "New tunnel virtual network for documentation"
}
2 changes: 1 addition & 1 deletion examples/resources/cloudflare_waiting_room/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "cloudflare_waiting_room" "example" {
host = "shop2.example.com"
}

queueing_status_code = 200
queueing_status_code = 200

enabled_origin_commands = ["revoke"]
}
10 changes: 5 additions & 5 deletions examples/resources/cloudflare_waiting_room_event/resource.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Waiting Room Event
resource "cloudflare_waiting_room_event" "example" {
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
waiting_room_id = "d41d8cd98f00b204e9800998ecf8427e"
name = "foo"
event_start_time = "2006-01-02T15:04:05Z"
event_end_time = "2006-01-02T20:04:05Z"
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
waiting_room_id = "d41d8cd98f00b204e9800998ecf8427e"
name = "foo"
event_start_time = "2006-01-02T15:04:05Z"
event_end_time = "2006-01-02T20:04:05Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ resource "cloudflare_zero_trust_access_application" "staging_app" {
type = "self_hosted"
session_duration = "24h"
auto_redirect_to_identity = false
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
]
}

Expand All @@ -18,9 +18,9 @@ resource "cloudflare_zero_trust_access_application" "staging_app" {
domain = "staging.example.com"
type = "self_hosted"
session_duration = "24h"
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
policies = [
cloudflare_access_policy.example_1.id,
cloudflare_access_policy.example_2.id
]
cors_headers {
allowed_methods = ["GET", "POST", "OPTIONS"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Allowing access to `[email protected]` email address only
resource "cloudflare_zero_trust_access_policy" "test_policy" {
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"

include {
email = ["[email protected]"]
Expand All @@ -16,9 +16,9 @@ resource "cloudflare_zero_trust_access_policy" "test_policy" {
# Allowing `[email protected]` to access but only when coming from a
# specific IP.
resource "cloudflare_zero_trust_access_policy" "test_policy" {
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"
account_id = "f037e56e89293a057740de681ac9abbe"
name = "staging policy"
decision = "allow"

include {
email = ["[email protected]"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ resource "cloudflare_zero_trust_gateway_settings" "example" {
}

proxy {
tcp = true
udp = true
root_ca = true
virtual_ip = false
tcp = true
udp = true
root_ca = true
virtual_ip = false
disable_for_time = 3600
}

Expand Down
Loading

0 comments on commit 621e98d

Please sign in to comment.