Skip to content

Commit

Permalink
aws_controltower_control: only query by ARN if it is set
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonaj committed Jun 24, 2024
1 parent 2ff855c commit 413025b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/controltower/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func resourceControlRead(ctx context.Context, d *schema.ResourceData, meta inter

var output *types.EnabledControlDetails
var err error
if v, ok := d.GetOk(names.AttrARN); ok && v.(string) != "" {
output, err = findEnabledControlByARN(ctx, conn, d.Get(names.AttrARN).(string))
if v, ok := d.GetOk(names.AttrARN); ok {
output, err = findEnabledControlByARN(ctx, conn, v.(string))
} else {
// backwards compatibility if ARN is not set from existing state
parts, err := flex.ExpandResourceId(d.Id(), controlResourceIDPartCount, false)
Expand Down

0 comments on commit 413025b

Please sign in to comment.