hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
240 stars 107 forks source link

Error: Provider produced inconsistent result after apply - awscc_lex_bot #1449

Open awsjasono opened 4 months ago

awsjasono commented 4 months ago

Community Note

Terraform CLI and Terraform AWS Cloud Control Provider Version

Terraform v1.7.3 on linux_amd64

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_lex_bot" "demo_lexv2_bot" {
  name = "ACME_botTest3"
  role_arn = xxx
  data_privacy = {
    child_directed = false
  }
  idle_session_ttl_in_seconds = 300
  auto_build_bot_locales      = true
  bot_locales = [
    {
      locale_id = "en_US",
      nlu_confidence_threshold = 0.6,
      voice_settings = {
        voice_id = "Joanna"
      },
      intents = [
        {
          name = "Sales",
          sample_utterances = [
            {
              utterance = "sales"
            }
          ],
          dialog_code_hook = {
            enabled = false
          },
          fulfillment_code_hook = {
            enabled = false,
            post_fulfillment_status_specification = {
              success_response = {
                message_groups_list = [
                  {
                    message = {
                      plain_text_message = {
                        value = "Transferring call to Sales"
                      }
                    }
                  }
                ],
                allow_interrupt = true
              },
              failure_response = {
                message_groups_list = [
                  {
                    message = {
                      plain_text_message = {
                        value = "Oops"
                      }
                    }
                  }
                ],
                allow_interrupt = true
              }
            }
          }
        },
        {
          name = "Finance",
          sampleUtterances = [
            {
              utterance = "finance"
            }
          ],
          dialogCodeHook = {
            enabled = false
          },
          fulfillment_codeHook = {
            enabled = false,
            post_fulfillment_status_specification = {
              success_response = {
                message_groups_list = [
                  {
                    message = {
                      plain_text_message = {
                        value = "Transferring call to Finance"
                      }
                    }
                  }
                ],
                allow_interrupt = true
              },
              failure_response = {
                message_groups_list = [
                  {
                    message = {
                      plain_text_message = {
                        value = "Oops"
                      }
                    }
                  }
                ],
                allow_interrupt = true
              }
            }
          }
        },
        {
          name        = "FallbackIntent",
          description = "Default intent when no other intent matches",
          dialog_code_hook = {
            enabled = false
          },
          fulfillment_code_hook = {
            enabled = false
          },
          parent_intent_signature = "AMAZON.FallbackIntent"
        }
      ]
    }
  ]
}

Debug Output

Panic Output

Expected Behavior

terraform should have deployed a lexbot successfully

Actual Behavior

terraform did create the lexbot, however the operation showed as failed and if rerunning the same same operation it doesn't recognize that the lexbot was deployed successfully

Steps to Reproduce

  1. terraform apply

Important Factoids

n/a

References

n/a

wellsiau-aws commented 2 months ago

@awsjasono , thanks for reporting this issue, do you have the debug log to share?

I suspect this is related to #1586

awsjasono commented 1 month ago

tf-lex-debug.txt @wellsiau-aws Yes, it is super long, but I shared from the point of bot being created. Also, I upgraded to 0.76 just to check and same issue exists.