Skip to content

Commit

Permalink
docs: add usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Apr 1, 2024
1 parent c2ce509 commit ed934ee
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ The [Assert Terraform provider]((https://registry.terraform.io/providers/bschaat

## Usage

## Terraform Test

```hcl
terraform {
required_providers {
assert = {
source = "bschaatsbergen/assert"
version = "0.1.0"
}
run "ebs_volume_size" {
command = plan
assert {
condition = provider::assert::between(1, 100, aws_ebs_volume.example.size)
error_message = "EBS volume size must be between 1 and 100 GiB"
}
}
```

data "http" "example" {
url = "https://developer.hashicorp.com"
}
## Variable Validation

output "is_redirected" {
value = provider::assert::http_redirect(data.http.example.status_code)
```hcl
variable "ebs_volume_size" {
type = number
validation {
condition = provider::assert::between(1, 100, aws_ebs_volume.example.size)
error_message = "EBS volume size must be between 1 and 100 GiB"
}
}
```

Expand Down

0 comments on commit ed934ee

Please sign in to comment.