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

r/aws_kendra_index #24920

Merged
merged 59 commits into from
Jun 14, 2022
Merged

r/aws_kendra_index #24920

merged 59 commits into from
Jun 14, 2022

Conversation

GlennChia
Copy link
Collaborator

@GlennChia GlennChia commented May 22, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #13367
Closes #24922

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccKendraIndex' PKG=kendra ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kendra/... -v -count 1 -parallel 5  -run=TestAccKendraIndex -timeout 180m
=== RUN   TestAccKendraIndex_basic
=== PAUSE TestAccKendraIndex_basic
=== RUN   TestAccKendraIndex_serverSideEncryption
=== PAUSE TestAccKendraIndex_serverSideEncryption
=== RUN   TestAccKendraIndex_updateCapacityUnits
=== PAUSE TestAccKendraIndex_updateCapacityUnits
=== RUN   TestAccKendraIndex_updateDescription
=== PAUSE TestAccKendraIndex_updateDescription
=== RUN   TestAccKendraIndex_updateName
=== PAUSE TestAccKendraIndex_updateName
=== RUN   TestAccKendraIndex_updateUserTokenJSON
=== PAUSE TestAccKendraIndex_updateUserTokenJSON
=== RUN   TestAccKendraIndex_updateTags
=== PAUSE TestAccKendraIndex_updateTags
=== RUN   TestAccKendraIndex_updateRoleARN
=== PAUSE TestAccKendraIndex_updateRoleARN
=== RUN   TestAccKendraIndex_disappears
=== PAUSE TestAccKendraIndex_disappears
=== CONT  TestAccKendraIndex_basic
=== CONT  TestAccKendraIndex_updateUserTokenJSON
=== CONT  TestAccKendraIndex_updateRoleARN
=== CONT  TestAccKendraIndex_updateTags
=== CONT  TestAccKendraIndex_disappears
--- PASS: TestAccKendraIndex_basic (648.89s)
=== CONT  TestAccKendraIndex_updateDescription
--- PASS: TestAccKendraIndex_updateTags (1143.41s)
=== CONT  TestAccKendraIndex_updateName
--- PASS: TestAccKendraIndex_updateUserTokenJSON (1969.43s)
=== CONT  TestAccKendraIndex_updateCapacityUnits
--- PASS: TestAccKendraIndex_updateRoleARN (1970.17s)
=== CONT  TestAccKendraIndex_serverSideEncryption
--- PASS: TestAccKendraIndex_disappears (1980.02s)
--- PASS: TestAccKendraIndex_updateDescription (1646.30s)
--- PASS: TestAccKendraIndex_updateName (2116.22s)
--- PASS: TestAccKendraIndex_serverSideEncryption (1821.36s)
--- PASS: TestAccKendraIndex_updateCapacityUnits (4124.98s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/kendra     6094.482s

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. flex Pertains to FLatteners and EXpanders. generators Relates to code generators. provider Pertains to the provider itself, rather than any interaction with AWS. service/kendra Issues and PRs that pertain to the kendra service. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 22, 2022
@github-actions github-actions bot added the flex Pertains to FLatteners and EXpanders. label Jun 10, 2022
Comment on lines 420 to 438
// 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)
}

Copy link
Contributor

@anGie44 anGie44 Jun 11, 2022

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.

Suggested change
// 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)
}

Copy link
Collaborator Author

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?

@github-actions github-actions bot removed the flex Pertains to FLatteners and EXpanders. label Jun 13, 2022
@GlennChia
Copy link
Collaborator Author

Re-ran acceptance tests:

$ make testacc TESTARGS='-run=TestAccKendraIndex' PKG=kendra ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kendra/... -v -count 1 -parallel 5  -run=TestAccKendraIndex -timeout 180m
=== RUN   TestAccKendraIndex_basic
=== PAUSE TestAccKendraIndex_basic
=== RUN   TestAccKendraIndex_serverSideEncryption
=== PAUSE TestAccKendraIndex_serverSideEncryption
=== RUN   TestAccKendraIndex_updateCapacityUnits
=== PAUSE TestAccKendraIndex_updateCapacityUnits
=== RUN   TestAccKendraIndex_updateDescription
=== PAUSE TestAccKendraIndex_updateDescription
=== RUN   TestAccKendraIndex_updateName
=== PAUSE TestAccKendraIndex_updateName
=== RUN   TestAccKendraIndex_updateUserTokenJSON
=== PAUSE TestAccKendraIndex_updateUserTokenJSON
=== RUN   TestAccKendraIndex_updateTags
=== PAUSE TestAccKendraIndex_updateTags
=== RUN   TestAccKendraIndex_updateRoleARN
=== PAUSE TestAccKendraIndex_updateRoleARN
=== RUN   TestAccKendraIndex_disappears
=== PAUSE TestAccKendraIndex_disappears
=== CONT  TestAccKendraIndex_basic
=== CONT  TestAccKendraIndex_updateUserTokenJSON
=== CONT  TestAccKendraIndex_updateRoleARN
=== CONT  TestAccKendraIndex_updateTags
=== CONT  TestAccKendraIndex_disappears
--- PASS: TestAccKendraIndex_basic (648.89s)
=== CONT  TestAccKendraIndex_updateDescription
--- PASS: TestAccKendraIndex_updateTags (1143.41s)
=== CONT  TestAccKendraIndex_updateName
--- PASS: TestAccKendraIndex_updateUserTokenJSON (1969.43s)
=== CONT  TestAccKendraIndex_updateCapacityUnits
--- PASS: TestAccKendraIndex_updateRoleARN (1970.17s)
=== CONT  TestAccKendraIndex_serverSideEncryption
--- PASS: TestAccKendraIndex_disappears (1980.02s)
--- PASS: TestAccKendraIndex_updateDescription (1646.30s)
--- PASS: TestAccKendraIndex_updateName (2116.22s)
--- PASS: TestAccKendraIndex_serverSideEncryption (1821.36s)
--- PASS: TestAccKendraIndex_updateCapacityUnits (4124.98s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/kendra     6094.482s

@anGie44
Copy link
Contributor

anGie44 commented Jun 14, 2022

Output of acceptance tests (commercial):

$ make testacc TESTARGS='-run=TestAccKendraIndex_' PKG=kendra ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kendra/... -v -count 1 -parallel 5  -run=TestAccKendraIndex_ -timeout 180m
=== RUN   TestAccKendraIndex_basic
=== PAUSE TestAccKendraIndex_basic
=== RUN   TestAccKendraIndex_serverSideEncryption
=== PAUSE TestAccKendraIndex_serverSideEncryption
=== RUN   TestAccKendraIndex_updateCapacityUnits
=== PAUSE TestAccKendraIndex_updateCapacityUnits
=== RUN   TestAccKendraIndex_updateDescription
=== PAUSE TestAccKendraIndex_updateDescription
=== RUN   TestAccKendraIndex_updateName
=== PAUSE TestAccKendraIndex_updateName
=== RUN   TestAccKendraIndex_updateUserTokenJSON
=== PAUSE TestAccKendraIndex_updateUserTokenJSON
=== RUN   TestAccKendraIndex_updateTags
=== PAUSE TestAccKendraIndex_updateTags
=== RUN   TestAccKendraIndex_updateRoleARN
=== PAUSE TestAccKendraIndex_updateRoleARN
=== RUN   TestAccKendraIndex_disappears
=== PAUSE TestAccKendraIndex_disappears
=== CONT  TestAccKendraIndex_basic
=== CONT  TestAccKendraIndex_disappears
=== CONT  TestAccKendraIndex_updateName
=== CONT  TestAccKendraIndex_updateRoleARN
=== CONT  TestAccKendraIndex_updateTags
--- PASS: TestAccKendraIndex_updateName (1215.67s)
=== CONT  TestAccKendraIndex_updateUserTokenJSON
--- PASS: TestAccKendraIndex_disappears (1226.29s)
=== CONT  TestAccKendraIndex_updateCapacityUnits
--- PASS: TestAccKendraIndex_basic (1605.74s)
=== CONT  TestAccKendraIndex_updateDescription
--- PASS: TestAccKendraIndex_updateRoleARN (1632.77s)
=== CONT  TestAccKendraIndex_serverSideEncryption
--- PASS: TestAccKendraIndex_updateTags (1660.11s)
--- PASS: TestAccKendraIndex_updateUserTokenJSON (980.96s)
--- PASS: TestAccKendraIndex_updateDescription (1637.03s)
--- PASS: TestAccKendraIndex_serverSideEncryption (1680.23s)
--- PASS: TestAccKendraIndex_updateCapacityUnits (3682.23s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kendra	4913.792s

Output of acceptance tests (gov cloud):

$ make testacc TESTARGS='-run=TestAccKendraIndex_' PKG=kendra ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kendra/... -v -count 1 -parallel 5  -run=TestAccKendraIndex_ -timeout 180m
=== RUN   TestAccKendraIndex_basic
=== PAUSE TestAccKendraIndex_basic
=== RUN   TestAccKendraIndex_serverSideEncryption
=== PAUSE TestAccKendraIndex_serverSideEncryption
=== RUN   TestAccKendraIndex_updateCapacityUnits
=== PAUSE TestAccKendraIndex_updateCapacityUnits
=== RUN   TestAccKendraIndex_updateDescription
=== PAUSE TestAccKendraIndex_updateDescription
=== RUN   TestAccKendraIndex_updateName
=== PAUSE TestAccKendraIndex_updateName
=== RUN   TestAccKendraIndex_updateUserTokenJSON
=== PAUSE TestAccKendraIndex_updateUserTokenJSON
=== RUN   TestAccKendraIndex_updateTags
=== PAUSE TestAccKendraIndex_updateTags
=== RUN   TestAccKendraIndex_updateRoleARN
=== PAUSE TestAccKendraIndex_updateRoleARN
=== RUN   TestAccKendraIndex_disappears
=== PAUSE TestAccKendraIndex_disappears
=== CONT  TestAccKendraIndex_basic
=== CONT  TestAccKendraIndex_updateUserTokenJSON
=== CONT  TestAccKendraIndex_disappears
=== CONT  TestAccKendraIndex_updateRoleARN
=== CONT  TestAccKendraIndex_updateDescription
--- PASS: TestAccKendraIndex_updateRoleARN (1005.28s)
=== CONT  TestAccKendraIndex_updateName
--- PASS: TestAccKendraIndex_updateDescription (1128.96s)
=== CONT  TestAccKendraIndex_updateCapacityUnits
--- PASS: TestAccKendraIndex_basic (2328.40s)
=== CONT  TestAccKendraIndex_serverSideEncryption
--- PASS: TestAccKendraIndex_updateUserTokenJSON (2332.72s)
=== CONT  TestAccKendraIndex_updateTags
--- PASS: TestAccKendraIndex_disappears (2387.11s)
--- PASS: TestAccKendraIndex_updateName (2359.16s)
--- PASS: TestAccKendraIndex_updateTags (1341.43s)
--- PASS: TestAccKendraIndex_serverSideEncryption (1735.79s)
--- PASS: TestAccKendraIndex_updateCapacityUnits (3988.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kendra	5120.875s

@anGie44 anGie44 modified the milestones: Roadmap, v4.19.0 Jun 14, 2022
@anGie44 anGie44 merged commit d8ad188 into hashicorp:main Jun 14, 2022
@github-actions
Copy link

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!

@GlennChia GlennChia deleted the f-aws_kendra_index branch June 19, 2022 12:38
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2022
@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
client-connections Pertains to the AWS Client and service connections. documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. partner Contribution from a partner. provider Pertains to the provider itself, rather than any interaction with AWS. service/kendra Issues and PRs that pertain to the kendra service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new resource for aws_kendra_index
3 participants