Skip to content

Commit

Permalink
r/aws_auditmanager_account_registration: use only region for id
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-b committed Dec 14, 2022
1 parent 833f75b commit c7c2ad0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions internal/service/auditmanager/account_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package auditmanager

import (
"context"
"strings"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/auditmanager"
Expand Down Expand Up @@ -59,9 +58,8 @@ func (r *resourceAccountRegistration) Schema(ctx context.Context, req resource.S

func (r *resourceAccountRegistration) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
conn := r.Meta().AuditManagerClient
accountID := r.Meta().AccountID
region := r.Meta().Region
id := strings.Join([]string{accountID, region}, ",")
// Registration is applied per region, so use this as the ID
id := r.Meta().Region

var plan resourceAccountRegistrationData
resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ The following arguments are optional:

In addition to all arguments above, the following attributes are exported:

* `id` - Unique identifier for the account registration. This is a comma-separated concatenation of AWS account ID and region.
* `id` - Unique identifier for the account registration. Since registration is applied per AWS region, this will be the active region name (ex. `us-east-1`).
* `status` - Status of the account registration request.

## Import

Audit Manager Account Registration resources can be imported using the `id`, e.g.,

```
$ terraform import aws_auditmanager_account_registration.example 012345678901,us-east-1
$ terraform import aws_auditmanager_account_registration.example us-east-1
```

0 comments on commit c7c2ad0

Please sign in to comment.