Skip to content

Commit

Permalink
Merge pull request #33432 from chasse-code/f-shield-advance-layer-pro…
Browse files Browse the repository at this point in the history
…tection

Feature - AWS Shield Advanced - Application Layer Automatic Response
  • Loading branch information
ewbankkit authored Sep 13, 2023
2 parents 307b46f + 901ffbd commit 6bd9ea4
Show file tree
Hide file tree
Showing 9 changed files with 781 additions and 48 deletions.
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
```
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
Loading

0 comments on commit 6bd9ea4

Please sign in to comment.