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 May 23, 2022
2 parents 81904c6 + 7e5c2d0 commit 35a1217
Show file tree
Hide file tree
Showing 268 changed files with 4,587 additions and 3,614 deletions.
3 changes: 3 additions & 0 deletions .changelog/24821.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_location_place_index
```
11 changes: 11 additions & 0 deletions .changelog/24856.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:enhancement
resource/aws_redshift_cluster: Add plan-time validation for `iam_roles`, `owner_account`, and `port`.
```

```release-note:enhancement
resource/aws_redshift_cluster: Add `aqua_configuration_status` and `apply_immediately` arguments.
```

```release-note:enhancement
data-source/aws_redshift_cluster: Add `aqua_configuration_status` attribute.
```
3 changes: 3 additions & 0 deletions .changelog/24886.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_redshift_cluster: Add `logging.log_destination_type` and `logging.log_exports` arguments.
```
3 changes: 3 additions & 0 deletions .changelog/24899.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_organizations_account: Fix reading account state for existing accounts
```
1 change: 0 additions & 1 deletion .github/workflows/maintainer-edit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
Hey @${{ github.actor }} :wave: Thank you very much for your contribution! At times, our maintainers need to make direct edits to pull requests in order to help get it ready to be merged. Your current settings do not allow maintainers to make such edits. To help facilitate this, update your pull request to allow such edits as described in GitHub's [Allowing changes to a pull request branch created from a fork][1] documentation. (If you're using a fork owned by an organization, your organization may not allow you to change this setting. If that is the case, let us know.)
[1]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork
71 changes: 64 additions & 7 deletions .semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,62 @@ rules:

- id: helper-schema-ResourceData-SetId-empty-without-IsNewResource-check
languages: [go]
message: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is also checked
message: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is also checked. See https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/error-handling.md#disnewresource-checks
paths:
include:
- internal/service
exclude:
- internal/service/**/*_data_source.go
- internal/service/[be-g]*
- internal/service/d[a-df-z]*
- internal/service/backup
- internal/service/batch
- internal/service/d[a-d]*
- internal/service/devicefarm
- internal/service/i*
- internal/service/[k-r]*
- internal/service/s[a-df-z3]*
- internal/service/directconnect
- internal/service/dlm
- internal/service/dms
- internal/service/ds
- internal/service/dynamodb
- internal/service/ec2
- internal/service/ecs
- internal/service/efs
- internal/service/elasticache
- internal/service/elasticbeanstalk
- internal/service/elastictranscoder
- internal/service/elbv2
- internal/service/emr
- internal/service/g*
- internal/service/inspector
- internal/service/iot
- internal/service/kafka
- internal/service/kms
- internal/service/lambda
- internal/service/lexmodels
- internal/service/licensemanager
- internal/service/lightsail
- internal/service/logs
- internal/service/macie
- internal/service/macie2
- internal/service/mediastore
- internal/service/mq
- internal/service/neptune
- internal/service/opsworks
- internal/service/organizations
- internal/service/pinpoint
- internal/service/rds
- internal/service/resourcegroups
- internal/service/route53
- internal/service/route53resolver
- internal/service/s[a-df-rt]*
- internal/service/se[d-z]*
- internal/service/sec[a-t]*
- internal/service/securityhub
- internal/service/[t-x]*
- internal/service/ssoadmin
- internal/service/swf
- internal/service/[t-v]*
- internal/service/waf
- internal/service/wafv2
- internal/service/workspaces
- internal/service/xray
patterns:
- pattern-either:
- pattern: |
Expand Down Expand Up @@ -664,6 +704,23 @@ rules:
regex: "^resource\\w*(Create|Put|Set|Upsert|Enable)$"
severity: WARNING

- id: calling-SetId-with-empty-string-in-resource-update
languages: [go]
message: Do not call `d.SetId("")` inside a resource update function
paths:
include:
- internal/service/
patterns:
- pattern: |
func $FUNC(...) {
...
d.SetId("")
}
- metavariable-regex:
metavariable: "$FUNC"
regex: "^resource\\w*(Update)$|^update\\w*$" # Put and Upsert variants are handled in calling-SetId-with-empty-string-in-resource-create above
severity: WARNING

- id: calling-SetId-in-resource-delete
languages: [go]
message: Do not call `d.SetId(...)` inside a resource delete function
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 4.16.0 (Unreleased)
## 4.15.1 (May 20, 2022)

BUG FIXES:

* resource/aws_organizations_account: Fix reading account state for existing accounts ([#24899](https://github.com/hashicorp/terraform-provider-aws/issues/24899))

## 4.15.0 (May 20, 2022)

BREAKING CHANGES:
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ go 1.17

require (
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7
github.com/aws/aws-sdk-go v1.44.15
github.com/aws/aws-sdk-go-v2 v1.16.3
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.4
github.com/aws/aws-sdk-go-v2/service/route53domains v1.12.4
github.com/aws/aws-sdk-go v1.44.19
github.com/aws/aws-sdk-go-v2 v1.16.4
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.5
github.com/aws/aws-sdk-go-v2/service/route53domains v1.12.5
github.com/beevik/etree v1.1.0
github.com/google/go-cmp v0.5.8
github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.16.0
Expand All @@ -17,7 +17,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-version v1.4.0
github.com/hashicorp/go-version v1.5.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0
github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24
github.com/mitchellh/copystructure v1.2.0
Expand All @@ -36,8 +36,8 @@ require (
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.15.4 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.11 // indirect
github.com/aws/aws-sdk-go-v2/service/iam v1.18.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.4 // indirect
Expand Down
23 changes: 14 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,32 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.42.18/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
github.com/aws/aws-sdk-go v1.42.52/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc=
github.com/aws/aws-sdk-go v1.44.15 h1:z02BVeV6k7hZMfWEQmKh3X23s3F9PBHFCcIVfNlut7A=
github.com/aws/aws-sdk-go v1.44.15/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go-v2 v1.16.3 h1:0W1TSJ7O6OzwuEvIXAtJGvOeQ0SGAhcpxPN2/NK5EhM=
github.com/aws/aws-sdk-go v1.44.19 h1:dhI6p4l6kisnA7gBAM8sP5YIk0bZ9HNAj7yrK7kcfdU=
github.com/aws/aws-sdk-go v1.44.19/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go-v2 v1.16.3/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU=
github.com/aws/aws-sdk-go-v2 v1.16.4 h1:swQTEQUyJF/UkEA94/Ga55miiKFoXmm/Zd67XHgmjSg=
github.com/aws/aws-sdk-go-v2 v1.16.4/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU=
github.com/aws/aws-sdk-go-v2/config v1.15.4 h1:P4mesY1hYUxru4f9SU0XxNKXmzfxsD0FtMIPRBjkH7Q=
github.com/aws/aws-sdk-go-v2/config v1.15.4/go.mod h1:ZijHHh0xd/A+ZY53az0qzC5tT46kt4JVCePf2NX9Lk4=
github.com/aws/aws-sdk-go-v2/credentials v1.12.0 h1:4R/NqlcRFSkR0wxOhgHi+agGpbEr5qMCjn7VqUIJY+E=
github.com/aws/aws-sdk-go-v2/credentials v1.12.0/go.mod h1:9YWk7VW+eyKsoIL6/CljkTrNVWBSK9pkqOPUuijid4A=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.4 h1:FP8gquGeGHHdfY6G5llaMQDF+HAf20VKc8opRwmjf04=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.4/go.mod h1:u/s5/Z+ohUQOPXl00m2yJVyioWDECsbpXTQlaqSlufc=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.10 h1:uFWgo6mGJI1n17nbcvSc6fxVuR3xLNqvXt12JCnEcT8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.5 h1:YPxclBeE07HsLQE8vtjC8T2emcTjM9nzqsnDi2fv5UM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.5/go.mod h1:WAPnuhG5IQ/i6DETFl5NmX3kKqCzw7aau9NHAGcm4QE=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.10/go.mod h1:F+EZtuIwjlv35kRJPyBGcsA4f7bnSoz15zOQ2lJq1Z4=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.4 h1:cnsvEKSoHN4oAN7spMMr0zhEW2MHnhAVpmqQg8E6UcM=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11 h1:gsqHplNh1DaQunEKZISK56wlpbCg0yKxNVvGWCFuF1k=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11/go.mod h1:tmUB6jakq5DFNcXsXOA/ZQ7/C8VnSKYkx58OI7Fh79g=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.4/go.mod h1:8glyUqVIM4AmeenIsPo0oVh3+NUwnsQml2OFupfQW+0=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5 h1:PLFj+M2PgIDHG//hw3T0O0KLI4itVtAjtxrZx4AHPLg=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5/go.mod h1:fV1AaS2gFc1tM0RCb015FJ0pvWVUfJZANzjwoO4YakM=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.11 h1:6cZRymlLEIlDTEB0+5+An6Zj1CKt6rSE69tOmFeu1nk=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.11/go.mod h1:0MR+sS1b/yxsfAPvAESrw8NfwUoxMinDyw6EYR9BS2U=
github.com/aws/aws-sdk-go-v2/service/iam v1.18.4 h1:E41guA79mjEbwJdh0zXz1d8+Zt4zxRr+b1ipiVbKXzs=
github.com/aws/aws-sdk-go-v2/service/iam v1.18.4/go.mod h1:FpNvAfCZyIQ3qeNJUOw4CShKvdizHblXqAvSk0qmyL4=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.4 h1:b16QW0XWl0jWjLABFc1A+uh145Oqv+xDcObNk0iQgUk=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.4/go.mod h1:uKkN7qmSIsNJVyMtxNQoCEYMvFEXbOg9fwCJPdfp2u8=
github.com/aws/aws-sdk-go-v2/service/route53domains v1.12.4 h1:jfv+dUsxVtv/e0Nlw93Gltd1IZ1P9k5qmcizz43kkzM=
github.com/aws/aws-sdk-go-v2/service/route53domains v1.12.4/go.mod h1:EfCWWmp+qWzwBON1SeWld+iFizfk+J1Y7YMvrPbxZP0=
github.com/aws/aws-sdk-go-v2/service/route53domains v1.12.5 h1:TPSJlW3ivAvepHJt2kleKP7DW9iug6At+s4ZxM6EpsA=
github.com/aws/aws-sdk-go-v2/service/route53domains v1.12.5/go.mod h1:R7b4hWkQTtE2Qzh2hjkPZYDWMMSM3JIWcHn+IFX16bI=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.4 h1:Uw5wBybFQ1UeA9ts0Y07gbv0ncZnIAyw858tDW0NP2o=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.4/go.mod h1:cPDwJwsP4Kff9mldCXAmddjJL6JGQqtA3Mzer2zyr88=
github.com/aws/aws-sdk-go-v2/service/sts v1.16.4 h1:+xtV90n3abQmgzk1pS++FdxZTrPEDgQng6e4/56WR2A=
Expand Down Expand Up @@ -159,8 +163,9 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4=
github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.5.0 h1:O293SZ2Eg+AAYijkVK3jR786Am1bhDEh2GHT0tIVE5E=
github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak=
github.com/hashicorp/hc-install v0.3.2 h1:oiQdJZvXmkNcRcEOOfM5n+VTsvNjWQeOjfAoO6dKSH8=
github.com/hashicorp/hc-install v0.3.2/go.mod h1:xMG6Tr8Fw1WFjlxH0A9v61cW15pFwgEGqEz0V4jisHs=
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/repository/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
required_providers {
github = {
source = "integrations/github"
version = "4.24.1"
version = "4.25.0"
}
}

Expand Down
3 changes: 2 additions & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,8 @@ func Provider() *schema.Provider {
"aws_lightsail_static_ip": lightsail.ResourceStaticIP(),
"aws_lightsail_static_ip_attachment": lightsail.ResourceStaticIPAttachment(),

"aws_location_map": location.ResourceMap(),
"aws_location_map": location.ResourceMap(),
"aws_location_place_index": location.ResourcePlaceIndex(),

"aws_macie_member_account_association": macie.ResourceMemberAccountAssociation(),
"aws_macie_s3_bucket_association": macie.ResourceS3BucketAssociation(),
Expand Down
4 changes: 2 additions & 2 deletions internal/service/docdb/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func resourceClusterRead(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] Describing DocDB Cluster: %s", input)
resp, err := conn.DescribeDBClusters(input)

if tfawserr.ErrCodeEquals(err, docdb.ErrCodeDBClusterNotFoundFault) {
if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, docdb.ErrCodeDBClusterNotFoundFault) {
log.Printf("[WARN] DocDB Cluster (%s) not found, removing from state", d.Id())
d.SetId("")
return nil
Expand All @@ -543,7 +543,7 @@ func resourceClusterRead(d *schema.ResourceData, meta interface{}) error {
}
}

if dbc == nil {
if !d.IsNewResource() && dbc == nil {
log.Printf("[WARN] DocDB Cluster (%s) not found, removing from state", d.Id())
d.SetId("")
return nil
Expand Down
Loading

0 comments on commit 35a1217

Please sign in to comment.