hashicorp / terraform-provider-awscc

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

I am trying to use exported file for creating duplicate lex bot. #1615

Open hapatel-jetblue opened 6 months ago

hapatel-jetblue commented 6 months ago

###################################################

AWS Connect Lex bot

################################################### resource "awscc_lex_bot" "avios_cnn_ancilliary_bot" { name = "testing-poc-bot-test" description = "Ancilliary Bot ${terraform.workspace}" data_privacy = { child_directed = false } idle_session_ttl_in_seconds = 300 role_arn = "arn:aws:iam::***:role/rolename" auto_build_bot_locales = true bot_file_s3_location = { s3_bucket = "multi-party-test" s3_object_key = "xyz.zip" } }

###################################################

AWS Connect Lex bot Aliases

################################################### resource "awscc_lex_bot_alias" "avios_cnn_lex_bot_v2_alias" { bot_alias_name = "avios-ancilliary-bot-aliase-${terraform.workspace}" bot_id = awscc_lex_bot.avios_cnn_ancilliary_bot.id description = "Ancilliary Bot Alias" bot_version = awscc_lex_bot_version.avios_ancilliary_bot_version.id bot_alias_locale_settings = [ { enabled = true locale_id = "en_US" bot_alias_locale_setting = { code_hook_specification = { lambda_code_hook = { code_hook_interface_version = "1.0" lambda_arn = "arn:aws:lambda:us-west-2:***:function:functionname" } } enabled = true } } ] depends_on = [awscc_lex_bot.avios_cnn_ancilliary_bot] }

resource "awscc_lex_bot_version" "avios_ancilliary_bot_version" { bot_id = awscc_lex_bot.avios_cnn_ancilliary_bot.id bot_version_locale_specification = [ { locale_id = "en_US" bot_version_locale_details = { source_bot_version = "2" } } ] depends_on = [awscc_lex_bot.avios_cnn_ancilliary_bot] }

Here is my code and I am trying to apply but I am getting below error.

│ Error: AWS SDK Go Service Operation Incomplete │ │ with awscc_lex_bot.avios_cnn_ancilliary_bot, │ on lexbot.tf line 19, in resource "awscc_lex_bot" "avios_cnn_ancilliary_bot": │ 19: resource "awscc_lex_bot" "avios_cnn_ancilliary_bot" { │ │ Waiting for Cloud Control API service CreateResource operation completion returned: waiter state transitioned to FAILED. StatusMessage: Error occurred during operation 'FetchBotImportFile'.. ErrorCode: │ GeneralServiceException

Any one can help?

quixoticmonk commented 6 months ago

Thank you for opening the issue, @hapatel-jetblue . Your error seems to be from the awscc_lex_bot creation itself. Can you check if the exported file has any issues?

I had a sample bot definition pulled from the lex console and exported it back without the reference bot version and alias and it did succeed.

And, I see you have .id referenced for some of the outputs which should be checked. Please check the below readonly args for these resources.