mirror of
https://github.com/hashicorp/terraform.git
synced 2026-03-22 10:31:22 -04:00
29 lines
504 B
HCL
29 lines
504 B
HCL
|
|
mock_provider "test" {
|
||
|
|
mock_resource "test_resource" {
|
||
|
|
defaults = {
|
||
|
|
id = format("f-%s", "foo")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
override_resource {
|
||
|
|
target = test_resource.bar
|
||
|
|
values = {
|
||
|
|
id = format("%s-%s", uuid(), "bar")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
run "validate_test_resource_foo" {
|
||
|
|
assert {
|
||
|
|
condition = test_resource.foo.id == "f-foo"
|
||
|
|
error_message = "invalid value"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
run "validate_test_resource_bar" {
|
||
|
|
assert {
|
||
|
|
condition = length(test_resource.bar.id) > 10
|
||
|
|
error_message = "invalid value"
|
||
|
|
}
|
||
|
|
}
|