Skip to content

Commit

Permalink
make sure that vars are passed in as last arg
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Apr 29, 2024
1 parent 658598a commit 97899bb
Show file tree
Hide file tree
Showing 49 changed files with 174 additions and 172 deletions.
8 changes: 4 additions & 4 deletions docs/functions/ends_with.md
Expand Up @@ -17,7 +17,7 @@ run "check_events_path_google_pubsub_subscription_push_endpoint" {
command = plan
assert {
condition = provider::assert::ends_with(google_pubsub_subscription.example.push_config.push_endpoint, "/events")
condition = provider::assert::ends_with("/events", google_pubsub_subscription.example.push_config.push_endpoint)
error_message = "Push endpoint must end with /events"
}
}
Expand All @@ -29,7 +29,7 @@ run "check_events_path_google_pubsub_subscription_push_endpoint" {
variable "webhook_url" {
type = string
validation {
condition = provider::assert::ends_with(var.webhook_url, "/events")
condition = provider::assert::ends_with("/events", var.webhook_url)
error_message = "Webhook URL must end with /events"
}
}
Expand All @@ -39,14 +39,14 @@ variable "webhook_url" {

<!-- signature generated by tfplugindocs -->
```text
ends_with(string string, suffix string) bool
ends_with(suffix string, string string) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `string` (String) The string to check
1. `suffix` (String) The suffix to check for
1. `string` (String) The string to check


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/equal.md
Expand Up @@ -17,7 +17,7 @@ run "number_of_glue_job_workers_is_5" {
command = plan
assert {
condition = provider::assert::equal(aws_glue_job.example.number_of_workers, 5)
condition = provider::assert::equal(5, aws_glue_job.example.number_of_workers)
error_message = "Number of Glue job workers must be 5"
}
}
Expand All @@ -29,7 +29,7 @@ run "number_of_glue_job_workers_is_5" {
variable "number_of_glue_job_workers" {
type = number
validation {
condition = provider::assert::equal(var.number_of_glue_job_workers, 5)
condition = provider::assert::equal(5, var.number_of_glue_job_workers)
error_message = "Number of Glue job workers must be 5"
}
}
Expand All @@ -39,14 +39,14 @@ variable "number_of_glue_job_workers" {

<!-- signature generated by tfplugindocs -->
```text
equal(number number, compare_against number) bool
equal(compare_against number, number number) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `number` (Number) The number to compare
1. `compare_against` (Number) The number to compare against
1. `number` (Number) The number to compare


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/greater.md
Expand Up @@ -17,7 +17,7 @@ run "check_aws_db_instance_size" {
command = plan
assert {
condition = provider::assert::greater(aws_db_instance.example.instance_class, 100)
condition = provider::assert::greater(100, aws_db_instance.example.instance_class)
error_message = "DB instance size must be greater than 100"
}
}
Expand All @@ -29,7 +29,7 @@ run "check_aws_db_instance_size" {
variable "db_instance_size" {
type = number
validation {
condition = provider::assert::greater(var.db_instance_size, 100)
condition = provider::assert::greater(100, var.db_instance_size)
error_message = "DB instance size must be greater than 100"
}
}
Expand All @@ -39,14 +39,14 @@ variable "db_instance_size" {

<!-- signature generated by tfplugindocs -->
```text
greater(number number, compare_against number) bool
greater(compare_against number, number number) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `number` (Number) The number to check
1. `compare_against` (Number) The number to compare against
1. `number` (Number) The number to check


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/greater_or_equal.md
Expand Up @@ -17,7 +17,7 @@ run "check_aws_db_instance_size" {
command = plan
assert {
condition = provider::assert::greater_or_equal(aws_db_instance.example.instance_class, 100)
condition = provider::assert::greater_or_equal(100, aws_db_instance.example.instance_class)
error_message = "DB instance size must be greater than or equal to 100"
}
}
Expand All @@ -29,7 +29,7 @@ run "check_aws_db_instance_size" {
variable "db_instance_size" {
type = number
validation {
condition = provider::assert::greater_or_equal(var.db_instance_size, 100)
condition = provider::assert::greater_or_equal(100, var.db_instance_size)
error_message = "DB instance size must be greater than or equal to 100"
}
}
Expand All @@ -39,14 +39,14 @@ variable "db_instance_size" {

<!-- signature generated by tfplugindocs -->
```text
greater_or_equal(number number, compare_against number) bool
greater_or_equal(compare_against number, number number) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `number` (Number) The number to check
1. `compare_against` (Number) The number to compare against
1. `number` (Number) The number to check


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/key.md
Expand Up @@ -16,7 +16,7 @@ run "check_if_lambda_function_tags_has_key" {
command = plan
assert {
condition = provider::assert::key(aws_lambda_function.example.tags, "key1")
condition = provider::assert::key("key1", aws_lambda_function.example.tags)
error_message = "The tags map must contain the key 'key1'"
}
}
Expand All @@ -28,7 +28,7 @@ run "check_if_lambda_function_tags_has_key" {
variable "tags" {
type = map(string)
validation {
condition = provider::assert::key(var.tags, "key1")
condition = provider::assert::key("key1", var.tags)
error_message = "The tags map must contain the key 'key1'"
}
}
Expand All @@ -38,14 +38,14 @@ variable "tags" {

<!-- signature generated by tfplugindocs -->
```text
key(map map of string, key string) bool
key(key string, map map of string) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `map` (Map of String) The map to check
1. `key` (String) The key to check
1. `map` (Map of String) The map to check


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/less.md
Expand Up @@ -17,7 +17,7 @@ run "check_aws_db_instance_size" {
command = plan
assert {
condition = provider::assert::less(aws_db_instance.example.instance_class, 1000)
condition = provider::assert::less(1000, aws_db_instance.example.instance_class)
error_message = "DB instance size must be less than 1000"
}
}
Expand All @@ -29,7 +29,7 @@ run "check_aws_db_instance_size" {
variable "db_instance_size" {
type = number
validation {
condition = provider::assert::less(var.db_instance_size, 1000)
condition = provider::assert::less(1000, var.db_instance_size)
error_message = "DB instance size must be less than 1000"
}
}
Expand All @@ -39,14 +39,14 @@ variable "db_instance_size" {

<!-- signature generated by tfplugindocs -->
```text
less(number number, compare_against number) bool
less(compare_against number, number number) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `number` (Number) The number to check
1. `compare_against` (Number) The number to compare against
1. `number` (Number) The number to check


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/less_or_equal.md
Expand Up @@ -17,7 +17,7 @@ run "check_aws_db_instance_size" {
command = plan
assert {
condition = provider::assert::less_or_equal(aws_db_instance.example.instance_class, 1000)
condition = provider::assert::less_or_equal(1000, aws_db_instance.example.instance_class)
error_message = "DB instance size must be less than or equal to 1000"
}
}
Expand All @@ -29,7 +29,7 @@ run "check_aws_db_instance_size" {
variable "db_instance_size" {
type = number
validation {
condition = provider::assert::less_or_equal(var.db_instance_size, 1000)
condition = provider::assert::less_or_equal(1000, var.db_instance_size)
error_message = "DB instance size must be less than or equal to 1000"
}
}
Expand All @@ -39,14 +39,14 @@ variable "db_instance_size" {

<!-- signature generated by tfplugindocs -->
```text
less_or_equal(number number, compare_against number) bool
less_or_equal(compare_against number, number number) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `number` (Number) The number to check
1. `compare_against` (Number) The number to compare against
1. `number` (Number) The number to check


## Return Type
Expand Down
4 changes: 2 additions & 2 deletions docs/functions/not_equal.md
Expand Up @@ -39,14 +39,14 @@ variable "rds_global_cluster_deletion_protection" {

<!-- signature generated by tfplugindocs -->
```text
not_equal(number number, compare_against number) bool
not_equal(compare_against number, number number) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `number` (Number) The number to compare
1. `compare_against` (Number) The number to compare against
1. `number` (Number) The number to compare


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/starts_with.md
Expand Up @@ -17,7 +17,7 @@ run "check_https_google_pubsub_subscription_push_endpoint" {
command = plan
assert {
condition = provider::assert::starts_with(google_pubsub_subscription.example.push_config.push_endpoint, "https://")
condition = provider::assert::starts_with("https://", google_pubsub_subscription.example.push_config.push_endpoint)
error_message = "Push endpoint must start with https://"
}
}
Expand All @@ -29,7 +29,7 @@ run "check_https_google_pubsub_subscription_push_endpoint" {
variable "webhook_url" {
type = string
validation {
condition = provider::assert::starts_with(var.webhook_url, "https://")
condition = provider::assert::starts_with("https://", var.webhook_url)
error_message = "Webhook URL must start with https://"
}
}
Expand All @@ -39,14 +39,14 @@ variable "webhook_url" {

<!-- signature generated by tfplugindocs -->
```text
starts_with(string string, prefix string) bool
starts_with(prefix string, string string) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `string` (String) The string to check
1. `prefix` (String) The prefix to check for
1. `string` (String) The string to check


## Return Type
Expand Down
8 changes: 4 additions & 4 deletions docs/functions/value.md
Expand Up @@ -16,7 +16,7 @@ run "check_if_lambda_function_tags_has_value" {
command = plan
assert {
condition = provider::assert::value(aws_lambda_function.example.tags, "value1")
condition = provider::assert::value("value1", aws_lambda_function.example.tags)
error_message = "The tags map must contain the value 'value1'"
}
}
Expand All @@ -28,7 +28,7 @@ run "check_if_lambda_function_tags_has_value" {
variable "tags" {
type = map(string)
validation {
condition = provider::assert::value(var.tags, "value1")
condition = provider::assert::value("value1", var.tags)
error_message = "The tags map must contain the value 'value1'"
}
}
Expand All @@ -38,14 +38,14 @@ variable "tags" {

<!-- signature generated by tfplugindocs -->
```text
value(map map of string, value string) bool
value(value string, map map of string) bool
```

## Arguments

<!-- arguments generated by tfplugindocs -->
1. `map` (Map of String) The map to check
1. `value` (String) The value to check
1. `map` (Map of String) The map to check


## Return Type
Expand Down
2 changes: 1 addition & 1 deletion examples/functions/ends_with/function.tf
Expand Up @@ -3,7 +3,7 @@ run "check_events_path_google_pubsub_subscription_push_endpoint" {
command = plan

assert {
condition = provider::assert::ends_with(google_pubsub_subscription.example.push_config.push_endpoint, "/events")
condition = provider::assert::ends_with("/events", google_pubsub_subscription.example.push_config.push_endpoint)
error_message = "Push endpoint must end with /events"
}
}
2 changes: 1 addition & 1 deletion examples/functions/ends_with/variable.tf
@@ -1,7 +1,7 @@
variable "webhook_url" {
type = string
validation {
condition = provider::assert::ends_with(var.webhook_url, "/events")
condition = provider::assert::ends_with("/events", var.webhook_url)
error_message = "Webhook URL must end with /events"
}
}
2 changes: 1 addition & 1 deletion examples/functions/equal/function.tf
Expand Up @@ -3,7 +3,7 @@ run "number_of_glue_job_workers_is_5" {
command = plan

assert {
condition = provider::assert::equal(aws_glue_job.example.number_of_workers, 5)
condition = provider::assert::equal(5, aws_glue_job.example.number_of_workers)
error_message = "Number of Glue job workers must be 5"
}
}
2 changes: 1 addition & 1 deletion examples/functions/equal/variable.tf
@@ -1,7 +1,7 @@
variable "number_of_glue_job_workers" {
type = number
validation {
condition = provider::assert::equal(var.number_of_glue_job_workers, 5)
condition = provider::assert::equal(5, var.number_of_glue_job_workers)
error_message = "Number of Glue job workers must be 5"
}
}
2 changes: 1 addition & 1 deletion examples/functions/greater/function.tf
Expand Up @@ -3,7 +3,7 @@ run "check_aws_db_instance_size" {
command = plan

assert {
condition = provider::assert::greater(aws_db_instance.example.instance_class, 100)
condition = provider::assert::greater(100, aws_db_instance.example.instance_class)
error_message = "DB instance size must be greater than 100"
}
}
2 changes: 1 addition & 1 deletion examples/functions/greater/variable.tf
@@ -1,7 +1,7 @@
variable "db_instance_size" {
type = number
validation {
condition = provider::assert::greater(var.db_instance_size, 100)
condition = provider::assert::greater(100, var.db_instance_size)
error_message = "DB instance size must be greater than 100"
}
}
2 changes: 1 addition & 1 deletion examples/functions/greater_or_equal/function.tf
Expand Up @@ -3,7 +3,7 @@ run "check_aws_db_instance_size" {
command = plan

assert {
condition = provider::assert::greater_or_equal(aws_db_instance.example.instance_class, 100)
condition = provider::assert::greater_or_equal(100, aws_db_instance.example.instance_class)
error_message = "DB instance size must be greater than or equal to 100"
}
}

0 comments on commit 97899bb

Please sign in to comment.