Skip to content

Commit

Permalink
Use 'acctest.RandomWithPrefix(tf-acc-test)' for resource names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Mar 6, 2020
1 parent b41e6de commit 1f4dd79
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 85 deletions.
38 changes: 19 additions & 19 deletions aws/data_source_aws_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestAccAWSInstanceDataSource_basic(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m1.small"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -41,7 +41,7 @@ func TestAccAWSInstanceDataSource_basic(t *testing.T) {
func TestAccAWSInstanceDataSource_tags(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
rInt := acctest.RandInt()
instanceType := "m1.small"

Expand Down Expand Up @@ -69,7 +69,7 @@ func TestAccAWSInstanceDataSource_tags(t *testing.T) {
func TestAccAWSInstanceDataSource_AzUserData(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m1.small"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -98,7 +98,7 @@ func TestAccAWSInstanceDataSource_AzUserData(t *testing.T) {
func TestAccAWSInstanceDataSource_gp2IopsDevice(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m3.medium"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestAccAWSInstanceDataSource_gp2IopsDevice(t *testing.T) {
func TestAccAWSInstanceDataSource_blockDevices(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m3.medium"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestAccAWSInstanceDataSource_blockDevices(t *testing.T) {

// Test to verify that ebs_block_device kms_key_id does not elicit a panic
func TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId(t *testing.T) {
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
// See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances.
instanceType := "m3.medium"

Expand All @@ -181,7 +181,7 @@ func TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId(t *testing.T) {

// Test to verify that root_block_device kms_key_id does not elicit a panic
func TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId(t *testing.T) {
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
// See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances.
instanceType := "m3.medium"

Expand All @@ -204,7 +204,7 @@ func TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId(t *testing.T) {
func TestAccAWSInstanceDataSource_rootInstanceStore(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m3.medium"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -233,7 +233,7 @@ func TestAccAWSInstanceDataSource_rootInstanceStore(t *testing.T) {
func TestAccAWSInstanceDataSource_privateIP(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -255,7 +255,7 @@ func TestAccAWSInstanceDataSource_privateIP(t *testing.T) {
func TestAccAWSInstanceDataSource_keyPair(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t1.micro"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -283,7 +283,7 @@ func TestAccAWSInstanceDataSource_keyPair(t *testing.T) {
func TestAccAWSInstanceDataSource_VPC(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m1.small"

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -307,7 +307,7 @@ func TestAccAWSInstanceDataSource_VPC(t *testing.T) {
func TestAccAWSInstanceDataSource_PlacementGroup(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "c3.large"

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -327,7 +327,7 @@ func TestAccAWSInstanceDataSource_PlacementGroup(t *testing.T) {
func TestAccAWSInstanceDataSource_Ec2ClassicSecurityGroups(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "m1.small"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -355,7 +355,7 @@ func TestAccAWSInstanceDataSource_Ec2ClassicSecurityGroups(t *testing.T) {
func TestAccAWSInstanceDataSource_VPCSecurityGroups(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t1.micro"

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -377,7 +377,7 @@ func TestAccAWSInstanceDataSource_VPCSecurityGroups(t *testing.T) {

func TestAccAWSInstanceDataSource_getPasswordData_trueToFalse(t *testing.T) {
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.medium"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -411,7 +411,7 @@ func TestAccAWSInstanceDataSource_getPasswordData_trueToFalse(t *testing.T) {

func TestAccAWSInstanceDataSource_getPasswordData_falseToTrue(t *testing.T) {
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.medium"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -445,7 +445,7 @@ func TestAccAWSInstanceDataSource_getPasswordData_falseToTrue(t *testing.T) {

func TestAccAWSInstanceDataSource_GetUserData(t *testing.T) {
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -480,7 +480,7 @@ func TestAccAWSInstanceDataSource_GetUserData(t *testing.T) {
func TestAccAWSInstanceDataSource_GetUserData_NoUserData(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -518,7 +518,7 @@ func TestAccAWSInstanceDataSource_GetUserData_NoUserData(t *testing.T) {
func TestAccAWSInstanceDataSource_creditSpecification(t *testing.T) {
resourceName := "aws_instance.test"
datasourceName := "data.aws_instance.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand Down
6 changes: 3 additions & 3 deletions aws/data_source_aws_instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestAccAWSInstancesDataSource_basic(t *testing.T) {
datasourceName := "data.aws_instances.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -39,7 +39,7 @@ func TestAccAWSInstancesDataSource_basic(t *testing.T) {

func TestAccAWSInstancesDataSource_tags(t *testing.T) {
datasourceName := "data.aws_instances.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -63,7 +63,7 @@ func TestAccAWSInstancesDataSource_tags(t *testing.T) {

func TestAccAWSInstancesDataSource_instance_state_names(t *testing.T) {
datasourceName := "data.aws_instances.test"
rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlphaNum))
rName := acctest.RandomWithPrefix("tf-acc-test")
instanceType := "t2.micro"

resource.ParallelTest(t, resource.TestCase{
Expand Down
Loading

0 comments on commit 1f4dd79

Please sign in to comment.