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

New Resource and Data source: aws_ssmincidents_response_plan #30665

Merged
merged 6 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/30665.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-resource
aws_ssmincidents_response_plan
```

```release-note:new-data-source
aws_ssmincidents_response_plan
```
25 changes: 25 additions & 0 deletions internal/service/ssmincidents/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
)

func FindResponsePlanByID(context context.Context, client *ssmincidents.Client, arn string) (*ssmincidents.GetResponsePlanOutput, error) {
input := &ssmincidents.GetResponsePlanInput{
Arn: aws.String(arn),
}
output, err := client.GetResponsePlan(context, 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 output == nil {
return nil, tfresource.NewEmptyResultError(input)
}

return output, nil
}

func FindReplicationSetByID(context context.Context, client *ssmincidents.Client, arn string) (*types.ReplicationSet, error) {
input := &ssmincidents.GetReplicationSetInput{
Arn: aws.String(arn),
Expand Down
Loading