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_lex_bot, r/aws_lex_intent and r/aws_lex_slot_type: Fix computed behaviour for versions #20336

Merged
merged 5 commits into from
Jul 29, 2021

Conversation

farhanangullia
Copy link
Contributor

@farhanangullia farhanangullia commented Jul 27, 2021

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

Closes #16584

bug:

resource/aws_lex_bot: Fix computed `version` for dependent resources
resource/aws_lex_intent: Fix computed `version` for dependent resources
resource/aws_lex_slot_type: Fix computed `version` for dependent resources

Affected Resource(s)

  • resource: aws_lex_bot
  • resource: aws_lex_intent
  • resource: aws_lex_slot_type

Output from acceptance testing for resource/aws_lex_bot:

$ make testacc TESTARGS='-run=TestAccAwsLexBot_computeVersion'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsLexBot_computeVersion -timeout 180m
=== RUN   TestAccAwsLexBot_computeVersion
--- PASS: TestAccAwsLexBot_computeVersion (130.09s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       131.401s
...

Output from acceptance testing for resource/aws_lex_intent:

$ make testacc TESTARGS='-run=TestAccAwsLexIntent_computeVersion'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsLexIntent_computeVersion -timeout 180m
=== RUN   TestAccAwsLexIntent_computeVersion
=== PAUSE TestAccAwsLexIntent_computeVersion
=== CONT  TestAccAwsLexIntent_computeVersion
--- PASS: TestAccAwsLexIntent_computeVersion (129.99s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       131.426s
...

Output from acceptance testing for resource/aws_lex_slot_type:

$ make testacc TESTARGS='-run=TestAccAwsLexSlotType_computeVersion'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsLexSlotType_computeVersion -timeout 180m
=== RUN   TestAccAwsLexSlotType_computeVersion
=== PAUSE TestAccAwsLexSlotType_computeVersion
=== CONT  TestAccAwsLexSlotType_computeVersion
--- PASS: TestAccAwsLexSlotType_computeVersion (135.58s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       137.159s
...

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/lexmodels Issues and PRs that pertain to the lexmodels service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. and removed service/lexmodels Issues and PRs that pertain to the lexmodels service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 27, 2021
@aristotelesneto
Copy link

I'm affected by this exact issue as described in the associated defect.

This problem is also very similar to a problem the provider previously had with how 'aws_lambda_function' and 'aws_lambda_alias' behaved - #13099 that had @bflad approved and merged the fix for.

Any chance we could have this looked at and merged?

Regards,

Neto

@farhanangullia farhanangullia changed the title r/aws_lex_ aws_lex_bot, r/aws_lex_intent and r/aws_lex_slot_type: Fix computed behaviour for versions r/aws_lex_bot, r/aws_lex_intent and r/aws_lex_slot_type: Fix computed behaviour for versions Jul 28, 2021
@github-actions github-actions bot added service/lexmodels Issues and PRs that pertain to the lexmodels service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 28, 2021
@AdamTylerLynch
Copy link
Collaborator

Seeing a AccTest that has been failing prior to these changes.

make testacc TESTARGS='-run=TestAccAwsLex'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsLex -timeout 180m
=== RUN TestAccAwsLexBotAlias_basic
=== PAUSE TestAccAwsLexBotAlias_basic
=== RUN TestAccAwsLexBotAlias_conversationLogsText
=== PAUSE TestAccAwsLexBotAlias_conversationLogsText
=== RUN TestAccAwsLexBotAlias_conversationLogsAudio
=== PAUSE TestAccAwsLexBotAlias_conversationLogsAudio
=== RUN TestAccAwsLexBotAlias_conversationLogsBoth
=== PAUSE TestAccAwsLexBotAlias_conversationLogsBoth
=== RUN TestAccAwsLexBotAlias_description
=== PAUSE TestAccAwsLexBotAlias_description
=== RUN TestAccAwsLexBotAlias_disappears
=== PAUSE TestAccAwsLexBotAlias_disappears
=== RUN TestAccAwsLexBot_basic
=== PAUSE TestAccAwsLexBot_basic
=== RUN TestAccAwsLexBot_version_serial
=== RUN TestAccAwsLexBot_version_serial/LexBot_createVersion
resource_aws_lex_bot_test.go:145: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.

    (map[string]string) (len=2) {
     (string) (len=14) "create_version": (string) (len=5) "false",
     (string) (len=16) "process_behavior": (string) (len=4) "SAVE"
    }
    
    
    (map[string]string) (len=2) {
     (string) (len=14) "create_version": (string) (len=4) "true",
     (string) (len=16) "process_behavior": (string) (len=5) "BUILD"
    }

=== RUN TestAccAwsLexBot_version_serial/LexBotAlias_botVersion
=== RUN TestAccAwsLexBot_version_serial/DataSourceLexBot_withVersion
=== RUN TestAccAwsLexBot_version_serial/DataSourceLexBotAlias_basic
--- FAIL: TestAccAwsLexBot_version_serial (171.75s)
--- FAIL: TestAccAwsLexBot_version_serial/LexBot_createVersion (39.93s)
--- PASS: TestAccAwsLexBot_version_serial/LexBotAlias_botVersion (43.63s)
--- PASS: TestAccAwsLexBot_version_serial/DataSourceLexBot_withVersion (48.60s)
--- PASS: TestAccAwsLexBot_version_serial/DataSourceLexBotAlias_basic (39.59s)
=== RUN TestAccAwsLexBot_abortStatement
=== PAUSE TestAccAwsLexBot_abortStatement
=== RUN TestAccAwsLexBot_clarificationPrompt
=== PAUSE TestAccAwsLexBot_clarificationPrompt
=== RUN TestAccAwsLexBot_childDirected
=== PAUSE TestAccAwsLexBot_childDirected
=== RUN TestAccAwsLexBot_description
=== PAUSE TestAccAwsLexBot_description
=== RUN TestAccAwsLexBot_detectSentiment
=== PAUSE TestAccAwsLexBot_detectSentiment
=== RUN TestAccAwsLexBot_enableModelImprovements
=== PAUSE TestAccAwsLexBot_enableModelImprovements
=== RUN TestAccAwsLexBot_idleSessionTtlInSeconds
=== PAUSE TestAccAwsLexBot_idleSessionTtlInSeconds
=== RUN TestAccAwsLexBot_intents
=== PAUSE TestAccAwsLexBot_intents
=== RUN TestAccAwsLexBot_computeVersion
--- PASS: TestAccAwsLexBot_computeVersion (64.66s)
=== RUN TestAccAwsLexBot_locale
=== PAUSE TestAccAwsLexBot_locale
=== RUN TestAccAwsLexBot_voiceId
=== PAUSE TestAccAwsLexBot_voiceId
=== RUN TestAccAwsLexBot_disappears
=== PAUSE TestAccAwsLexBot_disappears
=== RUN TestAccAwsLexIntent_basic
=== PAUSE TestAccAwsLexIntent_basic
=== RUN TestAccAwsLexIntent_createVersion
=== PAUSE TestAccAwsLexIntent_createVersion
=== RUN TestAccAwsLexIntent_conclusionStatement
=== PAUSE TestAccAwsLexIntent_conclusionStatement
=== RUN TestAccAwsLexIntent_confirmationPromptAndRejectionStatement
=== PAUSE TestAccAwsLexIntent_confirmationPromptAndRejectionStatement
=== RUN TestAccAwsLexIntent_dialogCodeHook
=== PAUSE TestAccAwsLexIntent_dialogCodeHook
=== RUN TestAccAwsLexIntent_followUpPrompt
=== PAUSE TestAccAwsLexIntent_followUpPrompt
=== RUN TestAccAwsLexIntent_fulfillmentActivity
=== PAUSE TestAccAwsLexIntent_fulfillmentActivity
=== RUN TestAccAwsLexIntent_sampleUtterances
=== PAUSE TestAccAwsLexIntent_sampleUtterances
=== RUN TestAccAwsLexIntent_slots
=== PAUSE TestAccAwsLexIntent_slots
=== RUN TestAccAwsLexIntent_slotsCustom
=== PAUSE TestAccAwsLexIntent_slotsCustom
=== RUN TestAccAwsLexIntent_disappears
=== PAUSE TestAccAwsLexIntent_disappears
=== RUN TestAccAwsLexIntent_updateWithExternalChange
=== PAUSE TestAccAwsLexIntent_updateWithExternalChange
=== RUN TestAccAwsLexIntent_computeVersion
=== PAUSE TestAccAwsLexIntent_computeVersion
=== RUN TestAccAwsLexSlotType_basic
=== PAUSE TestAccAwsLexSlotType_basic
=== RUN TestAccAwsLexSlotType_createVersion
=== PAUSE TestAccAwsLexSlotType_createVersion
=== RUN TestAccAwsLexSlotType_description
=== PAUSE TestAccAwsLexSlotType_description
=== RUN TestAccAwsLexSlotType_enumerationValues
=== PAUSE TestAccAwsLexSlotType_enumerationValues
=== RUN TestAccAwsLexSlotType_name
=== PAUSE TestAccAwsLexSlotType_name
=== RUN TestAccAwsLexSlotType_valueSelectionStrategy
=== PAUSE TestAccAwsLexSlotType_valueSelectionStrategy
=== RUN TestAccAwsLexSlotType_disappears
=== PAUSE TestAccAwsLexSlotType_disappears
=== RUN TestAccAwsLexSlotType_computeVersion
=== PAUSE TestAccAwsLexSlotType_computeVersion
=== CONT TestAccAwsLexBotAlias_basic
=== CONT TestAccAwsLexIntent_conclusionStatement
=== CONT TestAccAwsLexIntent_computeVersion
=== CONT TestAccAwsLexBot_description
=== CONT TestAccAwsLexIntent_sampleUtterances
=== CONT TestAccAwsLexIntent_followUpPrompt
=== CONT TestAccAwsLexBotAlias_disappears
=== CONT TestAccAwsLexSlotType_name
=== CONT TestAccAwsLexBotAlias_description
=== CONT TestAccAwsLexIntent_createVersion
=== CONT TestAccAwsLexSlotType_createVersion
=== CONT TestAccAwsLexIntent_dialogCodeHook
=== CONT TestAccAwsLexIntent_fulfillmentActivity
=== CONT TestAccAwsLexBotAlias_conversationLogsBoth
=== CONT TestAccAwsLexIntent_confirmationPromptAndRejectionStatement
=== CONT TestAccAwsLexSlotType_enumerationValues
=== CONT TestAccAwsLexSlotType_description
=== CONT TestAccAwsLexBot_childDirected
=== CONT TestAccAwsLexSlotType_basic
=== CONT TestAccAwsLexBot_clarificationPrompt
--- PASS: TestAccAwsLexSlotType_basic (68.50s)
=== CONT TestAccAwsLexBot_abortStatement
--- PASS: TestAccAwsLexBotAlias_disappears (82.09s)
=== CONT TestAccAwsLexBot_basic
--- PASS: TestAccAwsLexIntent_fulfillmentActivity (114.86s)
=== CONT TestAccAwsLexBot_intents
--- PASS: TestAccAwsLexBotAlias_conversationLogsBoth (121.69s)
=== CONT TestAccAwsLexBot_locale
--- PASS: TestAccAwsLexBotAlias_basic (129.24s)
=== CONT TestAccAwsLexBot_idleSessionTtlInSeconds
--- PASS: TestAccAwsLexIntent_dialogCodeHook (131.64s)
=== CONT TestAccAwsLexIntent_basic
--- PASS: TestAccAwsLexIntent_computeVersion (134.74s)
=== CONT TestAccAwsLexBot_enableModelImprovements
--- PASS: TestAccAwsLexIntent_conclusionStatement (145.20s)
=== CONT TestAccAwsLexBot_disappears
--- PASS: TestAccAwsLexIntent_sampleUtterances (146.93s)
=== CONT TestAccAwsLexBot_detectSentiment
--- PASS: TestAccAwsLexSlotType_enumerationValues (148.63s)
=== CONT TestAccAwsLexBot_voiceId
--- PASS: TestAccAwsLexSlotType_createVersion (152.19s)
=== CONT TestAccAwsLexIntent_slots
--- PASS: TestAccAwsLexIntent_followUpPrompt (153.41s)
=== CONT TestAccAwsLexIntent_updateWithExternalChange
--- PASS: TestAccAwsLexSlotType_description (154.65s)
=== CONT TestAccAwsLexSlotType_disappears
--- PASS: TestAccAwsLexIntent_createVersion (161.44s)
=== CONT TestAccAwsLexIntent_disappears
--- PASS: TestAccAwsLexBot_childDirected (165.18s)
=== CONT TestAccAwsLexIntent_slotsCustom
--- PASS: TestAccAwsLexBot_clarificationPrompt (167.35s)
=== CONT TestAccAwsLexSlotType_computeVersion
--- PASS: TestAccAwsLexIntent_confirmationPromptAndRejectionStatement (170.90s)
=== CONT TestAccAwsLexSlotType_valueSelectionStrategy
--- PASS: TestAccAwsLexSlotType_name (171.54s)
=== CONT TestAccAwsLexBotAlias_conversationLogsAudio
--- PASS: TestAccAwsLexBot_basic (93.98s)
=== CONT TestAccAwsLexBotAlias_conversationLogsText
--- PASS: TestAccAwsLexBot_description (189.76s)
--- PASS: TestAccAwsLexBotAlias_description (200.37s)
--- PASS: TestAccAwsLexSlotType_disappears (55.24s)
--- PASS: TestAccAwsLexIntent_basic (83.44s)
--- PASS: TestAccAwsLexIntent_disappears (56.22s)
--- PASS: TestAccAwsLexBot_disappears (77.72s)
--- PASS: TestAccAwsLexBot_abortStatement (162.60s)
--- PASS: TestAccAwsLexIntent_slotsCustom (76.76s)
--- PASS: TestAccAwsLexBotAlias_conversationLogsText (83.25s)
--- PASS: TestAccAwsLexIntent_updateWithExternalChange (106.74s)
--- PASS: TestAccAwsLexBot_locale (141.43s)
--- PASS: TestAccAwsLexBot_idleSessionTtlInSeconds (138.69s)
--- PASS: TestAccAwsLexBot_enableModelImprovements (134.25s)
--- PASS: TestAccAwsLexIntent_slots (117.90s)
--- PASS: TestAccAwsLexSlotType_valueSelectionStrategy (103.84s)
--- PASS: TestAccAwsLexBot_detectSentiment (128.83s)
--- PASS: TestAccAwsLexBot_voiceId (129.54s)
--- PASS: TestAccAwsLexSlotType_computeVersion (114.30s)
--- PASS: TestAccAwsLexBot_intents (167.71s)
--- PASS: TestAccAwsLexBotAlias_conversationLogsAudio (113.51s)
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 523.377s
FAIL
make: *** [testacc] Error 1

@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 28, 2021
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

LGTM @farhanangullia , thank you for the fix 🚀

Output of LexBot_computeVersion test without fix:

=== RUN   TestAccAwsLexBot_computeVersion
    resource_aws_lex_bot_test.go:573: Step 2/2 error: Check failed: 1 error occurred:
        	* Check 6/8 error: aws_lex_bot_alias.test: Attribute 'bot_version' expected "2", got "1"

--- FAIL: TestAccAwsLexBot_computeVersion (65.48s)

Output of acceptance tests with fix:

--- FAIL: TestAccAwsLexBot_version_serial (881.63s)
    --- PASS: TestAccAwsLexBot_version_serial/LexBotAlias_botVersion (781.22s)
    --- PASS: TestAccAwsLexBot_version_serial/DataSourceLexBot_withVersion (32.86s)
    --- PASS: TestAccAwsLexBot_version_serial/DataSourceLexBotAlias_basic (34.47s)
    --- FAIL: TestAccAwsLexBot_version_serial/LexBot_createVersion (33.08s)
--- PASS: TestAccAwsLexBot_disappears (101.57s)
--- PASS: TestAccAwsLexBot_basic (120.35s)
--- PASS: TestAccAwsLexBot_description (238.50s)
--- PASS: TestAccAwsLexBot_abortStatement (250.11s)
--- PASS: TestAccAwsLexBot_childDirected (259.81s)
--- PASS: TestAccAwsLexBot_idleSessionTtlInSeconds (263.26s)
--- PASS: TestAccAwsLexBot_detectSentiment (300.42s)
--- PASS: TestAccAwsLexBot_intents (301.41s)
--- PASS: TestAccAwsLexBot_locale (305.04s)
--- PASS: TestAccAwsLexBot_clarificationPrompt (305.95s)
--- PASS: TestAccAwsLexBot_voiceId (308.49s)
--- PASS: TestAccAwsLexBot_enableModelImprovements (311.38s)
--- PASS: TestAccAwsLexIntent_disappears (82.45s)
--- PASS: TestAccAwsLexIntent_slotsCustom (135.87s)
--- PASS: TestAccAwsLexIntent_basic (154.85s)
--- PASS: TestAccAwsLexIntent_updateWithExternalChange (202.52s)
--- PASS: TestAccAwsLexIntent_confirmationPromptAndRejectionStatement (1952.44s)
--- PASS: TestAccAwsLexIntent_conclusionStatement (1954.12s)
--- PASS: TestAccAwsLexIntent_sampleUtterances (2004.32s)
--- PASS: TestAccAwsLexIntent_slots (2027.01s)
--- PASS: TestAccAwsLexIntent_dialogCodeHook (2114.70s)
--- PASS: TestAccAwsLexIntent_createVersion (2163.81s)
--- PASS: TestAccAwsLexIntent_fulfillmentActivity (2177.76s)
--- PASS: TestAccAwsLexIntent_computeVersion (2205.51s)
--- PASS: TestAccAwsLexSlotType_disappears (19.00s)
--- PASS: TestAccAwsLexSlotType_basic (26.85s)
--- PASS: TestAccAwsLexSlotType_name (48.06s)
--- PASS: TestAccAwsLexSlotType_description (48.93s)
--- PASS: TestAccAwsLexSlotType_computeVersion (51.75s)
--- PASS: TestAccAwsLexSlotType_enumerationValues (52.68s)
--- PASS: TestAccAwsLexSlotType_valueSelectionStrategy (57.05s)
--- PASS: TestAccAwsLexSlotType_createVersion (65.53s)

LextBot failure related to #15555

@anGie44 anGie44 added this to the v3.52.0 milestone Jul 29, 2021
@anGie44 anGie44 merged commit c0b1b7b into hashicorp:main Jul 29, 2021
@github-actions
Copy link

This functionality has been released in v3.52.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 Aug 29, 2021
@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
bug Addresses a defect in current functionality. partner Contribution from a partner. service/lexmodels Issues and PRs that pertain to the lexmodels 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.

aws_lex_bot Unable to update intent version based on slot type dependency
5 participants