-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
876 additions
and
32 deletions.
There are no files selected for viewing
Submodule ansible
updated
from 561ddd to 4809c7
Submodule inspec
updated
19 files
Submodule terraform
updated
from a391fe to dee259
Submodule terraform-beta
updated
from 677516 to 6abcaa
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
templates/terraform/examples/url_map_traffic_director_path.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
resource "google_compute_url_map" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['url_map_name'] %>" | ||
description = "a description" | ||
default_service = "${google_compute_backend_service.home.self_link}" | ||
|
||
host_rule { | ||
hosts = ["mysite.com"] | ||
path_matcher = "allpaths" | ||
} | ||
|
||
path_matcher { | ||
name = "allpaths" | ||
default_service = "${google_compute_backend_service.home.self_link}" | ||
|
||
path_rule { | ||
paths = ["/home"] | ||
route_action { | ||
cors_policy { | ||
allow_credentials = true | ||
allow_headers = ["Allowed content"] | ||
allow_methods = ["GET"] | ||
allow_origin_regexes = ["abc.*"] | ||
allow_origins = ["Allowed origin"] | ||
expose_headers = ["Exposed header"] | ||
max_age = 30 | ||
disabled = false | ||
} | ||
fault_injection_policy { | ||
abort { | ||
http_status = 234 | ||
percentage = 5.6 | ||
} | ||
delay { | ||
fixed_delay { | ||
seconds = 0 | ||
nanos = 50000 | ||
} | ||
percentage = 7.8 | ||
} | ||
} | ||
request_mirror_policy { | ||
backend_service = "${google_compute_backend_service.home.self_link}" | ||
} | ||
retry_policy { | ||
num_retries = 4 | ||
per_try_timeout { | ||
seconds = 30 | ||
} | ||
retry_conditions = ["5xx", "deadline-exceeded"] | ||
} | ||
timeout { | ||
seconds = 20 | ||
nanos = 750000000 | ||
} | ||
url_rewrite { | ||
host_rewrite = "A replacement header" | ||
path_prefix_rewrite = "A replacement path" | ||
} | ||
weighted_backend_services { | ||
backend_service = "${google_compute_backend_service.home.self_link}" | ||
weight = 400 | ||
header_action { | ||
request_headers_to_remove = ["RemoveMe"] | ||
request_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = true | ||
} | ||
response_headers_to_remove = ["RemoveMe"] | ||
response_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
test { | ||
service = "${google_compute_backend_service.home.self_link}" | ||
host = "hi.com" | ||
path = "/home" | ||
} | ||
} | ||
|
||
resource "google_compute_backend_service" "home" { | ||
name = "<%= ctx[:vars]['home_backend_service_name'] %>" | ||
port_name = "http" | ||
protocol = "HTTP" | ||
timeout_sec = 10 | ||
|
||
health_checks = ["${google_compute_health_check.default.self_link}"] | ||
load_balancing_scheme = "INTERNAL_SELF_MANAGED" | ||
} | ||
|
||
resource "google_compute_health_check" "default" { | ||
name = "<%= ctx[:vars]['health_check_name'] %>" | ||
http_health_check { | ||
port = 80 | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
templates/terraform/examples/url_map_traffic_director_path_partial.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
resource "google_compute_url_map" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['url_map_name'] %>" | ||
description = "a description" | ||
default_service = "${google_compute_backend_service.home.self_link}" | ||
|
||
host_rule { | ||
hosts = ["mysite.com"] | ||
path_matcher = "allpaths" | ||
} | ||
|
||
path_matcher { | ||
name = "allpaths" | ||
default_service = "${google_compute_backend_service.home.self_link}" | ||
|
||
path_rule { | ||
paths = ["/home"] | ||
route_action { | ||
cors_policy { | ||
allow_credentials = true | ||
allow_headers = ["Allowed content"] | ||
allow_methods = ["GET"] | ||
allow_origin_regexes = ["abc.*"] | ||
allow_origins = ["Allowed origin"] | ||
expose_headers = ["Exposed header"] | ||
max_age = 30 | ||
disabled = false | ||
} | ||
weighted_backend_services { | ||
backend_service = "${google_compute_backend_service.home.self_link}" | ||
weight = 400 | ||
header_action { | ||
request_headers_to_remove = ["RemoveMe"] | ||
request_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = true | ||
} | ||
response_headers_to_remove = ["RemoveMe"] | ||
response_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
test { | ||
service = "${google_compute_backend_service.home.self_link}" | ||
host = "hi.com" | ||
path = "/home" | ||
} | ||
} | ||
|
||
resource "google_compute_backend_service" "home" { | ||
name = "<%= ctx[:vars]['home_backend_service_name'] %>" | ||
port_name = "http" | ||
protocol = "HTTP" | ||
timeout_sec = 10 | ||
|
||
health_checks = ["${google_compute_health_check.default.self_link}"] | ||
load_balancing_scheme = "INTERNAL_SELF_MANAGED" | ||
} | ||
|
||
resource "google_compute_health_check" "default" { | ||
name = "<%= ctx[:vars]['health_check_name'] %>" | ||
http_health_check { | ||
port = 80 | ||
} | ||
} | ||
|
Oops, something went wrong.