Writing CDK like a Pro using Amazon Q Customizations

Writing CDK like a Pro using Amazon Q Customizations

Dive into the latest Amazon Q Developer Customizations feature, using the aws-cdk GitHub repository as the source of customization and write RedshiftServerless L2 constructs in just minutes.

Pahud Hsieh
Amazon Employee
Published Jul 31, 2024
Last Modified Aug 8, 2024
Ever wondered if you can master CDK like a pro by studying the official AWS CDK GitHub repository? In this video, I'll dive into the latest Amazon Q Developer Customizations feature, using the aws/aws-cdk GitHub repository as the source of customization. Join me as I explore how this resource can streamline the process of writing RedshiftServerless L2 constructs in just minutes.
Check it out. Make sure to select 4K 2160p for the best video quality.
0:00 opening
0:27 video from Ricardo Ferreira
1:31 exploring the Amazon Q Developer console
2:35 clone the aws/aws-cdk repo
2:48 remove the .git and snapshots
4:09 upload using aws s3 sync
4:39 copy S3 URI as the customization source
4:51 create customization
5:24 activate the customization
5:50 add user from AWS IAM Identity Center
6:18 open the VSCode IDE
6:28 select the customization
7:28 the first attempt to create the L2 with Amazon Q
8:10 the 2nd attempt using a descriptive way
11:31 the first attempt to deploy it
12:01 generate the namespace L2 with Amazon Q
14:10 the 2nd attempt to deploy it
14:41 verify it from the redshift console
15:00 asking Amazon Q to generate SQL statements
15:16 execute the SQL statements generated by Amazon Q
16:05 wrapping up


Lesson Learned:

  • Instead of relying on aws/aws-cdk for customizations, it would be more effective to create your own assets that define the characteristics of a Level 2 (L2) construct, incorporating design guidelines and best practices.
  • To streamline the repository, consider removing all shell scripts (*.sh) and retaining only the TypeScript files, as they are the essential components.
  • The model may not have comprehensive knowledge about L2 constructs. Therefore, it is crucial to provide detailed explanations and guidance. This process may require multiple iterations to determine the most effective approach.
  • Prepare a dummy sample for Amazon Q to illustrate the desired outcome. For instance, if you have an AWS::Service::Foo resource, demonstrate how a L2 construct should be generated for it.
  • When utilizing the customization, ensure that your prompts are descriptive and provide sufficient context. Avoid vague requests like "Hey, generate a L2 for me!" and instead, provide detailed instructions.
  • Overall, the current state of the model is satisfactory. I plan to continue exploring and optimizing it further.


ICYMI - Customization in Chat(Preview)


References:

Recommended Videos:

 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments