Greetings my fellow Technology Advocates and Specialists.
This is Chapter #2 of my Terraform CDK (Cloud Development Kit) Series.
In this Session, I will demonstrate How to Setup and Configure Terraform CDK (Cloud Development Kit) to define Infrastructure.
I had the Privilege to talk on this topic in TWO Azure Communities:-
| NAME OF THE AZURE COMMUNITY | TYPE OF SPEAKER SESSION |
|---|---|
| Microsoft Azure Zurich User Group (Global Azure - 2024) | Virtual |
| .NET Zurich User Group | In-Person |
| EVENT ANNOUNCEMENTS:- |
|---|
![]() |
| VIRTUAL SESSION:- |
| LIVE DEMO was Recorded as part of my Presentation in Microsoft Azure Zurich User Group (Global Azure - 2024) Forum/Platform |
| Duration of My Demo = 32 Mins 55 Secs |
| EVENT ANNOUNCEMENTS:- |
![]() |
| IN-PERSON SESSION:- |
| LIVE DEMO was Recorded as part of my Presentation in .NET Zurich User Group Forum/Platform |
| Start Time of My Demo = 01 Hour 08 Mins 03 Secs |
| Duration of My Demo = 47 Mins 51 Secs |
| CODE REPOSITORY:- |
|---|
arindam0310018
/
17-April-2024-DevOps__CDK-For-Terraform
Terraform CDK Series with Azure
Terraform CDK Series with Azure:-
Greetings to my fellow Technology Advocates and Specialists.
In this Session, I talk and run Demo on TERRAFORM CDK SERIES in below TECH COMMUNITIES:-
| NAME OF THE TECH COMMUNITIES:- |
|---|
| Global Azure - 2024 |
| DATE | TOPICS | CONTENT |
|---|---|---|
| 17.04.2024 | CDK for Terraform - Quickstart | https://dev.to/arindam0310018/cdk-for-terraform-quickstart-1h3e |
| 17.04.2024 | CDK for Terraform - Setup & Configure | https://dev.to/arindam0310018/cdk-for-terraform-setup-configure-f42 |
| 05.05.2024 | CDK For Terraform: MS Hosted Windows Build Agent | https://dev.to/arindam0310018/cdk-for-terraform-ms-hosted-windows-build-agent-3mon |
| 05.05.2024 | CDK For Terraform: MS Hosted Linux Build Agent | https://dev.to/arindam0310018/cdk-for-terraform-ms-hosted-linux-build-agent-1egi |
| POINTS TO NOTE:- |
|---|
| 1. Cloud Provider is Microsoft Azure. |
| 1. Language used here is TYPESCRIPT. |
| 2. Browse to each folder under "03-Code-Source" (for example - Resource-Group) and look for "main.ts" for the TypeScript Code. |
| PRE-REQUISITES:- |
|---|
| 1. Install Terraform. |
![]() |
| If Required, Upgrade Terraform Version with Chocolatey Package Manager. |
![]() |
| 2. Install Node and Yarn |
![]() |
| 3. Install CDKTF |
![]() |
| Verify CDKTF Installation |
![]() |
![]() |
| LOCAL DIRECTORY STRUCTURE FOR CODE:- |
|---|
![]() |
| INITIALIZE CDK FOR TERRAFORM LOCALLY:- |
|---|
![]() |
![]() |
| FILES AND FOLDERS CREATED AFTER CDK FOR TERRAFORM IS INITIALIZED:- |
|---|
![]() |
| OUTPUT OF CDKTF SYNTH:- |
|---|
![]() |
| OUTPUT OF CDKTF DEPLOY:- |
|---|
![]() |
| OUTPUT FROM AZURE PORTAL:- |
|---|
![]() |
| BELOW FOLLOWS ALL THE TROUBLESHOOTING STEPS:- |
|---|
| ERROR #1:- |
|---|
![]() |
| RESOLUTION:- |
| The Correct Command is - cdktf init --template=typescript --local |
| ERROR #2:- |
|---|
![]() |
| RESOLUTION:- |
| In the Sytem from where you are executing terraform CDK commands, browse to "C:\Program Files\nodejs" |
| Edit the below files, mentioned in the screenshot as per the link - https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc |
![]() |
| ERROR #3:- |
|---|
![]() |
| RESOLUTION:- |
| Follow the Resolution provided in the link - https://flaviocopes.com/typescript-disable-declared-never-read/ |
![]() |
| ERROR #4:- |
|---|
![]() |
| RESOLUTION:- |
| Close Parenthesis was missing in the code snippet. |
| ERROR #5:- |
|---|
![]() |
| RESOLUTION:- |
| Below Code block was missing. |
new AzurermProvider(this, "AzureRm", {
features: {},
});
| ERROR #6:- |
|---|
![]() |
| RESOLUTION:- |
| The Refresh token has expired due to inactivity. We need to execute "az login" command. |
![]() |
Hope You Enjoyed the Session!!!
Stay Safe | Keep Learning | Spread Knowledge
























Top comments (0)