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

r/aws_guardduty_malware_protection_plan #37919

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
9b85bf9
td(gd): names csv add sdkv2
GlennChia Jun 5, 2024
b3015d9
td(gd): awsclient_gen add guardduty sdkv2
GlennChia Jun 5, 2024
0857351
td(gd): go get sdkv2 packages
GlennChia Jun 5, 2024
487c1da
td(gd): generate sdkv2 with v1
GlennChia Jun 5, 2024
a9aa38e
feat(gd): malware protection plan schema
GlennChia Jun 11, 2024
08ce746
feat(gd): malware protection plan read
GlennChia Jun 11, 2024
93e411e
feat(gd): malware protection plan create
GlennChia Jun 11, 2024
dc63939
feat(gd): malware protection plan update
GlennChia Jun 11, 2024
83ee651
feat(gd): malware protection plan delete
GlennChia Jun 11, 2024
39d2bb0
feat(gd): malware protection plan modify plan tags
GlennChia Jun 11, 2024
9593377
feat(gd): malware protection plan import state
GlennChia Jun 11, 2024
031b61f
build(gd): malware protection plan make gen
GlennChia Jun 11, 2024
a200ca6
test(gd): malware protection plan exports test
GlennChia Jun 11, 2024
474480c
test(gd): malware protection plan basic
GlennChia Jun 11, 2024
780c96c
test(gd): malware protection plan role
GlennChia Jun 11, 2024
07e171d
test(gd): malware protection plan tagging status
GlennChia Jun 11, 2024
ef16d49
test(gd): malware protection plan prot bucket name
GlennChia Jun 11, 2024
c328a45
test(gd): malware protection plan prot obj prefix
GlennChia Jun 11, 2024
348fa95
test(gd): malware protection plan prot disappears
GlennChia Jun 11, 2024
eb0cc5e
test(gd): malware protection plan prot tags
GlennChia Jun 11, 2024
4e045be
docs(gd): malware protection plan
GlennChia Jun 11, 2024
2e9f0a2
ci(gd): malware protection plan
GlennChia Jun 11, 2024
cfee30a
Merge branch 'main' into HEAD
ewbankkit Jun 11, 2024
e262fe2
go get github.com/aws/aws-sdk-go-v2/service/guardduty.
ewbankkit Jun 11, 2024
211ca8a
Run 'make clean-tidy'.
ewbankkit Jun 11, 2024
3aa743e
Run 'make fix-constants PKG=guardduty'.
ewbankkit Jun 11, 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
3 changes: 3 additions & 0 deletions .changelog/37919.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_guardduty_malware_protection_plan
```
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/glacier v1.22.10
github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.24.1
github.com/aws/aws-sdk-go-v2/service/groundstation v1.27.6
github.com/aws/aws-sdk-go-v2/service/guardduty v1.43.0
github.com/aws/aws-sdk-go-v2/service/healthlake v1.24.6
github.com/aws/aws-sdk-go-v2/service/iam v1.32.6
github.com/aws/aws-sdk-go-v2/service/identitystore v1.23.12
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.24.1 h1:bDVYY5tSzBnLAc
github.com/aws/aws-sdk-go-v2/service/globalaccelerator v1.24.1/go.mod h1:ct31bulbJED7Z4Vdtr+Jtvt6bPRB5PdeH96NNm4wkOc=
github.com/aws/aws-sdk-go-v2/service/groundstation v1.27.6 h1:2GSPMCtOlEVwltVhqUT1x6CFKpFi/5D2yFhd/PqaSic=
github.com/aws/aws-sdk-go-v2/service/groundstation v1.27.6/go.mod h1:gFFqhE7646BA034Im+oTpkfnefC1AR/E4ZUTs/sV7lc=
github.com/aws/aws-sdk-go-v2/service/guardduty v1.43.0 h1:Jz/FJc/n27a9j1du1JxtBaMb/Wg/dSkWPbrfn2Y7CT4=
github.com/aws/aws-sdk-go-v2/service/guardduty v1.43.0/go.mod h1:tNfynl7aA5gEHA7yJZiEICHYMkITKSc0Z+vic+YpW0M=
github.com/aws/aws-sdk-go-v2/service/healthlake v1.24.6 h1:AlmacWcocqb7vowwTlYtVR9AbYWW4vFExIoD7+kFR4g=
github.com/aws/aws-sdk-go-v2/service/healthlake v1.24.6/go.mod h1:jp0Co1hHoXMEQTzyRICGBHvN8owh1QISx56d79dulFU=
github.com/aws/aws-sdk-go-v2/service/iam v1.32.6 h1:NRlKKQ/BPHPqsuN2Hy6v4WA8/bsRTP0j8/BFPBC5+SU=
Expand Down
5 changes: 5 additions & 0 deletions internal/conns/awsclient_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions internal/service/guardduty/exports_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package guardduty

// Exports for use in tests only.
var (
ResourceMalwareProtectionPlan = newResourceMalwareProtectionPlan
)
45 changes: 45 additions & 0 deletions internal/service/guardduty/find.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package guardduty

import (
"context"
"errors"

guardduty_v2 "github.com/aws/aws-sdk-go-v2/service/guardduty"
"github.com/aws/aws-sdk-go-v2/service/guardduty/types"
"github.com/aws/aws-sdk-go/aws"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
)

func FindMalwareProtectionPlanByID(ctx context.Context, conn *guardduty_v2.Client, id string) (*guardduty_v2.GetMalwareProtectionPlanOutput, error) {
input := &guardduty_v2.GetMalwareProtectionPlanInput{
MalwareProtectionPlanId: aws.String(id),
}

return FindMalwareProtectionPlan(ctx, conn, input)
}

func FindMalwareProtectionPlan(ctx context.Context, conn *guardduty_v2.Client, input *guardduty_v2.GetMalwareProtectionPlanInput) (*guardduty_v2.GetMalwareProtectionPlanOutput, error) {
result, err := conn.GetMalwareProtectionPlan(ctx, input)

if err != nil {
var nfe *types.ResourceNotFoundException
if errors.As(err, &nfe) {
return nil, &retry.NotFoundError{
LastError: err,
LastRequest: input,
}
}

return nil, err
}

if result == nil {
return nil, tfresource.NewEmptyResultError(input)
}

return result, nil
}
1 change: 1 addition & 0 deletions internal/service/guardduty/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: MPL-2.0

//go:generate go run ../../generate/tags/main.go -ListTags -ServiceTagsMap -UpdateTags
//go:generate go run ../../generate/tags/main.go -AWSSDKVersion=2 -TagsFunc=TagsV2 -KeyValueTagsFunc=keyValueTagsV2 -GetTagsInFunc=getTagsInV2 -SetTagsOutFunc=setTagsOutV2 -ServiceTagsMap -KVTValues -SkipTypesImp -SkipAWSServiceImp -SkipAWSImp -- tagsv2_gen.go
//go:generate go run ../../generate/servicepackage/main.go
// ONLY generate directives and package declaration! Do not add anything else to this file.

Expand Down
Loading
Loading