Skip to content

r/aws_lexv2models_intent: prompt specification defaults #43147

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

Merged
merged 13 commits into from
Jun 26, 2025

Conversation

johnsonaj
Copy link
Contributor

@johnsonaj johnsonaj commented Jun 23, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

confirmation_settings.prompt_specification.prompt_attempt_specifications can have default values that cause diffs if not present in the configuration.

This change will check for defaults and checks that they are semantically equal.

Relations

Closes #35346

References

Relates hashicorp/terraform-plugin-framework#1074

Output from Acceptance Testing

% make testacc TESTARGS="-run=TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults" PKG=lexv2models

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/lexv2models/... -v -count 1 -parallel 20  -run=TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults -timeout 360m -vet=off
2025/06/23 13:15:08 Creating Terraform AWS Provider (SDKv2-style)...
2025/06/23 13:15:08 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults
=== PAUSE TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults
=== CONT  TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults
    intent_test.go:1038: Step 1/1 error: After applying this test step, the refresh plan was not empty.
        stdout


        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place

        Terraform will perform the following actions:

          # aws_lexv2models_intent.test will be updated in-place
          ~ resource "aws_lexv2models_intent" "test" {
                id                     = "BZEZCVW43A:BXIEA5F9ML:DRAFT:en_US"
                name                   = "tf-acc-test-7357476630193653006"
                # (7 unchanged attributes hidden)

              ~ confirmation_setting {
                    # (1 unchanged attribute hidden)

                  ~ prompt_specification {
                        # (3 unchanged attributes hidden)

                      - prompt_attempts_specification {
                          - allow_interrupt = true -> null
                          - map_block_key   = "Initial" -> null

                          - allowed_input_types {
                              - allow_audio_input = true -> null
                              - allow_dtmf_input  = true -> null
                            }

                          - audio_and_dtmf_input_specification {
                              - start_timeout_ms = 4000 -> null

                              - audio_specification {
                                  - end_timeout_ms = 640 -> null
                                  - max_length_ms  = 15000 -> null
                                }

                              - dtmf_specification {
                                  - deletion_character = "*" -> null
                                  - end_character      = "#" -> null
                                  - end_timeout_ms     = 5000 -> null
                                  - max_length         = 513 -> null
                                }
                            }

                          - text_input_specification {
                              - start_timeout_ms = 30000 -> null
                            }
                        }
                      - prompt_attempts_specification {
                          - allow_interrupt = true -> null
                          - map_block_key   = "Retry1" -> null

                          - allowed_input_types {
                              - allow_audio_input = true -> null
                              - allow_dtmf_input  = true -> null
                            }

                          - audio_and_dtmf_input_specification {
                              - start_timeout_ms = 4000 -> null

                              - audio_specification {
                                  - end_timeout_ms = 640 -> null
                                  - max_length_ms  = 15000 -> null
                                }

                              - dtmf_specification {
                                  - deletion_character = "*" -> null
                                  - end_character      = "#" -> null
                                  - end_timeout_ms     = 5000 -> null
                                  - max_length         = 513 -> null
                                }
                            }

                          - text_input_specification {
                              - start_timeout_ms = 30000 -> null
                            }
                        }

                        # (1 unchanged block hidden)
                    }
                }
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults (42.07s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models	47.844s
FAIL
make: *** [testacc] Error 1

after

% make testacc TESTARGS="-run=TestAccLexV2ModelsIntent_" PKG=lexv2models

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/lexv2models/... -v -count 1 -parallel 20  -run=TestAccLexV2ModelsIntent_ -timeout 360m -vet=off
2025/06/23 13:35:58 Creating Terraform AWS Provider (SDKv2-style)...
2025/06/23 13:35:58 Initializing Terraform AWS Provider (SDKv2-style)...
--- PASS: TestAccLexV2ModelsIntent_disappears (47.76s)
--- PASS: TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults (49.72s)
--- PASS: TestAccLexV2ModelsIntent_basic (56.36s)
--- PASS: TestAccLexV2ModelsIntent_updateInputContext (64.76s)
--- PASS: TestAccLexV2ModelsIntent_updateSampleUtterance (64.77s)
--- PASS: TestAccLexV2ModelsIntent_updateClosingSetting (65.68s)
--- PASS: TestAccLexV2ModelsIntent_updateOutputContext (68.15s)
--- PASS: TestAccLexV2ModelsIntent_updateDialogCodeHook (69.70s)
--- PASS: TestAccLexV2ModelsIntent_updateFulfillmentCodeHook (70.40s)
--- PASS: TestAccLexV2ModelsIntent_updateInitialResponseSetting (70.45s)
--- PASS: TestAccLexV2ModelsIntent_updateConfirmationSetting (71.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models	77.241s
Copy link

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. 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/M Managed by automation to categorize the size of a PR. labels Jun 23, 2025
@johnsonaj johnsonaj added the bug Addresses a defect in current functionality. label Jun 23, 2025
@github-actions github-actions bot added the size/L Managed by automation to categorize the size of a PR. label Jun 23, 2025
@github-actions github-actions bot added the size/XL Managed by automation to categorize the size of a PR. label Jun 23, 2025
@johnsonaj johnsonaj marked this pull request as ready for review June 23, 2025 20:59
@johnsonaj johnsonaj requested a review from a team as a code owner June 23, 2025 20:59
@johnsonaj
Copy link
Contributor Author

% go test -count=1 -v ./internal/service/lexv2models/... -run=TestArePromptAttemptsEqual

2025/06/24 17:20:58 Creating Terraform AWS Provider (SDKv2-style)...
2025/06/24 17:20:58 Initializing Terraform AWS Provider (SDKv2-style)...
--- PASS: TestArePromptAttemptsEqual (0.01s)
    --- PASS: TestArePromptAttemptsEqual/old_values_of_null (0.00s)
    --- PASS: TestArePromptAttemptsEqual/new_value_without_default (0.00s)
    --- PASS: TestArePromptAttemptsEqual/new_value_with_specified_default (0.00s)
    --- PASS: TestArePromptAttemptsEqual/old_values_of_null#01 (0.00s)
    --- PASS: TestArePromptAttemptsEqual/new_values_of_null (0.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models	5.721s
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

% make testacc PKG=lexv2models TESTS=TestAccLexV2ModelsIntent_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/lexv2models/... -v -count 1 -parallel 20 -run='TestAccLexV2ModelsIntent_'  -timeout 360m -vet=off
2025/06/26 11:01:11 Creating Terraform AWS Provider (SDKv2-style)...
2025/06/26 11:01:11 Initializing Terraform AWS Provider (SDKv2-style)...

--- PASS: TestAccLexV2ModelsIntent_disappears (47.19s)
--- PASS: TestAccLexV2ModelsIntent_basic (53.79s)
--- PASS: TestAccLexV2ModelsIntent_updateInputContext (61.21s)
--- PASS: TestAccLexV2ModelsIntent_updateClosingSetting (64.70s)
--- PASS: TestAccLexV2ModelsIntent_updateFulfillmentCodeHook (64.73s)
--- PASS: TestAccLexV2ModelsIntent_updateSampleUtterance (66.24s)
--- PASS: TestAccLexV2ModelsIntent_updateConfirmationSetting (67.15s)
--- PASS: TestAccLexV2ModelsIntent_updateDialogCodeHook (69.46s)
--- PASS: TestAccLexV2ModelsIntent_confirmationSetting_promptSpecifications_defaults (70.35s)
--- PASS: TestAccLexV2ModelsIntent_updateOutputContext (70.55s)
--- PASS: TestAccLexV2ModelsIntent_updateInitialResponseSetting (73.95s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lexv2models        79.811s
@johnsonaj johnsonaj merged commit 8e686f2 into main Jun 26, 2025
41 checks passed
@johnsonaj johnsonaj deleted the b-lexv2models_intent_promptspecification_default branch June 26, 2025 15:28
Copy link

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v6.1.0 milestone Jun 26, 2025
terraform-aws-provider bot pushed a commit that referenced this pull request Jun 26, 2025
Copy link

This functionality has been released in v6.1.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/lexv2models Issues and PRs that pertain to the lexv2models service. size/L Managed by automation to categorize the size of a PR. size/M Managed by automation to categorize the size of a PR. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
2 participants