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 aws_networkfirewall_tls_inspection_configuration #35168

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
4fae268
[WIP] Schema, CRD functions
ddericco Jan 4, 2024
1654412
[WIP] Flex functions
ddericco Jan 4, 2024
7b037cd
[WIP] Flex functions and data structures
ddericco Jan 5, 2024
c06674a
Finish first pass at CRUD, flex functions
ddericco Jan 5, 2024
e5d6930
[WIP] Begin building acceptance tests
ddericco Jan 5, 2024
8477fb6
Run make gen
ddericco Jan 5, 2024
a9c818b
[WIP] Additional flex functions
ddericco Jan 8, 2024
b1dcb5a
[WIP] Acceptance tests and flex fixes
ddericco Jan 8, 2024
579c5c4
[WIP] Additional flex fixes, TODO: fix imports, ID
ddericco Jan 17, 2024
cfff153
[WIP] Fix ResourceNotFound on delete
ddericco Jan 17, 2024
78244ce
[WIP] Ingress acceptance tests
ddericco Jan 17, 2024
ab2cfad
[WIP] Add egress inspection acceptance tests
ddericco Jan 19, 2024
7ebb3fa
Additional egress acceptance tests, fix import
ddericco Jan 19, 2024
ad6a6dc
Cleanup: skaff comments
ddericco Jan 19, 2024
8d04d87
Cleanup: copywrite headers
ddericco Jan 19, 2024
a4cb3ad
Fix missing certificates, CA cert data
ddericco Feb 9, 2024
5c24843
Remove SDKv2, change Create to run with ctx, run linters
ddericco Feb 9, 2024
8c4d1ff
Add docs
ddericco Feb 12, 2024
743acad
Add validators to schema
ddericco Feb 19, 2024
144ed30
Fix hash links in docs
ddericco Feb 19, 2024
860742e
Cleanup, run linters
ddericco Feb 19, 2024
4965642
Rerun golangci-lint
ddericco Feb 20, 2024
acf4d32
Add changelog
ddericco Feb 20, 2024
d557717
Re-run linters
ddericco Feb 20, 2024
e451963
Add additional acceptance tests, cleanup
ddericco Feb 20, 2024
cb2da57
ec2: Skip 'UnsupportedOperation: The functionality you requested is n…
ewbankkit Jun 18, 2024
931d9b1
Merge branch 'main' into HEAD
ewbankkit Jun 18, 2024
24adcbd
Merge commit 'cb2da57f4773c85051a927f7d42cad1b9c198c28' into HEAD
ewbankkit Jun 18, 2024
cfaeca4
r/aws_networkfirewall_tls_inspection_configuration: Use AutoFlEx.
ewbankkit Jun 18, 2024
65f6f46
Run 'make fix-constants PKG=networkfirewall'.
ewbankkit Jun 18, 2024
1dbffd9
Run 'make fmt'.
ewbankkit Jun 18, 2024
98f0a1d
Fix golangci-lint 'whitespace'.
ewbankkit Jun 18, 2024
1e2ae56
AutoFlEx: Expand types.List(OfInt64).
ewbankkit Jun 19, 2024
88efb1b
AutoFlEx: Expand types.Set(OfInt64).
ewbankkit Jun 19, 2024
d8e2043
AutoFlEx: 'listOfString' -> 'listOrSetOfString'.
ewbankkit Jun 19, 2024
218107d
Add 'flex.ExpandFrameworkInt64List' and 'flex.ExpandFrameworkInt64Val…
ewbankkit Jun 19, 2024
b3d004d
Add 'flex.ExpandFrameworkInt32List' and 'flex.ExpandFrameworkInt32Val…
ewbankkit Jun 19, 2024
defab6a
Add 'flex.ExpandFrameworkInt64Set' and 'flex.ExpandFrameworkInt64Valu…
ewbankkit Jun 19, 2024
733a7f4
Add 'flex.ExpandFrameworkInt32Set' and 'flex.ExpandFrameworkInt32Valu…
ewbankkit Jun 19, 2024
dce1c1c
Add 'flex.FlattenFrameworkInt64List' and 'flex.FlattenFrameworkInt64V…
ewbankkit Jun 19, 2024
b07c6ff
Add 'flex.FlattenFrameworkInt64Set' and 'flex.FlattenFrameworkInt64Va…
ewbankkit Jun 19, 2024
2bf082a
Add 'flex.FlattenFrameworkInt32List' and 'flex.FlattenFrameworkInt32V…
ewbankkit Jun 19, 2024
8a46328
Add 'flex.FlattenFrameworkInt32Set' and 'flex.FlattenFrameworkInt32Va…
ewbankkit Jun 19, 2024
1528cc0
AutoFlEx: Add 'sliceToList' and 'sliceToSet'.
ewbankkit Jun 19, 2024
b3c159e
AutoFlEx: Add 'sliceOfPtrToList' and 'sliceOfPtrToSet'.
ewbankkit Jun 19, 2024
a026773
r/aws_networkfirewall_tls_inspection_configuration: Fixes after some …
ewbankkit Jun 19, 2024
f38d7b9
AutoFlEx: Remove 'sliceOfPtrToList' and 'sliceOfPtrToSet'.
ewbankkit Jun 20, 2024
ac97738
Merge branch 'main' into HEAD
ewbankkit Jun 20, 2024
0329d25
r/aws_networkfirewall_tls_inspection_configuration: Get tags working.
ewbankkit Jun 20, 2024
a5875b8
Add 'TestAccNetworkFirewallTLSInspectionConfiguration_basic', 'TestAc…
ewbankkit Jun 20, 2024
c2a61fb
Add 'TestAccNetworkFirewallTLSInspectionConfiguration_encryptionConfi…
ewbankkit Jun 20, 2024
64b8daa
Add 'TestAccNetworkFirewallTLSInspectionConfiguration_checkCertificat…
ewbankkit Jun 20, 2024
72ab61d
networkfirewall: Use AWS SDK for Go v2.
ewbankkit Jun 20, 2024
07ad52b
Run 'go get github.com/aws/aws-sdk-go-v2/service/[email protected]
ewbankkit Jun 20, 2024
f63671d
r/aws_networkfirewall_tls_inspection_configuration: Migrate to AWS SD…
ewbankkit Jun 21, 2024
4d525cf
r/aws_networkfirewall_logging_configuration: Migrate to AWS SDK for G…
ewbankkit Jun 21, 2024
1e5eb29
r/aws_networkfirewall_resource_policy: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
245f621
d/aws_networkfirewall_resource_policy: Correct source file names.
ewbankkit Jun 21, 2024
fae48ce
d/aws_networkfirewall_resource_policy: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
107bf88
r/aws_networkfirewall_firewall_policy: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
9586f4c
d/aws_networkfirewall_firewall_policy: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
52fca18
r/aws_networkfirewall_firewall: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
8798de3
d/aws_networkfirewall_firewall: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
bda2dd1
r/aws_networkfirewall_rule_group: Migrate to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
468e5cc
networkfirewall: Migrate sweepers to AWS SDK for Go v2.
ewbankkit Jun 21, 2024
4b4d524
Fix smegrep 'ci.literal-source-string-constant'.
ewbankkit Jun 21, 2024
f20acb2
Fix golangci-lint 'ineffassign'.
ewbankkit Jun 21, 2024
ab6c124
Merge branch 'main' into HEAD
ewbankkit Jun 21, 2024
dfa6a8e
d/aws_networkfirewall_firewall: 'tags' is Computed.
ewbankkit Jun 21, 2024
30b8973
r/aws_networkfirewall_firewall_policy: Fix acceptance tests.
ewbankkit Jun 21, 2024
4053ac7
r/aws_ec2_managed_prefix_list: Add sweeper.
ewbankkit Jun 21, 2024
e4cb764
r/aws_networkfirewall_rule_group: Correct NotFoundError.
ewbankkit Jun 21, 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
7 changes: 7 additions & 0 deletions .changelog/35168.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-resource
aws_networkfirewall_tls_inspection_configuration
```

```release-note:enhancement
resource/aws_networkfirewall_logging_configuration: Add plan-time validation of `firewall_arn`
```
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/mq v1.23.1
github.com/aws/aws-sdk-go-v2/service/mwaa v1.28.1
github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.9.1
github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.39.1
github.com/aws/aws-sdk-go-v2/service/oam v1.12.1
github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.12.1
github.com/aws/aws-sdk-go-v2/service/organizations v1.28.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ github.com/aws/aws-sdk-go-v2/service/mwaa v1.28.1 h1:fzBc0gfOfrlcyP/COVDt8iGVUnQ
github.com/aws/aws-sdk-go-v2/service/mwaa v1.28.1/go.mod h1:a46hMp6jog7U6rhMxmp0wwcGvPTJINQkc6EevZb7SNs=
github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.9.1 h1:UjByGYRBlhjY4l8Lun62K3Z62Wks84q3UasnDDJoz5I=
github.com/aws/aws-sdk-go-v2/service/neptunegraph v1.9.1/go.mod h1:5q3YTQennpO1/KB7rU71vW/9PjLC4PuosEi2xDEw5OY=
github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.39.1 h1:f2TcduRAvOs8ltPaAnjSP64WHRmM/B5bsDSqXRYBYGs=
github.com/aws/aws-sdk-go-v2/service/networkfirewall v1.39.1/go.mod h1:23qyfghRkv9qOMRIL9KdUHiKyhARU/0FddRMtvMSVV0=
github.com/aws/aws-sdk-go-v2/service/oam v1.12.1 h1:LZrULRkfrmZVE8OHqwI8tKFEFxpjZl6ll7Bn2MCCVwg=
github.com/aws/aws-sdk-go-v2/service/oam v1.12.1/go.mod h1:yiUaEYA1zVxtz/EGgf8NE7rT56sLKGqQwQrWg/GhGu8=
github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.12.1 h1:BRAM7tTwHJojSOhiyUkPh2Z/hOco7OkayTf6MYFOF5w=
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.

135 changes: 77 additions & 58 deletions internal/framework/flex/auto_expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,12 @@ func (expander autoExpander) list(ctx context.Context, vFrom basetypes.ListValua
}

switch v.ElementType(ctx).(type) {
case basetypes.Int64Typable:
diags.Append(expander.listOrSetOfInt64(ctx, v, vTo)...)
return diags

case basetypes.StringTypable:
diags.Append(expander.listOfString(ctx, v, vTo)...)
diags.Append(expander.listOrSetOfString(ctx, v, vTo)...)
return diags

case basetypes.ObjectTypable:
Expand All @@ -398,8 +402,71 @@ func (expander autoExpander) list(ctx context.Context, vFrom basetypes.ListValua
return diags
}

// listOfString copies a Plugin Framework ListOfString(ish) value to a compatible AWS API value.
func (expander autoExpander) listOfString(ctx context.Context, vFrom basetypes.ListValue, vTo reflect.Value) diag.Diagnostics {
// listOrSetOfInt64 copies a Plugin Framework ListOfInt64(ish) or SetOfInt64(ish) value to a compatible AWS API value.
func (expander autoExpander) listOrSetOfInt64(ctx context.Context, vFrom valueWithElementsAs, vTo reflect.Value) diag.Diagnostics {
var diags diag.Diagnostics

switch vTo.Kind() {
case reflect.Slice:
switch tSliceElem := vTo.Type().Elem(); tSliceElem.Kind() {
case reflect.Int32, reflect.Int64:
//
// types.List(OfInt64) -> []int64 or []int32
//
var to []int64
diags.Append(vFrom.ElementsAs(ctx, &to, false)...)
if diags.HasError() {
return diags
}

vals := reflect.MakeSlice(vTo.Type(), len(to), len(to))
for i := 0; i < len(to); i++ {
vals.Index(i).SetInt(to[i])
}
vTo.Set(vals)
return diags

case reflect.Ptr:
switch tSliceElem.Elem().Kind() {
case reflect.Int32:
//
// types.List(OfInt64) -> []*int32.
//
var to []*int32
diags.Append(vFrom.ElementsAs(ctx, &to, false)...)
if diags.HasError() {
return diags
}

vTo.Set(reflect.ValueOf(to))
return diags

case reflect.Int64:
//
// types.List(OfInt64) -> []*int64.
//
var to []*int64
diags.Append(vFrom.ElementsAs(ctx, &to, false)...)
if diags.HasError() {
return diags
}

vTo.Set(reflect.ValueOf(to))
return diags
}
}
}

tflog.Info(ctx, "AutoFlex Expand; incompatible types", map[string]interface{}{
"from": vFrom.Type(ctx),
"to": vTo.Kind(),
})

return diags
}

// listOrSetOfString copies a Plugin Framework ListOfString(ish) or SetOfString(ish) value to a compatible AWS API value.
func (expander autoExpander) listOrSetOfString(ctx context.Context, vFrom valueWithElementsAs, vTo reflect.Value) diag.Diagnostics {
var diags diag.Diagnostics

switch vTo.Kind() {
Expand Down Expand Up @@ -443,8 +510,8 @@ func (expander autoExpander) listOfString(ctx context.Context, vFrom basetypes.L
}

tflog.Info(ctx, "AutoFlex Expand; incompatible types", map[string]interface{}{
"from list[%s]": vFrom.ElementType(ctx),
"to": vTo.Kind(),
"from": vFrom.Type(ctx),
"to": vTo.Kind(),
})

return diags
Expand Down Expand Up @@ -576,8 +643,12 @@ func (expander autoExpander) set(ctx context.Context, vFrom basetypes.SetValuabl
}

switch v.ElementType(ctx).(type) {
case basetypes.Int64Typable:
diags.Append(expander.listOrSetOfInt64(ctx, v, vTo)...)
return diags

case basetypes.StringTypable:
diags.Append(expander.setOfString(ctx, v, vTo)...)
diags.Append(expander.listOrSetOfString(ctx, v, vTo)...)
return diags

case basetypes.ObjectTypable:
Expand All @@ -595,58 +666,6 @@ func (expander autoExpander) set(ctx context.Context, vFrom basetypes.SetValuabl
return diags
}

// setOfString copies a Plugin Framework SetOfString(ish) value to a compatible AWS API value.
func (expander autoExpander) setOfString(ctx context.Context, vFrom basetypes.SetValue, vTo reflect.Value) diag.Diagnostics {
var diags diag.Diagnostics

switch vTo.Kind() {
case reflect.Slice:
switch tSliceElem := vTo.Type().Elem(); tSliceElem.Kind() {
case reflect.String:
//
// types.Set(OfString) -> []string.
//
var to []string
diags.Append(vFrom.ElementsAs(ctx, &to, false)...)
if diags.HasError() {
return diags
}

// Copy elements individually to enable expansion of lists of
// custom string types (AWS enums)
vals := reflect.MakeSlice(vTo.Type(), len(to), len(to))
for i := 0; i < len(to); i++ {
vals.Index(i).SetString(to[i])
}
vTo.Set(vals)
return diags

case reflect.Ptr:
switch tSliceElem.Elem().Kind() {
case reflect.String:
//
// types.Set(OfString) -> []*string.
//
var to []*string
diags.Append(vFrom.ElementsAs(ctx, &to, false)...)
if diags.HasError() {
return diags
}

vTo.Set(reflect.ValueOf(to))
return diags
}
}
}

tflog.Info(ctx, "AutoFlex Expand; incompatible types", map[string]interface{}{
"from set[%s]": vFrom.ElementType(ctx),
"to": vTo.Kind(),
})

return diags
}

// nestedObjectCollection copies a Plugin Framework NestedObjectCollectionValue value to a compatible AWS API value.
func (expander autoExpander) nestedObjectCollection(ctx context.Context, vFrom fwtypes.NestedObjectCollectionValue, vTo reflect.Value) diag.Diagnostics {
var diags diag.Diagnostics
Expand Down
Loading
Loading