- Newest
- Most votes
- Most comments
The issue you're facing is likely due to a limitation in AWS CloudFormation when defining NextStep or CaptureNextStep properties for an Amazon Lex V2 bot. Currently, CloudFormation does not support directly referencing the target step or intent within the same template.
To work around this limitation, you can create a separate CloudFormation resource for the target step or intent, and then reference its ARN (Amazon Resource Name) in the NextStep or CaptureNextStep property.
Here's an example of how you could define the NextStep in your CloudFormation template:
- Create a separate resource for the target intent:
MyTargetIntent: Type: AWS::LexV2Bot::Intent Properties: BotId: !Ref MyLexBot IntentName: MyTargetIntent # Define your target intent properties here
- In your MainMenuIntent, reference the ARN of the MyTargetIntent resource in the NextStep:
MainMenuIntent: Type: AWS::LexV2Bot::Intent Properties: BotId: !Ref MyLexBot IntentName: MainMenuIntent Description: Provides the caller an option to give another input InitialResponseSetting: InitialResponse: MessageGroupsList: - Message: PlainTextMessage: Value: Sure, Please tell us the reason for your call. NextStep: DialogAction: Type: Intent IntentQualifier: !GetAtt MyTargetIntent.IntentSignature
Replace MyTargetIntent with the appropriate resource name for your target intent, and MyLexBot with the resource name of your Lex bot.
Note that this approach may require some restructuring of your CloudFormation template, but it should resolve the issue you're facing with the NextStep definition.
Relevant content
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 4 years ago

Unfortunately, CloudFormation does not recognize AWS::LexV2Bot::Intent, I receive the following:
Error: updating CloudFormation Stack (arn:aws:cloudformation:us-east-1:783234655443:stack/FooV2Stack/fc535d10-49fd-11ef-8b3c-12711791d549): operation error CloudFormation: UpdateStack, https response error StatusCode: 400, RequestID: c7ade239-ed88-4338-a52e-261df820f7bd, api error ValidationError: Template format error: Unrecognized resource types: [AWS::LexV2Bot::Intent] │