generated from makandra/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a645ff8
commit 2a39cb9
Showing
7 changed files
with
138 additions
and
15 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
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
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,39 @@ | ||
mock_provider "aws" {} | ||
|
||
run "dont_create_resources_without_input" { | ||
variables { | ||
query_bucket_name = "test" | ||
} | ||
assert { | ||
condition = length(local.named_queries.cloudfront) == 0 | ||
error_message = "local.named_queries.cloudfront should have 0 elements, but has ${length(local.named_queries.cloudfront)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_database.cloudfront) == 0 | ||
error_message = "aws_athena_database.cloudfront should have 0 instances, but has ${length(aws_athena_database.cloudfront)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_named_query.cloudfront) == 0 | ||
error_message = "aws_athena_named_query.cloudfront should have 0 instances, but has ${length(aws_athena_database.cloudfront)}" | ||
} | ||
} | ||
|
||
run "create_resources_with_correct_input" { | ||
variables { | ||
query_bucket_name = "test" | ||
cloudfront = "cloudfront-bucket" | ||
} | ||
|
||
assert { | ||
condition = length(local.named_queries.cloudfront) != 0 | ||
error_message = "local.named_queries.cloudfront should not have 0 elements" | ||
} | ||
assert { | ||
condition = length(aws_athena_database.cloudfront) == 1 | ||
error_message = "aws_athena_database.cloudfront should have 1 instance, but has ${length(aws_athena_database.cloudfront)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_named_query.cloudfront) != 0 | ||
error_message = "aws_athena_named_query.cloudfront should not have 0 element" | ||
} | ||
} |
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,41 @@ | ||
mock_provider "aws" {} | ||
|
||
run "dont_create_resources_without_input" { | ||
variables { | ||
query_bucket_name = "test" | ||
} | ||
assert { | ||
condition = length(local.named_queries.cloudtrail) == 0 | ||
error_message = "local.named_queries.cloudtrail should have 0 elements, but has ${length(local.named_queries.cloudtrail)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_database.cloudtrail) == 0 | ||
error_message = "aws_athena_database.cloudtrail should have 0 instances, but has ${length(aws_athena_database.cloudtrail)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_named_query.cloudtrail) == 0 | ||
error_message = "aws_athena_named_query.cloudtrail should have 0 instances, but has ${length(aws_athena_database.cloudtrail)}" | ||
} | ||
} | ||
|
||
run "create_resources_with_correct_input" { | ||
variables { | ||
query_bucket_name = "test" | ||
cloudtrail = { | ||
bucket_name = "cloudtrail-bucket" | ||
} | ||
} | ||
|
||
assert { | ||
condition = length(local.named_queries.cloudtrail) != 0 | ||
error_message = "local.named_queries.cloudtrail should not have 0 elements" | ||
} | ||
assert { | ||
condition = length(aws_athena_database.cloudtrail) == 1 | ||
error_message = "aws_athena_database.cloudtrail should have 1 instance, but has ${length(aws_athena_database.cloudtrail)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_named_query.cloudtrail) != 0 | ||
error_message = "aws_athena_named_query.cloudtrail should not have 0 element" | ||
} | ||
} |
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,39 @@ | ||
mock_provider "aws" {} | ||
|
||
run "dont_create_resources_without_input" { | ||
variables { | ||
query_bucket_name = "test" | ||
} | ||
assert { | ||
condition = length(local.named_queries.ses) == 0 | ||
error_message = "local.named_queries.ses should have 0 elements, but has ${length(local.named_queries.ses)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_database.ses) == 0 | ||
error_message = "aws_athena_database.ses should have 0 instances, but has ${length(aws_athena_database.ses)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_named_query.ses) == 0 | ||
error_message = "aws_athena_named_query.ses should have 0 instances, but has ${length(aws_athena_database.ses)}" | ||
} | ||
} | ||
|
||
run "create_resources_with_correct_input" { | ||
variables { | ||
query_bucket_name = "test" | ||
ses = "ses-bucket" | ||
} | ||
|
||
assert { | ||
condition = length(local.named_queries.ses) != 0 | ||
error_message = "local.named_queries.ses should not have 0 elements" | ||
} | ||
assert { | ||
condition = length(aws_athena_database.ses) == 1 | ||
error_message = "aws_athena_database.ses should have 1 instance, but has ${length(aws_athena_database.ses)}" | ||
} | ||
assert { | ||
condition = length(aws_athena_named_query.ses) != 0 | ||
error_message = "aws_athena_named_query.ses should not have 0 element" | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
terraform { | ||
required_version = ">= 1.7.0" | ||
required_version = ">= 1.6.0" | ||
required_providers { | ||
aws = { | ||
version = ">= 5.40.0" | ||
version = ">= 4.55.0" | ||
} | ||
} | ||
} |