gruntwork-io / terratest

Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.
https://terratest.gruntwork.io/
Apache License 2.0
7.47k stars 1.32k forks source link

AWS terratest-helpers #1142

Open ryanwillett12 opened 2 years ago

ryanwillett12 commented 2 years ago

Description of Project: This is a GO package that you can import into your Terraform tests (Terratest) that makes it extremely easy to validate your code by abstracting away all of the assert statements. All you have to do is pass in the values that you want to validate for the resource you are deploying. For example, if you were deploying an AWS S3 bucket you could pass in the name of the bucket, arn, bucket policy, etc. and it will validate that it is correctly built in AWS! This allows you to build with confidence and test your Terraform before deploying it to be consumed.

How will this project be valuable to developers? Terraform is a highly adopted IaC language and every language needs a testing framework. Terratest is that framework, but the benefit of the terratest-helpers is that when you deploy resources to AWS/GCP/AZURE they are built based on the inputs you pass to the terraform. This allows the terratest-helpers to take in the same inputs and validate that the resources are built correctly in the cloud provider by making api calls to validate. The reason this is possible is because when people deploy resources to a cloud provider they specify the configuration they want. It is not custom code like a JUnit is. This allows the developers to not focus on writing all of the api calls to verify the resources built correctly in the cloud provider. They just specify what resource they are building and the terratest-helper function will do all of the validation for them.

Progress: We have already written terratest-helper code for several AWS services and it is already being used within our very large company. I am reaching out to see if these can be added to the project?

lerrigatto commented 2 years ago

I am looking at validating IAM policies and I found this issue. It would be very interesting to see your terratest-helpers. Do you have a public repo?

ilithanos commented 1 year ago

I'm currently working on iam policies and came here looking to see if i should spend time adding it to the current helpers, but since this issue is already here, i'm wondering if it's worth the time writing them to get it upstream.

Have you open sourced the helpers or due to lack of interest from upstream terratest just let them stay closed source?