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 ONE Azure Communities:-
NAME OF THE AZURE COMMUNITY |
TYPE OF SPEAKER SESSION |
Global Azure - 2024 |
Virtual |
EVENT ANNOUNCEMENTS:- |
|
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 #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