Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Shield ProactiveEngagement #34667

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
592770f
Add support for Shield ProactiveEngagement
shawnaws Nov 30, 2023
692acae
Update empty plan status and remove commented out function
shawnaws Nov 30, 2023
d1067e5
Fix linting errors for Pull Request
shawnaws Dec 5, 2023
8d27240
Fix terrafmt and copyright
shawnaws Dec 5, 2023
9253a61
Fix golangci-lint
shawnaws Dec 5, 2023
895645d
Merge branch 'main' into HEAD
ewbankkit Feb 27, 2024
78346e4
Add CHANGELOG entry.
ewbankkit Feb 27, 2024
3e14fcd
'aws_shield_proactive_engagement_association' -> 'aws_shield_proactiv…
ewbankkit Feb 28, 2024
e669191
Move some stuff around.
ewbankkit Feb 28, 2024
ceecc6e
'fwtypes.ARNValue' -> 'fwtypes.ARNValueMust'.
ewbankkit Feb 28, 2024
0b4b27c
'fwtypes.DurationValue' -> 'fwtypes.DurationValueMust'.
ewbankkit Feb 28, 2024
e24baa0
'fwtypes.NewListNestedObjectValueOf...' -> 'fwtypes.NewListNestedObje…
ewbankkit Feb 28, 2024
93c6af3
Add 'fwtypes.NewListNestedObjectValueOf...'.
ewbankkit Feb 28, 2024
99513d6
'fwtypes.RegexpValue' -> 'fwtypes.RegexpValueMust'.
ewbankkit Feb 28, 2024
be35d46
More 'framework/types' Must-ness.
ewbankkit Feb 28, 2024
3ef72e6
Even more 'framework/types' Must-ness.
ewbankkit Feb 28, 2024
d356157
r/aws_shield_drt_access_log_bucket_association: Change `log_bucket` a…
ewbankkit Feb 28, 2024
13f96c4
r/aws_shield_drt_access_role_arn_association: Support resource import.
ewbankkit Feb 28, 2024
775cf4b
Add 'fwtypes.ARNValue'.
ewbankkit Feb 29, 2024
8be30e3
r/aws_shield_protection: Tidy up.
ewbankkit Feb 29, 2024
3aa9fd5
r/aws_shield_application_layer_automatic_response: Tidy up.
ewbankkit Feb 29, 2024
59afc07
shield: Tidy up acceptance tests.
ewbankkit Feb 29, 2024
10cd817
shield: Add sweepers.
ewbankkit Feb 29, 2024
560f5af
Acceptance test fixes.
ewbankkit Feb 29, 2024
c137c2b
r/aws_shield_proactive_engagement: Fix acceptance tests.
ewbankkit Feb 29, 2024
caf15c8
Fix golangci-lint 'unparam'.
ewbankkit Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changelog/34667.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```release-note:new-resource
aws_shield_proactive_engagement
```

```release-note:bug
resource/aws_shield_drt_access_log_bucket_association: Change `log_bucket` and `role_arn_association_id` to [ForceNew](https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#forcenew)
```

```release-note:enhancement
resource/aws_shield_drt_access_log_bucket_association: Support resource import
```

```release-note:enhancement
resource/aws_shield_drt_access_role_arn_association: Support resource import
```
56 changes: 28 additions & 28 deletions internal/framework/flex/auto_expand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ func TestExpand(t *testing.T) {
},
{
TestName: "single ARN Source and single string Target",
Source: &TestFlexTF17{Field1: fwtypes.ARNValue(testARN)},
Source: &TestFlexTF17{Field1: fwtypes.ARNValueMust(testARN)},
Target: &TestFlexAWS01{},
WantTarget: &TestFlexAWS01{Field1: testARN},
},
{
TestName: "single ARN Source and single *string Target",
Source: &TestFlexTF17{Field1: fwtypes.ARNValue(testARN)},
Source: &TestFlexTF17{Field1: fwtypes.ARNValueMust(testARN)},
Target: &TestFlexAWS02{},
WantTarget: &TestFlexAWS02{Field1: aws.String(testARN)},
},
Expand Down Expand Up @@ -301,25 +301,25 @@ func TestExpandGeneric(t *testing.T) {
testCases := autoFlexTestCases{
{
TestName: "single list Source and *struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfPtr(ctx, &TestFlexTF01{Field1: types.StringValue("a")})},
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfPtrMust(ctx, &TestFlexTF01{Field1: types.StringValue("a")})},
Target: &TestFlexAWS06{},
WantTarget: &TestFlexAWS06{Field1: &TestFlexAWS01{Field1: "a"}},
},
{
TestName: "single set Source and *struct Target",
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfPtr(ctx, &TestFlexTF01{Field1: types.StringValue("a")})},
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfPtrMust(ctx, &TestFlexTF01{Field1: types.StringValue("a")})},
Target: &TestFlexAWS06{},
WantTarget: &TestFlexAWS06{Field1: &TestFlexAWS01{Field1: "a"}},
},
{
TestName: "empty list Source and empty []struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSlice(ctx, []TestFlexTF01{})},
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSliceMust(ctx, []TestFlexTF01{})},
Target: &TestFlexAWS08{},
WantTarget: &TestFlexAWS08{Field1: []TestFlexAWS01{}},
},
{
TestName: "non-empty list Source and non-empty []struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSlice(ctx, []TestFlexTF01{
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSliceMust(ctx, []TestFlexTF01{
{Field1: types.StringValue("a")},
{Field1: types.StringValue("b")},
})},
Expand All @@ -331,13 +331,13 @@ func TestExpandGeneric(t *testing.T) {
},
{
TestName: "empty list Source and empty []*struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfSlice(ctx, []*TestFlexTF01{})},
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfSliceMust(ctx, []*TestFlexTF01{})},
Target: &TestFlexAWS07{},
WantTarget: &TestFlexAWS07{Field1: []*TestFlexAWS01{}},
},
{
TestName: "non-empty list Source and non-empty []*struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfSlice(ctx, []*TestFlexTF01{
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfSliceMust(ctx, []*TestFlexTF01{
{Field1: types.StringValue("a")},
{Field1: types.StringValue("b")},
})},
Expand All @@ -349,13 +349,13 @@ func TestExpandGeneric(t *testing.T) {
},
{
TestName: "empty list Source and empty []struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSlice(ctx, []TestFlexTF01{})},
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSliceMust(ctx, []TestFlexTF01{})},
Target: &TestFlexAWS08{},
WantTarget: &TestFlexAWS08{Field1: []TestFlexAWS01{}},
},
{
TestName: "non-empty list Source and non-empty []struct Target",
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSlice(ctx, []TestFlexTF01{
Source: &TestFlexTF05{Field1: fwtypes.NewListNestedObjectValueOfValueSliceMust(ctx, []TestFlexTF01{
{Field1: types.StringValue("a")},
{Field1: types.StringValue("b")},
})},
Expand All @@ -367,13 +367,13 @@ func TestExpandGeneric(t *testing.T) {
},
{
TestName: "empty set Source and empty []*struct Target",
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfSlice(ctx, []*TestFlexTF01{})},
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfSliceMust(ctx, []*TestFlexTF01{})},
Target: &TestFlexAWS07{},
WantTarget: &TestFlexAWS07{Field1: []*TestFlexAWS01{}},
},
{
TestName: "non-empty set Source and non-empty []*struct Target",
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfSlice(ctx, []*TestFlexTF01{
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfSliceMust(ctx, []*TestFlexTF01{
{Field1: types.StringValue("a")},
{Field1: types.StringValue("b")},
})},
Expand All @@ -385,7 +385,7 @@ func TestExpandGeneric(t *testing.T) {
},
{
TestName: "non-empty set Source and non-empty []struct Target",
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfValueSlice(ctx, []TestFlexTF01{
Source: &TestFlexTF06{Field1: fwtypes.NewSetNestedObjectValueOfValueSliceMust(ctx, []TestFlexTF01{
{Field1: types.StringValue("a")},
{Field1: types.StringValue("b")},
})},
Expand All @@ -399,16 +399,16 @@ func TestExpandGeneric(t *testing.T) {
TestName: "complex Source and complex Target",
Source: &TestFlexTF07{
Field1: types.StringValue("m"),
Field2: fwtypes.NewListNestedObjectValueOfPtr(ctx, &TestFlexTF05{
Field1: fwtypes.NewListNestedObjectValueOfPtr(ctx, &TestFlexTF01{
Field2: fwtypes.NewListNestedObjectValueOfPtrMust(ctx, &TestFlexTF05{
Field1: fwtypes.NewListNestedObjectValueOfPtrMust(ctx, &TestFlexTF01{
Field1: types.StringValue("n"),
}),
}),
Field3: types.MapValueMust(types.StringType, map[string]attr.Value{
"X": types.StringValue("x"),
"Y": types.StringValue("y"),
}),
Field4: fwtypes.NewSetNestedObjectValueOfValueSlice(ctx, []TestFlexTF02{
Field4: fwtypes.NewSetNestedObjectValueOfValueSliceMust(ctx, []TestFlexTF02{
{Field1: types.Int64Value(100)},
{Field1: types.Int64Value(2000)},
{Field1: types.Int64Value(30000)},
Expand Down Expand Up @@ -439,7 +439,7 @@ func TestExpandGeneric(t *testing.T) {
{
TestName: "nested string map",
Source: &TestFlexTF14{
FieldOuter: fwtypes.NewListNestedObjectValueOfPtr(ctx, &TestFlexTF11{
FieldOuter: fwtypes.NewListNestedObjectValueOfPtrMust(ctx, &TestFlexTF11{
FieldInner: fwtypes.NewMapValueOfMust[basetypes.StringValue](ctx, map[string]attr.Value{
"x": types.StringValue("y"),
}),
Expand All @@ -457,7 +457,7 @@ func TestExpandGeneric(t *testing.T) {
{
TestName: "map block key list",
Source: &TestFlexMapBlockKeyTF01{
MapBlock: fwtypes.NewListNestedObjectValueOfValueSlice[TestFlexMapBlockKeyTF02](ctx, []TestFlexMapBlockKeyTF02{
MapBlock: fwtypes.NewListNestedObjectValueOfValueSliceMust[TestFlexMapBlockKeyTF02](ctx, []TestFlexMapBlockKeyTF02{
{
MapBlockKey: types.StringValue("x"),
Attr1: types.StringValue("a"),
Expand Down Expand Up @@ -487,7 +487,7 @@ func TestExpandGeneric(t *testing.T) {
{
TestName: "map block key set",
Source: &TestFlexMapBlockKeyTF03{
MapBlock: fwtypes.NewSetNestedObjectValueOfValueSlice[TestFlexMapBlockKeyTF02](ctx, []TestFlexMapBlockKeyTF02{
MapBlock: fwtypes.NewSetNestedObjectValueOfValueSliceMust[TestFlexMapBlockKeyTF02](ctx, []TestFlexMapBlockKeyTF02{
{
MapBlockKey: types.StringValue("x"),
Attr1: types.StringValue("a"),
Expand Down Expand Up @@ -517,7 +517,7 @@ func TestExpandGeneric(t *testing.T) {
{
TestName: "map block key ptr source",
Source: &TestFlexMapBlockKeyTF01{
MapBlock: fwtypes.NewListNestedObjectValueOfSlice(ctx, []*TestFlexMapBlockKeyTF02{
MapBlock: fwtypes.NewListNestedObjectValueOfSliceMust(ctx, []*TestFlexMapBlockKeyTF02{
{
MapBlockKey: types.StringValue("x"),
Attr1: types.StringValue("a"),
Expand Down Expand Up @@ -547,7 +547,7 @@ func TestExpandGeneric(t *testing.T) {
{
TestName: "map block key ptr both",
Source: &TestFlexMapBlockKeyTF01{
MapBlock: fwtypes.NewListNestedObjectValueOfSlice(ctx, []*TestFlexMapBlockKeyTF02{
MapBlock: fwtypes.NewListNestedObjectValueOfSliceMust(ctx, []*TestFlexMapBlockKeyTF02{
{
MapBlockKey: types.StringValue("x"),
Attr1: types.StringValue("a"),
Expand Down Expand Up @@ -577,7 +577,7 @@ func TestExpandGeneric(t *testing.T) {
{
TestName: "map block enum key",
Source: &TestFlexMapBlockKeyTF04{
MapBlock: fwtypes.NewListNestedObjectValueOfValueSlice[TestFlexMapBlockKeyTF05](ctx, []TestFlexMapBlockKeyTF05{
MapBlock: fwtypes.NewListNestedObjectValueOfValueSliceMust[TestFlexMapBlockKeyTF05](ctx, []TestFlexMapBlockKeyTF05{
{
MapBlockKey: fwtypes.StringEnumValue(TestEnumList),
Attr1: types.StringValue("a"),
Expand Down Expand Up @@ -635,7 +635,7 @@ func TestExpandSimpleSingleNestedBlock(t *testing.T) {
testCases := autoFlexTestCases{
{
TestName: "single nested block pointer",
Source: &tf02{Field1: fwtypes.NewObjectValueOf[tf01](ctx, &tf01{Field1: types.StringValue("a"), Field2: types.Int64Value(1)})},
Source: &tf02{Field1: fwtypes.NewObjectValueOfMust[tf01](ctx, &tf01{Field1: types.StringValue("a"), Field2: types.Int64Value(1)})},
Target: &aws02{},
WantTarget: &aws02{Field1: &aws01{Field1: aws.String("a"), Field2: 1}},
},
Expand All @@ -647,7 +647,7 @@ func TestExpandSimpleSingleNestedBlock(t *testing.T) {
},
{
TestName: "single nested block value",
Source: &tf02{Field1: fwtypes.NewObjectValueOf[tf01](ctx, &tf01{Field1: types.StringValue("a"), Field2: types.Int64Value(1)})},
Source: &tf02{Field1: fwtypes.NewObjectValueOfMust[tf01](ctx, &tf01{Field1: types.StringValue("a"), Field2: types.Int64Value(1)})},
Target: &aws03{},
WantTarget: &aws03{Field1: aws01{Field1: aws.String("a"), Field2: 1}},
},
Expand Down Expand Up @@ -686,10 +686,10 @@ func TestExpandComplexSingleNestedBlock(t *testing.T) {
{
TestName: "single nested block pointer",
Source: &tf03{
Field1: fwtypes.NewObjectValueOf[tf02](
Field1: fwtypes.NewObjectValueOfMust[tf02](
ctx,
&tf02{
Field1: fwtypes.NewObjectValueOf[tf01](
Field1: fwtypes.NewObjectValueOfMust[tf01](
ctx,
&tf01{
Field1: types.BoolValue(true),
Expand Down Expand Up @@ -782,13 +782,13 @@ func TestExpandComplexNestedBlockWithStringEnum(t *testing.T) {
testCases := autoFlexTestCases{
{
TestName: "single nested valid value",
Source: &tf02{Field1: types.Int64Value(1), Field2: fwtypes.NewListNestedObjectValueOfPtr(ctx, &tf01{Field2: fwtypes.StringEnumValue(TestEnumList)})},
Source: &tf02{Field1: types.Int64Value(1), Field2: fwtypes.NewListNestedObjectValueOfPtrMust(ctx, &tf01{Field2: fwtypes.StringEnumValue(TestEnumList)})},
Target: &aws01{},
WantTarget: &aws01{Field1: 1, Field2: &aws02{Field2: TestEnumList}},
},
{
TestName: "single nested empty value",
Source: &tf02{Field1: types.Int64Value(1), Field2: fwtypes.NewListNestedObjectValueOfPtr(ctx, &tf01{Field2: fwtypes.StringEnumNull[TestEnum]()})},
Source: &tf02{Field1: types.Int64Value(1), Field2: fwtypes.NewListNestedObjectValueOfPtrMust(ctx, &tf01{Field2: fwtypes.StringEnumNull[TestEnum]()})},
Target: &aws01{},
WantTarget: &aws01{Field1: 1, Field2: &aws02{Field2: ""}},
},
Expand Down
Loading
Loading