-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WAFD] throttling test Summary of the Pull Request PR Checklist Refers to: #2460 Tests added/passed. Documentation updated. Schema updated. Release notes added. Acceptance Steps Performed === RUN TestThrottlingWafDedicatedConfiguration --- PASS: TestThrottlingWafDedicatedConfiguration (406.18s) PASS Process finished with the exit code 0 Reviewed-by: Aloento Reviewed-by: Artem Lifshits Reviewed-by: Sergei Martynov
- Loading branch information
1 parent
77f59bf
commit d10830f
Showing
4 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
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,90 @@ | ||
package src | ||
|
||
const WafdMain = ` | ||
############## | ||
# NETWORK part | ||
############## | ||
resource "opentelekomcloud_vpc_v1" "vpc" { | ||
name = var.environment | ||
cidr = var.vpc_cidr | ||
shared = true | ||
} | ||
resource "opentelekomcloud_vpc_subnet_v1" "subnet" { | ||
name = var.environment | ||
vpc_id = opentelekomcloud_vpc_v1.vpc.id | ||
cidr = var.subnet_cidr | ||
gateway_ip = var.subnet_gateway_ip | ||
primary_dns = var.subnet_primary_dns | ||
secondary_dns = var.subnet_secondary_dns | ||
} | ||
data "opentelekomcloud_networking_secgroup_v2" "default_secgroup" { | ||
name = "default" | ||
} | ||
#################### | ||
# WAFD INSTANCE part | ||
#################### | ||
resource "opentelekomcloud_waf_dedicated_instance_v1" "wafd_1" { | ||
name = "wafd_throttling_test" | ||
availability_zone = var.wafd_az | ||
specification = "waf.instance.professional" | ||
flavor = var.wafd_flavor | ||
architecture = var.wafd_arch | ||
vpc_id = opentelekomcloud_vpc_subnet_v1.subnet.vpc_id | ||
subnet_id = opentelekomcloud_vpc_subnet_v1.subnet.network_id | ||
security_group = [ | ||
data.opentelekomcloud_networking_secgroup_v2.default_secgroup.id | ||
] | ||
} | ||
################## | ||
# WAFD DOMAIN part | ||
################## | ||
resource "opentelekomcloud_waf_dedicated_policy_v1" "policy_1" { | ||
name = "policy_throttling" | ||
} | ||
resource "opentelekomcloud_waf_dedicated_domain_v1" "domain_1" { | ||
domain = "www.wafd.throttling-test.com" | ||
keep_policy = true | ||
proxy = true | ||
policy_id = opentelekomcloud_waf_dedicated_policy_v1.policy_1.id | ||
server { | ||
client_protocol = "HTTP" | ||
server_protocol = "HTTP" | ||
address = "10.1.0.10" | ||
port = 8080 | ||
type = "ipv4" | ||
vpc_id = opentelekomcloud_vpc_subnet_v1.subnet.vpc_id | ||
} | ||
} | ||
###################### | ||
# WAFD RULES part / 30 | ||
###################### | ||
resource "opentelekomcloud_waf_dedicated_cc_rule_v1" "rule_cc" { | ||
count = 30 | ||
policy_id = opentelekomcloud_waf_dedicated_policy_v1.policy_1.id | ||
mode = 0 | ||
url = "/abc_${count.index}" | ||
limit_num = 10 | ||
limit_period = 60 | ||
lock_time = 10 | ||
tag_type = "cookie" | ||
tag_index = "sessionid" | ||
action { | ||
category = "block" | ||
content_type = "application/json" | ||
content = "{\"error\":\"forbidden\"}" | ||
} | ||
} | ||
` |
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,96 @@ | ||
package src | ||
|
||
const WafdVars = ` | ||
############# | ||
# Environment | ||
############# | ||
variable "environment" { | ||
default = "throttle-wafd-test" | ||
} | ||
################### | ||
# OTC auth config | ||
################### | ||
variable "region" { | ||
default = "eu-de" | ||
} | ||
variable "otc_domain" { | ||
default = "eu-de" | ||
} | ||
variable "auth_url" { | ||
default = "https://iam.eu-de.otc.t-systems.com:443/v3" | ||
} | ||
variable "tenant_name" { | ||
default = "eu-de" | ||
} | ||
variable "access_key" { | ||
default = "" | ||
} | ||
variable "secret_key" { | ||
default = "" | ||
} | ||
variable "key" { | ||
default = "" | ||
} | ||
########## | ||
# VPC vars | ||
########## | ||
variable "vpc_cidr" { | ||
description = "CIDR of the VPC" | ||
default = "10.1.0.0/24" | ||
} | ||
############# | ||
# Subnet vars | ||
############# | ||
variable "subnet_cidr" { | ||
description = "CIDR of the Subnet" | ||
default = "10.1.0.0/24" | ||
} | ||
variable "subnet_gateway_ip" { | ||
description = "Default gateway of the Subnet" | ||
default = "10.1.0.1" | ||
} | ||
variable "subnet_primary_dns" { | ||
description = "Primary DNS server of the Subnet" | ||
default = "100.125.4.25" | ||
} | ||
variable "subnet_secondary_dns" { | ||
description = "Secondary DNS server of the Subnet" | ||
default = "100.125.129.199" | ||
} | ||
########### | ||
# WAFD vars | ||
########### | ||
variable "wafd_az" { | ||
description = "Availability Zone 1 (Biere)" | ||
default = "eu-de-01" | ||
} | ||
variable "wafd_flavor" { | ||
description = "Name of the wafd flavor" | ||
default = "s2.large.2" | ||
} | ||
variable "wafd_arch" { | ||
description = "Name of the wafd arch" | ||
default = "x86" | ||
} | ||
` |
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
3 changes: 3 additions & 0 deletions
3
releasenotes/notes/wafd-throttling-test-91d42034fee3a795.yaml
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,3 @@ | ||
other: | ||
- | | ||
**[WAFD]** Added test in ``acceptance/throttling_test.go`` (`#2462 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2462>`_) |