JSON, YAML, and HCL code explainability and optimization using Amazon Q Developer
Amazon Q Developer offers a simple interface for achieving code explainability and optimization and supports AWS CloudFormation scripts with JSON and YAML templates and Terraform HCL. For more details on explainability and optimization, please refer to Chapter 12.
To illustrate, I am going to use the code that was auto-generated during the AWS CloudFormation JSON creation task. As shown in the following screenshot, highlight the code, right-click to open the pop-up menu, select Amazon Q, and choose Explain for code explainability or Optimize for optimization recommendations.
Figure 9.8 – JSON, YAML, and HCL – Amazon Q explainability and optimization
This will pop up Amazon Q Developer’s chat-style interface and move the full code for analysis.
For explainability, Amazon Q Developer recognizes two distinct templates and segregates each block accordingly...