-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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_kendra_index #24920
r/aws_kendra_index #24920
Conversation
4b05209
to
e036f53
Compare
6559997
to
e9428ee
Compare
e9428ee
to
abbef4a
Compare
internal/service/kendra/index.go
Outdated
// arn needed to update tags | ||
arn := arn.ARN{ | ||
Partition: meta.(*conns.AWSClient).Partition, | ||
Service: "kendra", | ||
Region: meta.(*conns.AWSClient).Region, | ||
AccountID: meta.(*conns.AWSClient).AccountID, | ||
Resource: fmt.Sprintf("index/%s", d.Id()), | ||
}.String() | ||
|
||
d.Set("arn", arn) | ||
|
||
// waiter since the status changes from CREATING to either ACTIVE or FAILED | ||
if _, err := waitIndexCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { | ||
return diag.Errorf("error waiting for Index (%s) creation: %s", d.Id(), err) | ||
} | ||
|
||
return resourceIndexUpdate(ctx, d, meta) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we won't need to update tags on create as they're passed directly in the CreateIndex
method above, what if we only do an update when the capacity_units
param is present as that is the only param we really need to do the update for at this stage e.g.
// arn needed to update tags | |
arn := arn.ARN{ | |
Partition: meta.(*conns.AWSClient).Partition, | |
Service: "kendra", | |
Region: meta.(*conns.AWSClient).Region, | |
AccountID: meta.(*conns.AWSClient).AccountID, | |
Resource: fmt.Sprintf("index/%s", d.Id()), | |
}.String() | |
d.Set("arn", arn) | |
// waiter since the status changes from CREATING to either ACTIVE or FAILED | |
if _, err := waitIndexCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { | |
return diag.Errorf("error waiting for Index (%s) creation: %s", d.Id(), err) | |
} | |
return resourceIndexUpdate(ctx, d, meta) | |
} | |
// waiter since the status changes from CREATING to either ACTIVE or FAILED | |
if _, err := waitIndexCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { | |
return diag.Errorf("error waiting for Index (%s) creation: %s", d.Id(), err) | |
} | |
if v, ok := d.GetOk("capacity_units"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { | |
return resourceIndexUpdate(ctx, d, meta) | |
} | |
return resourceIndexRead(ctx, d, meta) | |
} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh there's also the document_metadata_configuration_updates
that we have to update. Shall I move it up as well to group it with the capacity_units
?
separate resource to handle this argument
Co-authored-by: Angie Pinilla <[email protected]>
Re-ran acceptance tests:
|
Output of acceptance tests (commercial):
Output of acceptance tests (gov cloud):
|
This functionality has been released in v4.19.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Relates #13367
Closes #24922
Output from acceptance testing: