Monday, June 5, 2023

AWS CodeWhisperer - CDK Development

 

Setup AWS CodeWhisperer

Using Visual Studio Code for Typescript

Install AWS Toolkit



Select a connection and Enter login and password









Proceed to create AWS builder id, receive validation




code and successfully connect with code whisperer service.


Using AWS Cloud9



Create CDK Project – Typescript Language

Create a folder aws-cdk-demo and cd into it.

cdk init sample-app --language typescript



Create CloudFormation Stacks

Create SQS Stack

/* Create a sqs queue and add a subscription to a topic */



Create S3 Bucket Stack

/* create an s3 bucket and add resource policy to it */



Keep hitting enter and each import is place appropriately by the code whisperer



After writing one export class statement, below is what is put in by code whisperer



 

References

·        https://aws.amazon.com/codewhisperer/

·        https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/codewhisperer.html