Skip to content

Commit

Permalink
feat: DBTP-1431 Add validation for CDN timeout (#609)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Roy <[email protected]>
  • Loading branch information
rav-pradhan and antroy-madetech authored Nov 5, 2024
1 parent 64cc35b commit 66a21c6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions dbt_platform_helper/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ def iam_role_arn_regex(key):
Optional("cdn_geo_restriction_type"): str,
Optional("cdn_logging_bucket"): str,
Optional("cdn_logging_bucket_prefix"): str,
Optional("cdn_timeout_seconds"): int,
Optional("default_waf"): str,
Optional("domain_prefix"): str,
Optional("enable_logging"): bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ my-alb:
cdn_geo_restriction_type: "whitelist"
cdn_logging_bucket: "bucket-name"
cdn_logging_bucket_prefix: "myprefix"
cdn_timeout_seconds: 60
default_waf: "waf_sentinel_012345678910_default"
enable_logging: true
forwarded_values_forward: "all"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ my-alb-cdn-domain-list-be-a-dict:
cdn_domains_list: 1234 # Should be a tuple


my-alb-cdn-timeout-seconds-should-be-an-int:
type: alb
environments:
dev:
cdn_timeout_seconds: "hello world" # Should be an int


my-cdn-geo-locations-be-a-list:
type: alb
environments:
Expand Down
1 change: 1 addition & 0 deletions tests/platform_helper/utils/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def test_validate_addons_success(mock_name_is_available, addons_file):
"my-alb-cdn-geo-restrictions-type-should-be-a-string": r"environments.*dev.*should be instance of 'str'",
"my-alb-cdn-logging-bucket-should-be-a-string": r"environments.*dev.*should be instance of 'str'",
"my-alb-cdn-logging-bucket-prefix-should-be-a-string": r"environments.*dev.*should be instance of 'str'",
"my-alb-cdn-timeout-seconds-should-be-an-int": r"environments.*dev.*should be instance of 'int'",
"my-alb-default-waf-should-be-a-string": r"environments.*dev.*should be instance of 'str'",
"my-alb-enable-logging-should-be-a-bool": r"environments.*dev.*should be instance of 'bool'",
"my-alb-forwarded-values-forward-should-be-a-string": r"environments.*dev.*should be instance of 'str'",
Expand Down

0 comments on commit 66a21c6

Please sign in to comment.