-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enabled check to data source (#45)
Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
- Loading branch information
1 parent
d86dbaf
commit ea635c3
Showing
10 changed files
with
1,496 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
enabled = true | ||
|
||
region = "us-east-2" | ||
|
||
namespace = "eg" | ||
|
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
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 @@ | ||
package test | ||
|
||
import ( | ||
"math/rand" | ||
"strconv" | ||
"testing" | ||
"time" | ||
"strings" | ||
|
||
"github.com/gruntwork-io/terratest/modules/terraform" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func testNoChanges(t *testing.T, terraformDir string) { | ||
rand.Seed(time.Now().UnixNano()) | ||
randID := strconv.Itoa(rand.Intn(100000)) | ||
attributes := []string{randID} | ||
|
||
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ | ||
// The path to where our Terraform code is located | ||
TerraformDir: terraformDir, | ||
Upgrade: true, | ||
// Variables to pass to our Terraform code using -var-file options | ||
VarFiles: []string{"fixtures.us-east-2.tfvars"}, | ||
// We always include a random attribute so that parallel tests | ||
// and AWS resources do not interfere with each other | ||
Vars: map[string]interface{}{ | ||
"enabled": false, | ||
"attributes": attributes, | ||
}, | ||
}) | ||
|
||
terraform.Init(t, terraformOptions) | ||
plan := terraform.Plan(t, terraformOptions) | ||
planContainsNoChanges := strings.Contains(plan, "No changes.") || strings.Contains(plan, "0 to add, 0 to change, 0 to destroy.") | ||
|
||
assert.True(t, planContainsNoChanges) | ||
} | ||
|
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,14 +1,25 @@ | ||
module github.com/cloudposse/terraform-aws-elasticache-redis | ||
module github.com/cloudposse/terraform-aws-iam-role | ||
|
||
go 1.14 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/aws/aws-sdk-go v1.34.6 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/google/uuid v1.1.1 // indirect | ||
github.com/gruntwork-io/terratest v0.16.0 | ||
github.com/pquerna/otp v1.2.0 // indirect | ||
github.com/stretchr/testify v1.5.1 | ||
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f // indirect | ||
golang.org/x/sys v0.0.0-20190527104216-9cd6430ef91e // indirect | ||
cloud.google.com/go v0.101.0 // indirect | ||
cloud.google.com/go/compute v1.6.1 // indirect | ||
github.com/aws/aws-sdk-go v1.43.44 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/gruntwork-io/terratest v0.40.7 | ||
github.com/hashicorp/errwrap v1.1.0 // indirect | ||
github.com/hashicorp/go-getter v1.5.11 // indirect | ||
github.com/hashicorp/go-multierror v1.1.1 // indirect | ||
github.com/hashicorp/go-version v1.4.0 // indirect | ||
github.com/jinzhu/copier v0.3.5 // indirect | ||
github.com/klauspost/compress v1.15.1 // indirect | ||
github.com/mattn/go-zglob v0.0.3 // indirect | ||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect | ||
github.com/stretchr/testify v1.7.1 | ||
github.com/tmccombs/hcl2json v0.3.4 // indirect | ||
github.com/ulikunitz/xz v0.5.10 // indirect | ||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect | ||
golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 // indirect | ||
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect | ||
) |
Oops, something went wrong.