Skip to content

Commit

Permalink
Merge branch 'main' into HEAD
Browse files Browse the repository at this point in the history
# Conflicts:
#	tools/tfsdk2fw/go.mod
#	tools/tfsdk2fw/go.sum
  • Loading branch information
ewbankkit committed Aug 19, 2024
2 parents ccadef3 + eec36a2 commit 5595747
Show file tree
Hide file tree
Showing 285 changed files with 8,148 additions and 1,070 deletions.
3 changes: 3 additions & 0 deletions .changelog/17457.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-data-source
aws_route53_zones
```
7 changes: 7 additions & 0 deletions .changelog/38784.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
resource/aws_batch_job_queue: Add `job_state_time_limit_action` argument
```

```release-note:enhancement
data-source/aws_batch_job_queue: Add `job_state_time_limit_action` attribute
```
6 changes: 6 additions & 0 deletions .changelog/38886.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:bug
provider: Fix crash when flattening string pointer slices with nil items
```
```release-note:bug
resource/aws_quicksight_data_set: Fix crash when setting `logical_table_map.data_transforms.project_operation.projected_columns` with null list elements
```
3 changes: 3 additions & 0 deletions .changelog/38921.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_ses_configuration_set: Fix crash when `reputation_metrics_enabled` is set to `true`
```
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
## 5.64.0 (Unreleased)

FEATURES:

* **New Data Source:** `aws_route53_zones` ([#17457](https://github.com/hashicorp/terraform-provider-aws/issues/17457))

ENHANCEMENTS:

* data-source/aws_batch_job_queue: Add `job_state_time_limit_action` attribute ([#38784](https://github.com/hashicorp/terraform-provider-aws/issues/38784))
* resource/aws_batch_job_queue: Add `job_state_time_limit_action` argument ([#38784](https://github.com/hashicorp/terraform-provider-aws/issues/38784))

BUG FIXES:

* provider: Fix crash when flattening string pointer slices with nil items ([#38886](https://github.com/hashicorp/terraform-provider-aws/issues/38886))
* resource/aws_quicksight_data_set: Fix crash when setting `logical_table_map.data_transforms.project_operation.projected_columns` with null list elements ([#38886](https://github.com/hashicorp/terraform-provider-aws/issues/38886))
* resource/aws_ses_configuration_set: Fix crash when `reputation_metrics_enabled` is set to `true` ([#38921](https://github.com/hashicorp/terraform-provider-aws/issues/38921))

## 5.63.0 (August 15, 2024)

FEATURES:
Expand Down
2 changes: 1 addition & 1 deletion docs/add-a-new-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In the `internal/service/<service>/<service>.go` file you will see a `Schema` pr

Typically you will add arguments to represent the values that are under control by Terraform, and attributes to supply read-only values as references for Terraform. These are distinguished by Schema Behavior.

Attribute names are to be specified in `camel_case` as opposed to the AWS API which is `CamelCase`.
Attribute names are to be specified in `snake_case` as opposed to the AWS API which is `CamelCase`.

### Implement CRUD handlers

Expand Down
5 changes: 5 additions & 0 deletions docs/data-handling-and-conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ When using the Terraform Plugin SDK v2, flattening and expanding functions must
AutoFlex provides two entry-point functions, `Flatten` and `Expand` defined in the package `github.com/hashicorp/terraform-provider-aws/internal/framework/flex`.
Without configuration, these two functions should be able to convert most provider and AWS API structures.

!!! note
AutoFlex should only be used when creating new resource and data source types.
It should not be used when converting a resource implementation from Terraform Plugin SDK v2 to Terraform Plugin Framework.
AutoFlex does not currently provide a mechanism for preserving zero-value behavior from Terraform Plugin SDK v2, which can cause breaking changes.

AutoFlex uses field names to map between the source and target structures:

1. An exact, case-sensitive match
Expand Down
1 change: 1 addition & 0 deletions docs/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- [Terraform](https://www.terraform.io/downloads.html) 0.12.26+ (to run acceptance tests)
- [Go](https://golang.org/doc/install) 1.22+ (to build the provider plugin)
- Mac, Linux or WSL (to build the provider plugin)

## Quick Start

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.13.4
github.com/aws/aws-sdk-go-v2/service/organizations v1.30.3
github.com/aws/aws-sdk-go-v2/service/osis v1.12.4
github.com/aws/aws-sdk-go-v2/service/outposts v1.42.1
github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.12.4
github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.7.4
github.com/aws/aws-sdk-go-v2/service/pinpoint v1.32.4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ github.com/aws/aws-sdk-go-v2/service/organizations v1.30.3 h1:gYS53GRIaSesL04BlZ
github.com/aws/aws-sdk-go-v2/service/organizations v1.30.3/go.mod h1:qdJX3WZbuAan5dXCoinnJjuY1QERCpv3glXeI3+wbeA=
github.com/aws/aws-sdk-go-v2/service/osis v1.12.4 h1:D1+hSpaeBVydbHUc86o1Yv3EhOcM0CRazxOokfpC33g=
github.com/aws/aws-sdk-go-v2/service/osis v1.12.4/go.mod h1:0MthgSZ1NbnrgPnmzoaW3gcEsrDIHwlM+sTD40C+2eQ=
github.com/aws/aws-sdk-go-v2/service/outposts v1.42.1 h1:T6kre1roWWt69vi4zH/YHHBeNxyVKi7DRcvsAFqRcv4=
github.com/aws/aws-sdk-go-v2/service/outposts v1.42.1/go.mod h1:xY1QTcwh2yNZExwfq7F94eHmjwH7I0teGO9lOVpDGHI=
github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.12.4 h1:X95oOMxpaWqlOq+AeMCwZFL73Mq01HTlouPSjf80G28=
github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.12.4/go.mod h1:ri4Ew+vqZyF3RIGmPvismFkwMvP1XG8okHGbpKEDgi0=
github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.7.4 h1:IjFjC4pJQvVOHFwQ/UYYd/HPMYZa4OtBeo+K5Fnge4I=
Expand Down
6 changes: 3 additions & 3 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/inspector2"
inspector2types "github.com/aws/aws-sdk-go-v2/service/inspector2/types"
organizationstypes "github.com/aws/aws-sdk-go-v2/service/organizations/types"
"github.com/aws/aws-sdk-go-v2/service/outposts"
"github.com/aws/aws-sdk-go-v2/service/pinpoint"
"github.com/aws/aws-sdk-go-v2/service/ssoadmin"
ssoadmintypes "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types"
Expand All @@ -43,7 +44,6 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/service/outposts"
"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 @@ -1353,10 +1353,10 @@ func PreCheckDirectoryServiceSimpleDirectory(ctx context.Context, t *testing.T)
func PreCheckOutpostsOutposts(ctx context.Context, t *testing.T) {
t.Helper()

conn := Provider.Meta().(*conns.AWSClient).OutpostsConn(ctx)
conn := Provider.Meta().(*conns.AWSClient).OutpostsClient(ctx)
input := &outposts.ListOutpostsInput{}

output, err := conn.ListOutpostsWithContext(ctx, input)
output, err := conn.ListOutposts(ctx, input)

if PreCheckSkipError(err) {
t.Skipf("skipping acceptance testing: %s", err)
Expand Down
6 changes: 3 additions & 3 deletions internal/conns/awsclient_gen.go

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

4 changes: 3 additions & 1 deletion internal/flex/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func ExpandStringyValueListEmpty[E ~string](configured []any) []E {
func FlattenStringList(list []*string) []interface{} {
vs := make([]interface{}, 0, len(list))
for _, v := range list {
vs = append(vs, *v)
if v != nil {
vs = append(vs, *v)
}
}
return vs
}
Expand Down
29 changes: 29 additions & 0 deletions internal/flex/flex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,3 +525,32 @@ func TestDiffSlices(t *testing.T) {
}
}
}

func TestFlattenStringList(t *testing.T) {
t.Parallel()

foo := "bar"
baz := "qux"

tests := []struct {
name string
list []*string
want []interface{}
}{
{"nil", nil, []interface{}{}},
{"empty", []*string{}, []interface{}{}},
{"nil item", []*string{nil}, []interface{}{}},
{"single item", []*string{&foo}, []interface{}{foo}},
{"multiple items", []*string{&foo, &baz}, []interface{}{foo, baz}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

got := FlattenStringList(tt.list)
if diff := cmp.Diff(got, tt.want); diff != "" {
t.Errorf("FlattenStringList() = %v, want %v", got, tt.want)
}
})
}
}
Loading

0 comments on commit 5595747

Please sign in to comment.