Skip to content

Commit

Permalink
Merge branch 'main' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Sep 14, 2023
2 parents 6a2467a + cb8c8ea commit 73ea978
Show file tree
Hide file tree
Showing 63 changed files with 2,780 additions and 963 deletions.
3 changes: 3 additions & 0 deletions .changelog/32741.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_transfer_connector: Add `sftp_config` argument and make `as2_config` optional
```
3 changes: 3 additions & 0 deletions .changelog/33375.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_subnet: Fix destroy error when there is a lingering ENI for DMS
```
3 changes: 3 additions & 0 deletions .changelog/33413.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_neptune_cluster: Fix ignored `kms_key_arn` on restore from DB cluster snapshot
```
7 changes: 7 additions & 0 deletions .changelog/33432.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-resource
aws_shield_application_layer_automatic_response
```

```release-note:enhancement
resource/aws_wafv2_web_acl: Retry resource Update on `WAFOptimisticLockException` errors
```
3 changes: 3 additions & 0 deletions .changelog/33448.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_servicecatalog_product: Allow import on `provisioning_artifact_parameters` attribute
```
3 changes: 3 additions & 0 deletions .changelog/33456.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_dms_replication_task: Fix error when `replication_task_settings` is `nil`
```
3 changes: 3 additions & 0 deletions .changelog/33459.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_verifiedaccess_instance
```
2 changes: 1 addition & 1 deletion .ci/providerlint/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint
go 1.20

require (
github.com/aws/aws-sdk-go v1.45.7
github.com/aws/aws-sdk-go v1.45.8
github.com/bflad/tfproviderlint v0.29.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
golang.org/x/tools v0.8.0
Expand Down
4 changes: 2 additions & 2 deletions .ci/providerlint/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/aws/aws-sdk-go v1.45.7 h1:k4QsvWZhm8409TYeRuTV1P6+j3lLKoe+giFA/j3VAps=
github.com/aws/aws-sdk-go v1.45.7/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.45.8 h1:QbOMBTuRYx11fBwNSAJuztXmQf47deFz+CVYjakqmRo=
github.com/aws/aws-sdk-go v1.45.8/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU=
github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA=
github.com/bflad/tfproviderlint v0.29.0 h1:zxKYAAM6IZ4ace1a3LX+uzMRIMP8L+iOtEc+FP2Yoow=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .ci/providerlint/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ github.com/agext/levenshtein
# github.com/apparentlymart/go-textseg/v15 v15.0.0
## explicit; go 1.16
github.com/apparentlymart/go-textseg/v15/textseg
# github.com/aws/aws-sdk-go v1.45.7
# github.com/aws/aws-sdk-go v1.45.8
## explicit; go 1.11
github.com/aws/aws-sdk-go/aws/awserr
github.com/aws/aws-sdk-go/aws/endpoints
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ NOTES:

* data-source/aws_s3_object: Migration to [AWS SDK for Go v2](https://aws.github.io/aws-sdk-go-v2/) means that the edge case of specifying a single `/` as the value for `key` is no longer supported ([#33358](https://github.com/hashicorp/terraform-provider-aws/issues/33358))

FEATURES:

* **New Resource:** `aws_shield_application_layer_automatic_response` ([#33432](https://github.com/hashicorp/terraform-provider-aws/issues/33432))

ENHANCEMENTS:

* data-source/aws_s3_object: Add `checksum_mode` argument and `checksum_crc32`, `checksum_crc32c`, `checksum_sha1` and `checksum_sha256` attributes ([#33358](https://github.com/hashicorp/terraform-provider-aws/issues/33358))
Expand All @@ -12,6 +16,15 @@ ENHANCEMENTS:
* resource/aws_s3_object_copy: Add `checksum_algorithm` argument and `checksum_crc32`, `checksum_crc32c`, `checksum_sha1` and `checksum_sha256` attributes ([#33358](https://github.com/hashicorp/terraform-provider-aws/issues/33358))
* resource/aws_s3control_multi_region_access_point: Add `details.region.bucket_account_id` argument to support [cross-account Multi-Region Access Points](https://docs.aws.amazon.com/AmazonS3/latest/userguide/multi-region-access-point-buckets.html) ([#33416](https://github.com/hashicorp/terraform-provider-aws/issues/33416))
* resource/aws_s3control_multi_region_access_point: Add `details.region.region` attribute ([#33416](https://github.com/hashicorp/terraform-provider-aws/issues/33416))
* resource/aws_transfer_connector: Add `sftp_config` argument and make `as2_config` optional ([#32741](https://github.com/hashicorp/terraform-provider-aws/issues/32741))
* resource/aws_wafv2_web_acl: Retry resource Update on `WAFOptimisticLockException` errors ([#33432](https://github.com/hashicorp/terraform-provider-aws/issues/33432))

BUG FIXES:

* resource/aws_dms_replication_task: Fix error when `replication_task_settings` is `nil` ([#33456](https://github.com/hashicorp/terraform-provider-aws/issues/33456))
* resource/aws_neptune_cluster: Fix ignored `kms_key_arn` on restore from DB cluster snapshot ([#33413](https://github.com/hashicorp/terraform-provider-aws/issues/33413))
* resource/aws_servicecatalog_product: Allow import on `provisioning_artifact_parameters` attribute ([#33448](https://github.com/hashicorp/terraform-provider-aws/issues/33448))
* resource/aws_subnet: Fix destroy error when there is a lingering ENI for DMS ([#33375](https://github.com/hashicorp/terraform-provider-aws/issues/33375))

## 5.16.2 (September 11, 2023)

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95
github.com/YakDriver/regexache v0.23.0
github.com/aws/aws-sdk-go v1.45.7
github.com/aws/aws-sdk-go v1.45.8
github.com/aws/aws-sdk-go-v2 v1.21.0
github.com/aws/aws-sdk-go-v2/config v1.18.39
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11
Expand All @@ -25,7 +25,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.27.0
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.18.5
github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.2.5
github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0
github.com/aws/aws-sdk-go-v2/service/ec2 v1.118.0
github.com/aws/aws-sdk-go-v2/service/emrserverless v1.10.5
github.com/aws/aws-sdk-go-v2/service/finspace v1.12.0
github.com/aws/aws-sdk-go-v2/service/fis v1.15.5
Expand All @@ -36,7 +36,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.5.5
github.com/aws/aws-sdk-go-v2/service/ivschat v1.5.5
github.com/aws/aws-sdk-go-v2/service/kafka v1.22.6
github.com/aws/aws-sdk-go-v2/service/kendra v1.42.5
github.com/aws/aws-sdk-go-v2/service/kendra v1.43.0
github.com/aws/aws-sdk-go-v2/service/keyspaces v1.4.5
github.com/aws/aws-sdk-go-v2/service/lambda v1.39.5
github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.32.5
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmms
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go v1.45.7 h1:k4QsvWZhm8409TYeRuTV1P6+j3lLKoe+giFA/j3VAps=
github.com/aws/aws-sdk-go v1.45.7/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.45.8 h1:QbOMBTuRYx11fBwNSAJuztXmQf47deFz+CVYjakqmRo=
github.com/aws/aws-sdk-go v1.45.8/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc=
github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 h1:OPLEkmhXf6xFPiz0bLeDArZIDx1NNS4oJyG4nv3Gct0=
Expand Down Expand Up @@ -74,8 +74,8 @@ github.com/aws/aws-sdk-go-v2/service/directoryservice v1.18.5 h1:prlnnmX0PYoho7c
github.com/aws/aws-sdk-go-v2/service/directoryservice v1.18.5/go.mod h1:/kl14i35MzBB4oaVlmFVmTvdzTX5LiphIuRLyOJfoRU=
github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.2.5 h1:g3uG25wRpQTKplIgleFOnWmHF35LlZ1EJ/S1pvdgNL8=
github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.2.5/go.mod h1:XLn8/EbqX+qGri306t4IPUBi+VmphNcsR+OJRxPlGqg=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 h1:Yq39vbwQX+Xw+Ubcsg/ElwO+TWAxAIAdrREtpjGnCHw=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.118.0 h1:ueSJS07XpOwCFhYTHh/Jjw856+U+u0Dv5LIIPOB1/Ns=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.118.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0=
github.com/aws/aws-sdk-go-v2/service/emrserverless v1.10.5 h1:hhQPiPD696RlbY56NsMYVnVsS9ySrZc6eYC9yafauPk=
github.com/aws/aws-sdk-go-v2/service/emrserverless v1.10.5/go.mod h1:uRIY0k05TXMGGlHeRxDDhWT9oBqcGbbEBN3gqk9Njos=
github.com/aws/aws-sdk-go-v2/service/finspace v1.12.0 h1:qFaAEplUoebyUb2m0I3IgPK9hEZYL2zSDIW9lGMdfe4=
Expand Down Expand Up @@ -108,8 +108,8 @@ github.com/aws/aws-sdk-go-v2/service/ivschat v1.5.5 h1:K4jLfsb6qc9HMJiM/ZnN8mT/O
github.com/aws/aws-sdk-go-v2/service/ivschat v1.5.5/go.mod h1:xHhVCdz3qnP1/7wVdx9fJGKVHcOpZcIu2pAe6aOBe+c=
github.com/aws/aws-sdk-go-v2/service/kafka v1.22.6 h1:DyJVI9uQB+mO4IuKEE4AloqOvo9XFg7olhZkwWZJ7wc=
github.com/aws/aws-sdk-go-v2/service/kafka v1.22.6/go.mod h1:uXijjFwDzFVyGUwtXqqEPV/SxxLPrh0LqJxe64Csr7E=
github.com/aws/aws-sdk-go-v2/service/kendra v1.42.5 h1:Ieo1GoXJ4Dv/zbpsoeHzA2zSMRSJNRGeVBQLia9trBg=
github.com/aws/aws-sdk-go-v2/service/kendra v1.42.5/go.mod h1:q/QiSWwiP6iYTbRV5Tng7+x9MTMFxzwawh3uIyFcD+A=
github.com/aws/aws-sdk-go-v2/service/kendra v1.43.0 h1:J3qPbUB5ZRz0WJNKvbZRPakqMssV55yn6Ignn/PWXm4=
github.com/aws/aws-sdk-go-v2/service/kendra v1.43.0/go.mod h1:q/QiSWwiP6iYTbRV5Tng7+x9MTMFxzwawh3uIyFcD+A=
github.com/aws/aws-sdk-go-v2/service/keyspaces v1.4.5 h1:Z4qTRZdPJHmd5yGdY/4dL712MF5A/PvtfJS8JFcYrow=
github.com/aws/aws-sdk-go-v2/service/keyspaces v1.4.5/go.mod h1:q+dIzmt9fMxRXiTFs8dlIvHtmor246UzM82hW5Gpz0U=
github.com/aws/aws-sdk-go-v2/service/lambda v1.39.5 h1:uMvxJFS92hNW6BRX0Ou+5zb9DskgrJQHZ+5yT8FXK5Y=
Expand Down
25 changes: 25 additions & 0 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/outposts"
"github.com/aws/aws-sdk-go/service/ssoadmin"
"github.com/aws/aws-sdk-go/service/wafv2"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-go/tfprotov5"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand Down Expand Up @@ -1103,6 +1104,30 @@ func PreCheckOutpostsOutposts(ctx context.Context, t *testing.T) {
}
}

func PreCheckWAFV2CloudFrontScope(ctx context.Context, t *testing.T) {
switch Partition() {
case endpoints.AwsPartitionID:
PreCheckRegion(t, endpoints.UsEast1RegionID)
case endpoints.AwsCnPartitionID:
PreCheckRegion(t, endpoints.CnNorthwest1RegionID)
}

conn := Provider.Meta().(*conns.AWSClient).WAFV2Conn(ctx)
input := &wafv2.ListWebACLsInput{
Scope: aws.String(wafv2.ScopeCloudfront),
}

_, err := conn.ListWebACLsWithContext(ctx, input)

if PreCheckSkipError(err) {
t.Skipf("skipping acceptance testing: %s", err)
}

if err != nil {
t.Fatalf("unexpected PreCheck error: %s", err)
}
}

func ConfigAlternateAccountProvider() string {
//lintignore:AT004
return ConfigNamedAccountProvider(
Expand Down
13 changes: 0 additions & 13 deletions internal/conns/awsclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import (
"sync"

aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws"
aws_sdkv1 "github.com/aws/aws-sdk-go/aws"
endpoints_sdkv1 "github.com/aws/aws-sdk-go/aws/endpoints"
session_sdkv1 "github.com/aws/aws-sdk-go/aws/session"
apigatewayv2_sdkv1 "github.com/aws/aws-sdk-go/service/apigatewayv2"
mediaconvert_sdkv1 "github.com/aws/aws-sdk-go/service/mediaconvert"
s3_sdkv1 "github.com/aws/aws-sdk-go/service/s3"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/names"
)
Expand Down Expand Up @@ -63,17 +61,6 @@ func (client *AWSClient) S3UsePathStyle() bool {
return client.s3UsePathStyle
}

// ****************
// TODO: REVIEW
// TODO: AWS SDK for Go v2 does NO URL cleaning.
// ****************
func (client *AWSClient) S3ConnURICleaningDisabled(ctx context.Context) *s3_sdkv1.S3 {
config := client.S3Conn(ctx).Config
config.DisableRestProtocolURICleaning = aws_sdkv1.Bool(true)

return s3_sdkv1.New(client.Session.Copy(&config))
}

// SetHTTPClient sets the http.Client used for AWS API calls.
// To have effect it must be called before the AWS SDK v1 Session is created.
func (client *AWSClient) SetHTTPClient(httpClient *http.Client) {
Expand Down
6 changes: 5 additions & 1 deletion internal/service/dms/replication_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ func resourceReplicationTaskUpdate(ctx context.Context, d *schema.ResourceData,
}

if d.HasChange("replication_task_settings") {
input.ReplicationTaskSettings = aws.String(d.Get("replication_task_settings").(string))
if v, ok := d.Get("replication_task_settings").(string); ok && v != "" {
input.ReplicationTaskSettings = aws.String(v)
} else {
input.ReplicationTaskSettings = nil
}
}

status := d.Get("status").(string)
Expand Down
1 change: 1 addition & 0 deletions internal/service/ec2/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const (
errCodeInvalidTransitGatewayPolicyTableIdNotFound = "InvalidTransitGatewayPolicyTableId.NotFound"
errCodeInvalidTransitGatewayIDNotFound = "InvalidTransitGatewayID.NotFound"
errCodeInvalidTransitGatewayMulticastDomainIdNotFound = "InvalidTransitGatewayMulticastDomainId.NotFound"
errCodeInvalidVerifiedAccessInstanceIdNotFound = "InvalidVerifiedAccessInstanceId.NotFound"
errCodeInvalidVerifiedAccessTrustProviderIdNotFound = "InvalidVerifiedAccessTrustProviderId.NotFound"
errCodeInvalidVolumeNotFound = "InvalidVolume.NotFound"
errCodeInvalidVPCCIDRBlockAssociationIDNotFound = "InvalidVpcCidrBlockAssociationID.NotFound"
Expand Down
54 changes: 54 additions & 0 deletions internal/service/ec2/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -7021,6 +7021,60 @@ func FindInstanceConnectEndpointByID(ctx context.Context, conn *ec2_sdkv2.Client
return output, nil
}

func FindVerifiedAccessInstance(ctx context.Context, conn *ec2_sdkv2.Client, input *ec2_sdkv2.DescribeVerifiedAccessInstancesInput) (*awstypes.VerifiedAccessInstance, error) {
output, err := FindVerifiedAccessInstances(ctx, conn, input)

if err != nil {
return nil, err
}

return tfresource.AssertSingleValueResult(output)
}

func FindVerifiedAccessInstances(ctx context.Context, conn *ec2_sdkv2.Client, input *ec2_sdkv2.DescribeVerifiedAccessInstancesInput) ([]awstypes.VerifiedAccessInstance, error) {
var output []awstypes.VerifiedAccessInstance
paginator := ec2_sdkv2.NewDescribeVerifiedAccessInstancesPaginator(conn, input)

for paginator.HasMorePages() {
page, err := paginator.NextPage(ctx)

if tfawserr_sdkv2.ErrCodeEquals(err, errCodeInvalidVerifiedAccessInstanceIdNotFound) {
return nil, &retry.NotFoundError{
LastError: err,
LastRequest: input,
}
}

if err != nil {
return nil, err
}

output = append(output, page.VerifiedAccessInstances...)
}

return output, nil
}

func FindVerifiedAccessInstanceByID(ctx context.Context, conn *ec2_sdkv2.Client, id string) (*awstypes.VerifiedAccessInstance, error) {
input := &ec2_sdkv2.DescribeVerifiedAccessInstancesInput{
VerifiedAccessInstanceIds: []string{id},
}
output, err := FindVerifiedAccessInstance(ctx, conn, input)

if err != nil {
return nil, err
}

// Eventual consistency check.
if aws_sdkv2.ToString(output.VerifiedAccessInstanceId) != id {
return nil, &retry.NotFoundError{
LastRequest: input,
}
}

return output, nil
}

func FindVerifiedAccessTrustProvider(ctx context.Context, conn *ec2_sdkv2.Client, input *ec2_sdkv2.DescribeVerifiedAccessTrustProvidersInput) (*awstypes.VerifiedAccessTrustProvider, error) {
output, err := FindVerifiedAccessTrustProviders(ctx, conn, input)

Expand Down
8 changes: 8 additions & 0 deletions internal/service/ec2/service_package_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 73ea978

Please sign in to comment.