-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # internal/service/ec2/exports_test.go # internal/service/ec2/service_package_gen.go # internal/service/ec2/transitgateway_default_route_table_association_test.go
- Loading branch information
Showing
77 changed files
with
2,313 additions
and
1,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
aws_securityhub_standards_control_association | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
resource/aws_ec2_transit_gateway_vpc_attachment: Remove default value for `security_group_referencing_support` argument and mark as Computed. This suppresses the diffs shown for resources created with v5.68.0 (or earlier) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
--- | ||
schema: 1.1 | ||
|
||
partition: tf-ecosystem | ||
|
||
summary: | ||
owner: team-terraform-aws | ||
description: | | ||
The Terraform AWS provider is a plugin that enables Terraform to manage AWS resources. | ||
visibility: external |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package plancheck | ||
|
||
import ( | ||
"fmt" | ||
|
||
tfjson "github.com/hashicorp/terraform-json" | ||
"github.com/hashicorp/terraform-plugin-testing/plancheck" | ||
) | ||
|
||
type Base struct { | ||
resourceAddress string | ||
} | ||
|
||
func NewBase(resourceAddress string) Base { | ||
return Base{ | ||
resourceAddress: resourceAddress, | ||
} | ||
} | ||
|
||
func (b Base) ResourceFromState(req plancheck.CheckPlanRequest, resp *plancheck.CheckPlanResponse) (*tfjson.ResourceChange, bool) { | ||
var resource *tfjson.ResourceChange | ||
|
||
if req.Plan == nil { | ||
resp.Error = fmt.Errorf("plan is nil") | ||
|
||
return nil, false | ||
} | ||
|
||
for _, r := range req.Plan.ResourceChanges { | ||
if b.resourceAddress == r.Address { | ||
resource = r | ||
|
||
break | ||
} | ||
} | ||
|
||
if resource == nil { | ||
resp.Error = fmt.Errorf("%s - Resource not found in plan", b.resourceAddress) | ||
|
||
return nil, false | ||
} | ||
|
||
return resource, true | ||
} | ||
|
||
func (b Base) ResourceAddress() string { | ||
return b.resourceAddress | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package plancheck | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/knownvalue" | ||
"github.com/hashicorp/terraform-plugin-testing/plancheck" | ||
"github.com/hashicorp/terraform-plugin-testing/tfjsonpath" | ||
) | ||
|
||
type expectKnownValueChangeCheck struct { | ||
base Base | ||
attributePath tfjsonpath.Path | ||
oldValue, newValue knownvalue.Check | ||
} | ||
|
||
func (e expectKnownValueChangeCheck) CheckPlan(ctx context.Context, request plancheck.CheckPlanRequest, response *plancheck.CheckPlanResponse) { | ||
resource, ok := e.base.ResourceFromState(request, response) | ||
if !ok { | ||
return | ||
} | ||
|
||
old, err := tfjsonpath.Traverse(resource.Change.Before, e.attributePath) | ||
if err != nil { | ||
response.Error = err | ||
|
||
return | ||
} | ||
|
||
if err := e.oldValue.CheckValue(old); err != nil { | ||
response.Error = fmt.Errorf("checking old value for attribute at path: %s.%s, err: %s", resource.Address, e.attributePath.String(), err) | ||
|
||
return | ||
} | ||
|
||
new, err := tfjsonpath.Traverse(resource.Change.After, e.attributePath) | ||
if err != nil { | ||
response.Error = err | ||
|
||
return | ||
} | ||
|
||
if err := e.newValue.CheckValue(new); err != nil { | ||
response.Error = fmt.Errorf("checking new value for attribute at path: %s.%s, err: %s", resource.Address, e.attributePath.String(), err) | ||
|
||
return | ||
} | ||
} | ||
|
||
func ExpectKnownValueChange(resourceAddress string, attributePath tfjsonpath.Path, oldValue, newValue knownvalue.Check) plancheck.PlanCheck { | ||
return expectKnownValueChangeCheck{ | ||
base: NewBase(resourceAddress), | ||
attributePath: attributePath, | ||
oldValue: oldValue, | ||
newValue: newValue, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package statecheck | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/statecheck" | ||
"github.com/hashicorp/terraform-plugin-testing/tfjsonpath" | ||
) | ||
|
||
type expectNoValueCheck struct { | ||
base Base | ||
attributePath tfjsonpath.Path | ||
} | ||
|
||
func (e expectNoValueCheck) CheckState(ctx context.Context, request statecheck.CheckStateRequest, response *statecheck.CheckStateResponse) { | ||
resource, ok := e.base.ResourceFromState(request, response) | ||
if !ok { | ||
return | ||
} | ||
|
||
if _, err := tfjsonpath.Traverse(resource.AttributeValues, e.attributePath); err == nil { | ||
response.Error = fmt.Errorf("value for attribute at path: %s.%s exists", resource.Address, e.attributePath.String()) | ||
|
||
return | ||
} | ||
} | ||
|
||
func ExpectNoValue(resourceAddress string, attributePath tfjsonpath.Path) statecheck.StateCheck { | ||
return expectNoValueCheck{ | ||
base: NewBase(resourceAddress), | ||
attributePath: attributePath, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.