Skip to content

Commit

Permalink
fix: reconcile accounts after failed creation
Browse files Browse the repository at this point in the history
This allows Terraform to continue even if no account ID was found, which
is commonly the case after the initial creation failed.

Closes #9
  • Loading branch information
heiko.rothe committed Jun 21, 2021
1 parent 0f4ef31 commit 54d6118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/resource_aws_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ func resourceAWSAccountRead(_ context.Context, d *schema.ResourceData, m interfa
return diag.FromErr(err)
}

// query for account name
// exit read if no account id is found in the product
if accountId == "" {
return diag.Errorf("could not find account ID in provisioned product")
return nil
}

account, err := organizationsconn.DescribeAccount(&organizations.DescribeAccountInput{
Expand Down

0 comments on commit 54d6118

Please sign in to comment.