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

Bot Resource for lexv2 #33475

Merged
merged 10 commits into from
Sep 27, 2023
Merged

Bot Resource for lexv2 #33475

merged 10 commits into from
Sep 27, 2023

Conversation

nam054
Copy link
Contributor

@nam054 nam054 commented Sep 14, 2023

Description

Add bot resource to lexv2 service.

Relations

Relates #21375

References

Output from Acceptance Testing

> make testacc TESTS=TestAccLexV2ModelsBot_ PKG=lexv2models
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lexv2models/... -v -count 1 -parallel 20 -run='TestAccLexV2ModelsBot_'  -timeout 180m
=== RUN   TestAccLexV2ModelsBot_basic
=== PAUSE TestAccLexV2ModelsBot_basic
=== RUN   TestAccLexV2ModelsBot_tags
=== PAUSE TestAccLexV2ModelsBot_tags
=== RUN   TestAccLexV2ModelsBot_disappears
=== PAUSE TestAccLexV2ModelsBot_disappears
=== CONT  TestAccLexV2ModelsBot_disappears
=== CONT  TestAccLexV2ModelsBot_basic
=== CONT  TestAccLexV2ModelsBot_tags
--- PASS: TestAccLexV2ModelsBot_disappears (24.47s)
--- PASS: TestAccLexV2ModelsBot_basic (24.88s)
--- PASS: TestAccLexV2ModelsBot_tags (51.44s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models        54.486s

...

@github-actions
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/lexv2models Issues and PRs that pertain to the lexv2models service. labels Sep 14, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 14, 2023
@nam054 nam054 marked this pull request as ready for review September 21, 2023 20:06
@github-actions github-actions bot added the generators Relates to code generators. label Sep 21, 2023
@nam054 nam054 force-pushed the f-bot-resource branch 2 times, most recently from 10da6a1 to 1ea3215 Compare September 21, 2023 20:15
@nam054 nam054 force-pushed the f-bot-resource branch 4 times, most recently from b4678b9 to eca9c09 Compare September 26, 2023 03:29
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 🎉 Just a few minor things.

func newResourceBot(_ context.Context) (resource.ResourceWithConfigure, error) {
r := &resourceBot{}

r.SetDefaultCreateTimeout(30 * time.Minute)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeouts are always a good idea.

internal/framework/flex/int_test.go Show resolved Hide resolved
out, err := conn.CreateBot(ctx, &in)
if err != nil {
resp.Diagnostics.AddError(
create.ProblemStandardMessage(names.LexV2Models, create.ErrActionCreating, ResNameBot, plan.Name.String(), err),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp)
}

func waitBotCreated(ctx context.Context, conn *lexmodelsv2.Client, id string, timeout time.Duration) (*lexmodelsv2.DescribeBotOutput, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, with the naming

}
}

func FindBotByID(ctx context.Context, conn *lexmodelsv2.Client, id string) (*lexmodelsv2.DescribeBotOutput, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used in tests? I'm guessing that's why it's exported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! It's used in the Destroy test


The following arguments are required:

* `name` - The name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `name` - The name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
* `name` - Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.


* `name` - The name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
* `data_privacy` - Provides information on additional privacy protections Amazon Lex should use with the bot's data. See [`data_privacy`](#data-privacy)
* `idle_session_ttl_in_seconds` - The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `idle_session_ttl_in_seconds` - The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
* `idle_session_ttl_in_seconds` - Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.

Convention (not always followed very well) is to drop "The", "A", and "An" at the beginning of argument descriptions.

* `name` - The name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
* `data_privacy` - Provides information on additional privacy protections Amazon Lex should use with the bot's data. See [`data_privacy`](#data-privacy)
* `idle_session_ttl_in_seconds` - The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
* `role_arn` - The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `role_arn` - The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.
* `role_arn` - ARN of an IAM role that has permission to access the bot.


The following arguments are optional:

* `members` - List of bot members in a network to be created. See [`bot_members`](#bot-members).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ☝️

Comment on lines 67 to 69
* `create` - (Default `60m`)
* `update` - (Default `180m`)
* `delete` - (Default `90m`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `create` - (Default `60m`)
* `update` - (Default `180m`)
* `delete` - (Default `90m`)
* `create` - (Default `30m`)
* `update` - (Default `30m`)
* `delete` - (Default `30m`)

@nam054 nam054 merged commit 1cc90f7 into main Sep 27, 2023
42 checks passed
@nam054 nam054 deleted the f-bot-resource branch September 27, 2023 21:36
@github-actions github-actions bot added this to the v5.19.0 milestone Sep 27, 2023
github-actions bot pushed a commit that referenced this pull request Sep 27, 2023
@github-actions
Copy link

This functionality has been released in v5.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!

@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 Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/lexv2models Issues and PRs that pertain to the lexv2models 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.

2 participants