Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/provider: Migrate additional tests to newer ProviderFactories setup and PreCheck functions #15877

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Oct 28, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #7702
Reference: #8316
Reference: #15737
Reference: #15791

Release note for CHANGELOG:

NONE

This creates the remaining special ProviderFactories functions (as they need to exist currently), updates the Contributing Guide documentation, and migrates a portion of the tests over to them. Further changesets will continue these efforts by:

  • Migrating the rest of the awsalternate provider test configurations to testAccProviderFactoriesAlternate()
  • Migrating the rest of the testAccMultipleRegionsPreCheck() and testAccAlternateRegionPreCheck() usage to testAccMultipleRegionPreCheck() (bundling with the above as its fairly common together)
  • Flipping testAccProviderFactories to a variable with only the aws provider and replacing testAccProviderFactoriesEc2Classic and testAccProviderFactoriesCur()
  • Continuing efforts to remove environment variable handling in test functions

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAwsBackupPlan_Rule_CopyAction_CrossRegion (20.85s)

--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (157.90s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (157.61s)

# These failures are previously existing due to an AWS account migration issue and not failing due to provider initialization issues after this particular code update:

--- FAIL: TestAccAWSDBInstance_DbSubnetGroupName_RamShared (18.95s)
    resource_aws_db_instance_test.go:352: Step 1/1 error: Error running apply: 2020/10/27 23:13:26 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_RamShared (604.80s)
    resource_aws_db_instance_test.go:808: Step 1/1 error: Error running apply: 2020/10/27 21:59:55 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSDBInstance_SnapshotIdentifier_DbSubnetGroupName_RamShared (615.89s)
    resource_aws_db_instance_test.go:1437: Step 1/1 error: Error running apply: 2020/10/27 23:13:26 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName (2252.27s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_VpcSecurityGroupIds (1908.33s)

--- PASS: TestAccAWSDynamoDbTable_Replica_Multiple (766.22s)
--- PASS: TestAccAWSDynamoDbTable_Replica_Single (412.01s)

--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_basic (376.21s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_differentAccount (360.55s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_disappears (363.16s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_Tags_sameAccount (365.29s)

--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_basic_differentAccount (780.52s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_basic_sameAccount (773.52s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_Tags_sameAccount (815.32s)

--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_differentAccount (389.30s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_sameAccount (397.06s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_differentAccount (333.33s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_sameAccount (333.84s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Tags (332.99s)

--- PASS: TestAccAWSProvider_AssumeRole_Empty (16.67s)
--- PASS: TestAccAWSProvider_Endpoints (14.28s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (14.21s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (14.15s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (14.28s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (14.05s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (14.11s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (14.19s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (14.31s)
--- PASS: TestAccAWSProvider_Region_AwsChina (11.20s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (11.54s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (11.22s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAwsBackupPlan_Rule_CopyAction_CrossRegion (24.77s)

--- SKIP: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (1.52s)
--- SKIP: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (1.55s)

…etup and PreCheck functions

Reference: #8316
Reference: #15737
Reference: #15791

This creates the remaining special `ProviderFactories` functions (as they need to exist currently), updates the Contributing Guide documentation, and migrates a portion of the tests over to them. Further changesets will continue these efforts by:

* Migrating the rest of the `awsalternate` provider test configurations to `testAccProviderFactoriesAlternate()`
* Migrating the rest of the `testAccMultipleRegionsPreCheck()` and `testAccAlternateRegionPreCheck()` usage to `testAccMultipleRegionPreCheck()` (bundling with the above as its fairly common together)
* Flipping `testAccProviderFactories` to a variable with only the `aws` provider and replacing `testAccProviderFactoriesEc2Classic` and `testAccProviderFactoriesCur()`
* Continuing efforts to remove environment variable handling in test functions

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAwsBackupPlan_Rule_CopyAction_CrossRegion (20.85s)

--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (157.90s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (157.61s)

--- FAIL: TestAccAWSDBInstance_DbSubnetGroupName_RamShared (18.95s)
    resource_aws_db_instance_test.go:352: Step 1/1 error: Error running apply: 2020/10/27 23:13:26 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_RamShared (604.80s)
    resource_aws_db_instance_test.go:808: Step 1/1 error: Error running apply: 2020/10/27 21:59:55 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSDBInstance_SnapshotIdentifier_DbSubnetGroupName_RamShared (615.89s)
    resource_aws_db_instance_test.go:1437: Step 1/1 error: Error running apply: 2020/10/27 23:13:26 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName (2252.27s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_VpcSecurityGroupIds (1908.33s)

--- PASS: TestAccAWSDynamoDbTable_Replica_Multiple (766.22s)
--- PASS: TestAccAWSDynamoDbTable_Replica_Single (412.01s)

--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_basic (376.21s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_differentAccount (360.55s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_disappears (363.16s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachment_Tags_sameAccount (365.29s)

--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_basic_differentAccount (780.52s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_basic_sameAccount (773.52s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_Tags_sameAccount (815.32s)

--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_differentAccount (389.30s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_sameAccount (397.06s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_differentAccount (333.33s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_sameAccount (333.84s)
--- PASS: TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Tags (332.99s)

--- PASS: TestAccAWSProvider_AssumeRole_Empty (16.67s)
--- PASS: TestAccAWSProvider_Endpoints (14.28s)
--- PASS: TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock (14.21s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple (14.15s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_None (14.28s)
--- PASS: TestAccAWSProvider_IgnoreTags_KeyPrefixes_One (14.05s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_Multiple (14.11s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_None (14.19s)
--- PASS: TestAccAWSProvider_IgnoreTags_Keys_One (14.31s)
--- PASS: TestAccAWSProvider_Region_AwsChina (11.20s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (11.54s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (11.22s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAwsBackupPlan_Rule_CopyAction_CrossRegion (24.77s)

--- SKIP: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (1.52s)
--- SKIP: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (1.55s)
```
@bflad bflad added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Oct 28, 2020
@bflad bflad requested a review from a team October 28, 2020 04:22
@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/backup Issues and PRs that pertain to the backup service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 28, 2020
@bflad bflad added the partition/aws-us-gov Pertains to the aws-us-gov partition. label Oct 28, 2020
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic! 🎉

@bflad bflad added this to the v3.13.0 milestone Oct 28, 2020
@bflad bflad merged commit a4315ae into master Oct 28, 2020
@bflad bflad deleted the td-testAccProviderFactories-refactoring-pt2 branch October 28, 2020 19:06
bflad added a commit that referenced this pull request Oct 29, 2020
…refactor testAccProviderFactories for broad usage

Reference: #8316
Reference: #15737
Reference: #15791

This change set continues the work of #15877, bringing a consistent pattern for cross-region and cross-account testing and removing previously deprecated provider-level test functions. The `testAccProviderFactories` global variable is now generically for every test that only requires a single provider and prevents the previous issues where extraneous gRPC plugins were extraneously created (sometimes causing `ulimit` issues, but broadly a performance fix to remove them).

This also removes the temporary `testAccProviderFactoriesCur()` and `testAccProviderFactoriesEc2Classic()` functions, since anything only requiring a single provider can use `ProviderFactories: testAccProviderFactories` or `Providers: testAccProviders` (for now, its deprecated in the SDK and we'll be updating these everywhere to `ProviderFactories` anyways). This should mean that other existing EC2-Classic and special service region testing should not require changes to that particular field in future change sets that continue this effort.

After this, we are off to the races to remove the problematic environment variable handling causing issues across the provider acceptance testing.

Output from acceptance testing (CUR testing done in standalone account):

```
--- PASS: TestAccDataSourceAwsCurReportDefinition_additional (21.63s)
--- PASS: TestAccDataSourceAwsCurReportDefinition_basic (18.93s)

--- PASS: TestAccDataSourceAwsRoute53ResolverRule_basic (59.47s)
--- PASS: TestAccDataSourceAwsRoute53ResolverRule_ResolverEndpointIdWithTags (265.34s)

--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (158.62s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (159.67s)

--- PASS: TestAccAWSCodePipeline_multiregion_basic (37.37s)
--- PASS: TestAccAWSCodePipeline_multiregion_Update (58.07s)
--- PASS: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (81.33s)

--- PASS: TestAccAwsCurReportDefinition_athena (18.30s)
--- PASS: TestAccAwsCurReportDefinition_basic (23.58s)
--- PASS: TestAccAwsCurReportDefinition_overwrite (18.10s)
--- PASS: TestAccAwsCurReportDefinition_parquet (18.67s)
--- PASS: TestAccAwsCurReportDefinition_refresh (21.62s)
--- PASS: TestAccAwsCurReportDefinition_textOrCsv (21.45s)

--- PASS: TestAccAWSDbSubnetGroupDataSource_basic (66.22s)
--- PASS: TestAccAWSDbSubnetGroupDataSource_nonexistent (3.06s)

--- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewayCrossAccount (1998.47s)
--- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewaySingleAccount (1957.89s)
--- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount (865.40s)
--- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewaySingleAccount (1186.07s)
--- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount (1530.51s)
--- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount (1633.65s)
--- PASS: TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount (1697.33s)
--- PASS: TestAccAwsDxGatewayAssociation_V0StateUpgrade (1187.97s)

--- PASS: TestAccAwsDxGatewayAssociationProposal_AllowedPrefixes (138.31s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_basicTransitGateway (227.10s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_basicVpnGateway (68.42s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_disappears (64.49s)

--- SKIP: TestAccAwsDxHostedPrivateVirtualInterface_AccepterTags (0.00s)
--- SKIP: TestAccAwsDxHostedPrivateVirtualInterface_basic (0.00s)

--- SKIP: TestAccAwsDxHostedPublicVirtualInterface_AccepterTags (0.00s)
--- SKIP: TestAccAwsDxHostedPublicVirtualInterface_basic (0.00s)

--- PASS: TestAccAwsDxHostedTransitVirtualInterface_serial (0.00s)
    --- SKIP: TestAccAwsDxHostedTransitVirtualInterface_serial/accepterTags (0.00s)
    --- SKIP: TestAccAwsDxHostedTransitVirtualInterface_serial/basic (0.00s)

--- PASS: TestAccAWSDynamoDbGlobalTable_basic (84.93s)
--- PASS: TestAccAWSDynamoDbGlobalTable_multipleRegions (102.52s)

--- PASS: TestAccAWSEbsSnapshotCopy_withRegions (75.67s)

--- PASS: TestAccAwsRamResourceShareAccepter_basic (36.70s)

--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_PrimarySecondaryClusters (1969.60s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier (1819.35s)

--- PASS: TestAccAWSRDSCluster_ReplicationSourceIdentifier_KmsKeyId (1691.11s)

--- PASS: TestAccAWSRedshiftCluster_snapshotCopy (631.18s)

--- PASS: TestAccAWSRedshiftSecurityGroup_basic (11.11s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressCidr (11.10s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup (12.47s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressCidr (23.94s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup (27.22s)

--- PASS: TestAccAWSRoute53VpcAssociationAuthorization_basic (99.00s)
--- PASS: TestAccAWSRoute53VpcAssociationAuthorization_disappears (94.43s)

--- PASS: TestAccAWSRoute53ZoneAssociation_CrossAccount (124.58s)
--- PASS: TestAccAWSRoute53ZoneAssociation_CrossRegion (157.69s)

--- PASS: TestAccAWSS3Bucket_Replication (145.26s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (86.49s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (84.75s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (22.79s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (174.11s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (65.38s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (85.05s)
--- PASS: TestAccAWSS3Bucket_SameRegionReplicationSchemaV2 (73.58s)

--- PASS: TestAccAWSSubnet_ignoreTags (86.24s)

--- PASS: TestAccAWSVPCPeeringConnection_accept (144.21s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (65.98s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (12.38s)
--- PASS: TestAccAWSVPCPeeringConnection_options (117.22s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (29.07s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (29.13s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (52.19s)
--- PASS: TestAccAWSVPCPeeringConnection_region (70.00s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (150.89s)

--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionDifferentAccount (68.06s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount (83.92s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount (64.85s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount (56.44s)

--- PASS: TestAccAWSVpcPeeringConnectionOptions_basic (70.42s)
--- PASS: TestAccAWSVpcPeeringConnectionOptions_differentRegionSameAccount (75.28s)
--- PASS: TestAccAWSVpcPeeringConnectionOptions_sameRegionDifferentAccount (41.96s)

--- FAIL: TestAccDataSourceAwsRoute53ResolverRule_SharedByMe (227.22s)
--- FAIL: TestAccDataSourceAwsRoute53ResolverRule_SharedWithMe (228.00s)

    data_source_aws_route53_resolver_rule_test.go:101: Step 1/1 error: Error running apply: 2020/10/28 22:02:11 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachment_SharedTransitGateway (221.84s)

    resource_aws_ec2_transit_gateway_vpc_attachment_test.go:215: Step 1/2 error: Error running apply: 2020/10/28 22:02:10 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_Tags (201.45s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_TransitGatewayDefaultRouteTableAssociationAndPropagation (211.45s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_basic (221.42s)

    resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go:135: Step 1/4 error: Error running apply: 2020/10/28 22:02:11 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: error associating RAM Resource Share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: Error associating principal with RAM resource share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.
```
@ghost
Copy link

ghost commented Oct 29, 2020

This has been released in version 3.13.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

bflad added a commit that referenced this pull request Nov 2, 2020
…refactor testAccProviderFactories for broad usage (#15904)

Reference: #8316
Reference: #15737
Reference: #15791

This change set continues the work of #15877, bringing a consistent pattern for cross-region and cross-account testing and removing previously deprecated provider-level test functions. The `testAccProviderFactories` global variable is now generically for every test that only requires a single provider and prevents the previous issues where extraneous gRPC plugins were extraneously created (sometimes causing `ulimit` issues, but broadly a performance fix to remove them).

This also removes the temporary `testAccProviderFactoriesCur()` and `testAccProviderFactoriesEc2Classic()` functions, since anything only requiring a single provider can use `ProviderFactories: testAccProviderFactories` or `Providers: testAccProviders` (for now, its deprecated in the SDK and we'll be updating these everywhere to `ProviderFactories` anyways). This should mean that other existing EC2-Classic and special service region testing should not require changes to that particular field in future change sets that continue this effort.

After this, we are off to the races to remove the problematic environment variable handling causing issues across the provider acceptance testing.

Output from acceptance testing (CUR testing done in standalone account):

```
--- PASS: TestAccDataSourceAwsCurReportDefinition_additional (21.63s)
--- PASS: TestAccDataSourceAwsCurReportDefinition_basic (18.93s)

--- PASS: TestAccDataSourceAwsRoute53ResolverRule_basic (59.47s)
--- PASS: TestAccDataSourceAwsRoute53ResolverRule_ResolverEndpointIdWithTags (265.34s)

--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (158.62s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (159.67s)

--- PASS: TestAccAWSCodePipeline_multiregion_basic (37.37s)
--- PASS: TestAccAWSCodePipeline_multiregion_Update (58.07s)
--- PASS: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (81.33s)

--- PASS: TestAccAwsCurReportDefinition_athena (18.30s)
--- PASS: TestAccAwsCurReportDefinition_basic (23.58s)
--- PASS: TestAccAwsCurReportDefinition_overwrite (18.10s)
--- PASS: TestAccAwsCurReportDefinition_parquet (18.67s)
--- PASS: TestAccAwsCurReportDefinition_refresh (21.62s)
--- PASS: TestAccAwsCurReportDefinition_textOrCsv (21.45s)

--- PASS: TestAccAWSDbSubnetGroupDataSource_basic (66.22s)
--- PASS: TestAccAWSDbSubnetGroupDataSource_nonexistent (3.06s)

--- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewayCrossAccount (1998.47s)
--- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewaySingleAccount (1957.89s)
--- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount (865.40s)
--- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewaySingleAccount (1186.07s)
--- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount (1530.51s)
--- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount (1633.65s)
--- PASS: TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount (1697.33s)
--- PASS: TestAccAwsDxGatewayAssociation_V0StateUpgrade (1187.97s)

--- PASS: TestAccAwsDxGatewayAssociationProposal_AllowedPrefixes (138.31s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_basicTransitGateway (227.10s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_basicVpnGateway (68.42s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_disappears (64.49s)

--- SKIP: TestAccAwsDxHostedPrivateVirtualInterface_AccepterTags (0.00s)
--- SKIP: TestAccAwsDxHostedPrivateVirtualInterface_basic (0.00s)

--- SKIP: TestAccAwsDxHostedPublicVirtualInterface_AccepterTags (0.00s)
--- SKIP: TestAccAwsDxHostedPublicVirtualInterface_basic (0.00s)

--- PASS: TestAccAwsDxHostedTransitVirtualInterface_serial (0.00s)
    --- SKIP: TestAccAwsDxHostedTransitVirtualInterface_serial/accepterTags (0.00s)
    --- SKIP: TestAccAwsDxHostedTransitVirtualInterface_serial/basic (0.00s)

--- PASS: TestAccAWSDynamoDbGlobalTable_basic (84.93s)
--- PASS: TestAccAWSDynamoDbGlobalTable_multipleRegions (102.52s)

--- PASS: TestAccAWSEbsSnapshotCopy_withRegions (75.67s)

--- PASS: TestAccAwsRamResourceShareAccepter_basic (36.70s)

--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_PrimarySecondaryClusters (1969.60s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier (1819.35s)

--- PASS: TestAccAWSRDSCluster_ReplicationSourceIdentifier_KmsKeyId (1691.11s)

--- PASS: TestAccAWSRedshiftCluster_snapshotCopy (631.18s)

--- PASS: TestAccAWSRedshiftSecurityGroup_basic (11.11s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressCidr (11.10s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup (12.47s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressCidr (23.94s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup (27.22s)

--- PASS: TestAccAWSRoute53VpcAssociationAuthorization_basic (99.00s)
--- PASS: TestAccAWSRoute53VpcAssociationAuthorization_disappears (94.43s)

--- PASS: TestAccAWSRoute53ZoneAssociation_CrossAccount (124.58s)
--- PASS: TestAccAWSRoute53ZoneAssociation_CrossRegion (157.69s)

--- PASS: TestAccAWSS3Bucket_Replication (145.26s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (86.49s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (84.75s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (22.79s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (174.11s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (65.38s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (85.05s)
--- PASS: TestAccAWSS3Bucket_SameRegionReplicationSchemaV2 (73.58s)

--- PASS: TestAccAWSSubnet_ignoreTags (86.24s)

--- PASS: TestAccAWSVPCPeeringConnection_accept (144.21s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (65.98s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (12.38s)
--- PASS: TestAccAWSVPCPeeringConnection_options (117.22s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (29.07s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (29.13s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (52.19s)
--- PASS: TestAccAWSVPCPeeringConnection_region (70.00s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (150.89s)

--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionDifferentAccount (68.06s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount (83.92s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount (64.85s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount (56.44s)

--- PASS: TestAccAWSVpcPeeringConnectionOptions_basic (70.42s)
--- PASS: TestAccAWSVpcPeeringConnectionOptions_differentRegionSameAccount (75.28s)
--- PASS: TestAccAWSVpcPeeringConnectionOptions_sameRegionDifferentAccount (41.96s)

--- FAIL: TestAccDataSourceAwsRoute53ResolverRule_SharedByMe (227.22s)
--- FAIL: TestAccDataSourceAwsRoute53ResolverRule_SharedWithMe (228.00s)

    data_source_aws_route53_resolver_rule_test.go:101: Step 1/1 error: Error running apply: 2020/10/28 22:02:11 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachment_SharedTransitGateway (221.84s)

    resource_aws_ec2_transit_gateway_vpc_attachment_test.go:215: Step 1/2 error: Error running apply: 2020/10/28 22:02:10 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_Tags (201.45s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_TransitGatewayDefaultRouteTableAssociationAndPropagation (211.45s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_basic (221.42s)

    resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go:135: Step 1/4 error: Error running apply: 2020/10/28 22:02:11 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: error associating RAM Resource Share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: Error associating principal with RAM resource share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.
```
@ghost
Copy link

ghost commented Nov 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. partition/aws-us-gov Pertains to the aws-us-gov partition. provider Pertains to the provider itself, rather than any interaction with AWS. service/backup Issues and PRs that pertain to the backup service. service/cloudfront Issues and PRs that pertain to the cloudfront service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/rds Issues and PRs that pertain to the rds service. size/L Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants