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

Merge hashicorp 3.34.0 into main #1

Merged
merged 1,439 commits into from
Mar 27, 2021
Merged

Conversation

vadivelselvaraj
Copy link
Owner

No description provided.

YakDriver and others added 30 commits March 19, 2021 12:13
tests/STRAGGLERS: Add ErrorCheck (Part IV - The semi-lastish one??)
…catch all InvalidAction (#18283)

Reference: #17566

Previously in AWS GovCloud (US):

```
=== CONT  TestAccAwsEc2ClientVpn_serial/NetworkAssociation_multipleSubnets
    resource_aws_ec2_client_vpn_network_association_test.go:144: Step 1/3 error: Error running apply: exit status 1

        Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service.
        	status code: 400, request id: 387e7807-e2b8-4314-9aa8-6cf2e33a0ded

          on terraform_plugin_test.tf line 61, in resource "aws_ec2_client_vpn_endpoint" "test":
          61: resource "aws_ec2_client_vpn_endpoint" "test" {

=== CONT  TestAccAwsEc2ClientVpn_serial/NetworkAssociation_securityGroups
    resource_aws_ec2_client_vpn_network_association_test.go:211: Step 1/3 error: Error running apply: exit status 1

        Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service.
        	status code: 400, request id: ad7a3b32-b650-4683-a7e0-945481550c6d

          on terraform_plugin_test.tf line 57, in resource "aws_ec2_client_vpn_endpoint" "test":
          57: resource "aws_ec2_client_vpn_endpoint" "test" {

=== CONT  TestAccAwsEc2ClientVpn_serial/NetworkAssociation_disappears
    resource_aws_ec2_client_vpn_network_association_test.go:186: Step 1/1 error: Error running apply: exit status 1

        Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service.
        	status code: 400, request id: feed7ccb-95a7-411f-b633-da58e8340392

          on terraform_plugin_test.tf line 56, in resource "aws_ec2_client_vpn_endpoint" "test":
          56: resource "aws_ec2_client_vpn_endpoint" "test" {

=== CONT  TestAccAwsEc2ClientVpn_serial/NetworkAssociation_basic
    resource_aws_ec2_client_vpn_network_association_test.go:105: Step 1/2 error: Error running apply: exit status 1

        Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service.
        	status code: 400, request id: 3f31766a-9288-4e46-9f35-6d7922e938ac

          on terraform_plugin_test.tf line 56, in resource "aws_ec2_client_vpn_endpoint" "test":
          56: resource "aws_ec2_client_vpn_endpoint" "test" {

--- FAIL: TestAccAwsEc2ClientVpn_serial (0.54s)
    --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_securityGroups (32.03s)
    --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_multipleSubnets (32.06s)
    --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_disappears (31.96s)
    --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_basic (33.01s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAwsEc2ClientVpn_serial (0.41s)
    --- SKIP: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_disappears (30.61s)
    --- SKIP: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_securityGroups (31.10s)
    --- SKIP: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_basic (31.01s)
```
…r AWS SDK Go pointer conversion (#18024)

Reference: #12992

This is akin to `*&var`, which is flagged by the Go toolchain.
…ion, enable semgrep rule to catch coding issue (#18220)

Reference: #18175
Reference: #18204

Also adds `ErrorCheck` while adjusting these tests.

Previously:

```
aws/data_source_aws_cloudfront_distribution_test.go
severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead
36:var testAccAWSCloudFrontDistributionData = fmt.Sprintf(`
37:%s
38:
39:data "aws_cloudfront_distribution" "test" {
40:  id = aws_cloudfront_distribution.s3_distribution.id
41:}
42:`, fmt.Sprintf(testAccAWSCloudFrontDistributionS3ConfigWithTags, acctest.RandInt(), originBucket, logBucket, testAccAWSCloudFrontDistributionRetainConfig()))

aws/data_source_aws_ecs_cluster_test.go
severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead
50:var testAccCheckAwsEcsClusterDataSourceConfig = fmt.Sprintf(`
51:resource "aws_ecs_cluster" "default" {
52:  name = "default-%d"
53:}
54:
55:data "aws_ecs_cluster" "default" {
56:  cluster_name = aws_ecs_cluster.default.name
57:}
58:`, acctest.RandInt())
--------------------------------------------------------------------------------
60:var testAccCheckAwsEcsClusterDataSourceConfigContainerInsights = fmt.Sprintf(`
61:resource "aws_ecs_cluster" "default" {
62:  name = "default-%d"
63:
64:  setting {
65:    name  = "containerInsights"
66:    value = "enabled"
67:  }
68:}
69:
-------- [hid 4 additional lines, adjust with --max-lines-per-finding] ---------

aws/data_source_aws_ecs_service_test.go
severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead
34:var testAccCheckAwsEcsServiceDataSourceConfig = fmt.Sprintf(`
35:resource "aws_ecs_cluster" "test" {
36:  name = "tf-acc-%d"
37:}
38:
39:resource "aws_ecs_task_definition" "test" {
40:  family = "mongodb"
41:
42:  container_definitions = <<DEFINITION
43:[
-------- [hid 24 additional lines, adjust with --max-lines-per-finding] --------

aws/resource_aws_cloudfront_distribution_test.go
severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead
1439:var testAccAWSCloudFrontDistributionCustomConfig = fmt.Sprintf(`
1440:variable rand_id {
1441:  default = %d
1442:}
1443:
1444:# log bucket
1445:%s
1446:
1447:resource "aws_cloudfront_distribution" "custom_distribution" {
1448:  origin {
-------- [hid 59 additional lines, adjust with --max-lines-per-finding] --------
1509:var testAccAWSCloudFrontDistributionOriginRequestPolicyConfigDefault = fmt.Sprintf(`
1510:variable rand_id {
1511:  default = %[1]d
1512:}
1513:
1514:# log bucket
1515:%[2]s
1516:
1517:resource "aws_cloudfront_cache_policy" "example" {
1518:  name        = "test-policy%[1]d"
------- [hid 100 additional lines, adjust with --max-lines-per-finding] --------
1620:var testAccAWSCloudFrontDistributionOriginRequestPolicyConfigOrdered = fmt.Sprintf(`
1621:variable rand_id {
1622:  default = %[1]d
1623:}
1624:
1625:# log bucket
1626:%[2]s
1627:
1628:resource "aws_cloudfront_cache_policy" "example" {
1629:  name        = "test-policy%[1]d"
------- [hid 113 additional lines, adjust with --max-lines-per-finding] --------
1744:var testAccAWSCloudFrontDistributionMultiOriginConfig = fmt.Sprintf(`
1745:variable rand_id {
1746:  default = %d
1747:}
1748:
1749:# origin bucket
1750:%s
1751:
1752:# log bucket
1753:%s
------- [hid 112 additional lines, adjust with --max-lines-per-finding] --------
1867:var testAccAWSCloudFrontDistributionNoCustomErroResponseInfo = fmt.Sprintf(`
1868:variable rand_id {
1869:  default = %d
1870:}
1871:
1872:resource "aws_cloudfront_distribution" "no_custom_error_responses" {
1873:  origin {
1874:    domain_name = "www.example.com"
1875:    origin_id   = "myCustomOrigin"
1876:
-------- [hid 50 additional lines, adjust with --max-lines-per-finding] --------
1928:var testAccAWSCloudFrontDistributionNoOptionalItemsConfig = fmt.Sprintf(`
1929:variable rand_id {
1930:  default = %d
1931:}
1932:
1933:resource "aws_cloudfront_distribution" "no_optional_items" {
1934:  origin {
1935:    domain_name = "www.example.com"
1936:    origin_id   = "myCustomOrigin"
1937:
-------- [hid 41 additional lines, adjust with --max-lines-per-finding] --------
2076:var testAccAWSCloudFrontDistributionHTTP11Config = fmt.Sprintf(`
2077:variable rand_id {
2078:  default = %d
2079:}
2080:
2081:resource "aws_cloudfront_distribution" "http_1_1" {
2082:  origin {
2083:    domain_name = "www.example.com"
2084:    origin_id   = "myCustomOrigin"
2085:
-------- [hid 47 additional lines, adjust with --max-lines-per-finding] --------
2134:var testAccAWSCloudFrontDistributionIsIPV6EnabledConfig = fmt.Sprintf(`
2135:variable rand_id {
2136:  default = %d
2137:}
2138:
2139:resource "aws_cloudfront_distribution" "is_ipv6_enabled" {
2140:  origin {
2141:    domain_name = "www.example.com"
2142:    origin_id   = "myCustomOrigin"
2143:
-------- [hid 48 additional lines, adjust with --max-lines-per-finding] --------
2193:var testAccAWSCloudFrontDistributionOrderedCacheBehavior = fmt.Sprintf(`
2194:variable rand_id {
2195:  default = %d
2196:}
2197:
2198:resource "aws_cloudfront_distribution" "main" {
2199:  origin {
2200:    domain_name = "www.hashicorp.com"
2201:    origin_id   = "myCustomOrigin"
2202:
-------- [hid 86 additional lines, adjust with --max-lines-per-finding] --------
2290:var testAccAWSCloudFrontDistributionOrderedCacheBehaviorCachePolicy = fmt.Sprintf(`
2291:variable rand_id {
2292:  default = %d
2293:}
2294:
2295:resource "aws_cloudfront_distribution" "main" {
2296:  origin {
2297:    domain_name = "www.hashicorp.com"
2298:    origin_id   = "myCustomOrigin"
2299:
-------- [hid 73 additional lines, adjust with --max-lines-per-finding] --------

aws/resource_aws_elasticache_cluster_test.go
severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead
1025:var testAccAWSElasticacheClusterInVPCConfig = fmt.Sprintf(`
1026:data "aws_availability_zones" "available" {
1027:  state = "available"
1028:
1029:  filter {
1030:    name   = "opt-in-status"
1031:    values = ["opt-in-not-required"]
1032:  }
1033:}
1034:
-------- [hid 58 additional lines, adjust with --max-lines-per-finding] --------
1094:var testAccAWSElasticacheClusterMultiAZInVPCConfig = fmt.Sprintf(`
1095:data "aws_availability_zones" "available" {
1096:  state = "available"
1097:
1098:  filter {
1099:    name   = "opt-in-status"
1100:    values = ["opt-in-not-required"]
1101:  }
1102:}
1103:
-------- [hid 65 additional lines, adjust with --max-lines-per-finding] --------

aws/resource_aws_elasticache_replication_group_test.go
severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead
1661:var testAccAWSElasticacheReplicationGroupInVPCConfig = fmt.Sprintf(`
1662:data "aws_availability_zones" "available" {
1663:  state = "available"
1664:
1665:  filter {
1666:    name   = "opt-in-status"
1667:    values = ["opt-in-not-required"]
1668:  }
1669:}
1670:
-------- [hid 49 additional lines, adjust with --max-lines-per-finding] --------
ran 12 rules on 2158 files: 17 findings
```

Output from acceptance testing:

```
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (377.36s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (202.77s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (191.20s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_RealtimeLogConfigArn (247.51s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (199.05s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (176.21s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (541.17s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (399.22s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (399.21s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (355.41s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (399.84s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (388.59s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (373.92s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (236.34s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (192.33s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_RealtimeLogConfigArn (246.39s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (371.56s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (5.01s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (0.92s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (338.79s)
--- PASS: TestAccAWSCloudFrontDistribution_originPolicyDefault (400.05s)
--- PASS: TestAccAWSCloudFrontDistribution_originPolicyOrdered (342.41s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (401.36s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (313.50s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (459.80s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (152.71s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (162.56s)
--- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (315.88s)

--- PASS: TestAccAWSDataSourceCloudFrontDistribution_basic (400.44s)

--- PASS: TestAccAWSEcsDataSource_ecsCluster (27.24s)
--- PASS: TestAccAWSEcsDataSource_ecsClusterContainerInsights (24.25s)

--- PASS: TestAccAWSEcsServiceDataSource_basic (84.98s)

--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (747.82s)
--- PASS: TestAccAWSElasticacheCluster_vpc (614.42s)

--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (805.50s)
```
changelogbot and others added 25 commits March 26, 2021 17:51
Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from v2.2 to v2.3.
- [Release notes](https://github.com/github/issue-labeler/releases)
- [Commits](github/issue-labeler@v2.2...a326d12)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…er package (#17969)

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSEFSFileSystem_kmsConfigurationWithoutEncryption (15.26s)
--- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy (29.48s)
--- PASS: TestAccAWSEFSFileSystem_disappears (37.95s)
--- PASS: TestAccAWSEFSFileSystem_kmsKey (54.93s)
--- PASS: TestAccAWSEFSFileSystem_ThroughputMode (65.88s)
--- PASS: TestAccAWSEFSFileSystem_basic (83.23s)
--- PASS: TestAccAWSEFSFileSystem_pagedTags (85.76s)
--- PASS: TestAccAWSEFSFileSystem_ProvisionedThroughputInMibps (94.41s)
--- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_removal (96.71s)
--- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_update (107.04s)
--- PASS: TestAccAWSEFSFileSystem_tags (142.76s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSEFSFileSystem_kmsConfigurationWithoutEncryption (19.51s)
--- PASS: TestAccAWSEFSFileSystem_pagedTags (58.12s)
--- PASS: TestAccAWSEFSFileSystem_kmsKey (64.15s)
--- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy (67.15s)
--- PASS: TestAccAWSEFSFileSystem_disappears (85.41s)
--- PASS: TestAccAWSEFSFileSystem_basic (95.51s)
--- PASS: TestAccAWSEFSFileSystem_ThroughputMode (101.41s)
--- PASS: TestAccAWSEFSFileSystem_ProvisionedThroughputInMibps (103.19s)
--- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_update (105.87s)
--- PASS: TestAccAWSEFSFileSystem_tags (149.67s)
--- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_removal (151.51s)
```
…-resource-retry

resource/securityhub_organization_admin_account: retry on ResourceConflictException during creation
Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteDataSource_' ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteDataSource_ -timeout 120m
=== RUN   TestAccAWSRouteDataSource_basic
=== PAUSE TestAccAWSRouteDataSource_basic
=== RUN   TestAccAWSRouteDataSource_TransitGatewayID
=== PAUSE TestAccAWSRouteDataSource_TransitGatewayID
=== RUN   TestAccAWSRouteDataSource_IPv6DestinationCidr
=== PAUSE TestAccAWSRouteDataSource_IPv6DestinationCidr
=== RUN   TestAccAWSRouteDataSource_LocalGatewayID
=== PAUSE TestAccAWSRouteDataSource_LocalGatewayID
=== CONT  TestAccAWSRouteDataSource_basic
=== CONT  TestAccAWSRouteDataSource_LocalGatewayID
    data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found
--- SKIP: TestAccAWSRouteDataSource_LocalGatewayID (2.00s)
=== CONT  TestAccAWSRouteDataSource_IPv6DestinationCidr
--- PASS: TestAccAWSRouteDataSource_IPv6DestinationCidr (24.28s)
=== CONT  TestAccAWSRouteDataSource_TransitGatewayID
--- PASS: TestAccAWSRouteDataSource_basic (328.90s)
--- PASS: TestAccAWSRouteDataSource_TransitGatewayID (305.22s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	331.596s
Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteDataSource_CarrierGatewayID' ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteDataSource_CarrierGatewayID -timeout 120m
=== RUN   TestAccAWSRouteDataSource_CarrierGatewayID
=== PAUSE TestAccAWSRouteDataSource_CarrierGatewayID
=== CONT  TestAccAWSRouteDataSource_CarrierGatewayID
--- PASS: TestAccAWSRouteDataSource_CarrierGatewayID (25.26s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	25.394s
…uit_breaker

resource/aws_ecs_service: Add support for deployment circuit breaker
@github-actions
Copy link

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

@vadivelselvaraj vadivelselvaraj merged commit 7794d68 into vadivelselvaraj:main Mar 27, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @vadivelselvaraj 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@github-actions
Copy link

Thank you for your contribution! 🚀

Please note that the CHANGELOG.md file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the Contributing Guide for additional pull request review items.

Remove any changes to the CHANGELOG.md file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.