Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for CDK for Terraform - Setup & Configure
Arindam Mitra
Arindam Mitra

Posted on • Edited on

     

CDK for Terraform - Setup & Configure

Greetings my fellow Technology Advocates and Specialists.

This isChapter #2 of my Terraform CDK (Cloud Development Kit) Series.

In this Session, I will demonstrateHow to Setup and Configure Terraform CDK (Cloud Development Kit) to define Infrastructure.

I had the Privilege to talk on this topic inTWO Azure Communities:-

NAME OF THE AZURE COMMUNITYTYPE OF SPEAKER SESSION
Microsoft Azure Zurich User Group (Global Azure - 2024)Virtual
.NET Zurich User GroupIn-Person
EVENT ANNOUNCEMENTS:-
Image description
VIRTUAL SESSION:-
LIVE DEMO was Recorded as part of my Presentation inMicrosoft Azure Zurich User Group (Global Azure - 2024) Forum/Platform
Duration of My Demo =32 Mins 55 Secs
EVENT ANNOUNCEMENTS:-
Image description
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:-



POINTS TO NOTE:-
1. Cloud Provider isMicrosoft Azure.
1. Language used here isTYPESCRIPT.
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.
1
If Required, Upgrade Terraform Version with Chocolatey Package Manager.
2
2. Install Node and Yarn
3
3. Install CDKTF
4
Verify CDKTF Installation
5
6
LOCAL DIRECTORY STRUCTURE FOR CODE:-
7
INITIALIZE CDK FOR TERRAFORM LOCALLY:-
8
9
FILES AND FOLDERS CREATED AFTER CDK FOR TERRAFORM IS INITIALIZED:-
10
OUTPUT OF CDKTF SYNTH:-
All-Issue-Resolved-CDKTF-SYNTH
OUTPUT OF CDKTF DEPLOY:-
CDKTF-Deploy
OUTPUT FROM AZURE PORTAL:-
Image description
BELOW FOLLOWS ALL THE TROUBLESHOOTING STEPS:-
ERROR #1:-
Err-1
RESOLUTION:-
The Correct Command is - cdktf init --template=typescript --local
ERROR #2:-
Err-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
image
ERROR #3:-
Err-3
RESOLUTION:-
Follow the Resolution provided in the link -https://flaviocopes.com/typescript-disable-declared-never-read/
tsconfig-json
ERROR #4:-
Err-4
RESOLUTION:-
Close Parenthesis was missing in the code snippet.
ERROR #5:-
Err-5
RESOLUTION:-
Below Code block was missing.
new AzurermProvider(this, "AzureRm", {      features: {},    });
Enter fullscreen modeExit fullscreen mode
ERROR #6:-
Err-cdktf-deploy-1
RESOLUTION:-
The Refresh token has expired due to inactivity. We need to execute "az login" command.
az-login

Hope You Enjoyed the Session!!!

Stay Safe | Keep Learning | Spread Knowledge

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

2 x Microsoft MVP - IaC & Devops | 2 x Sessionize Active Speaker | Blogger ✍️ | Public Speaker 🔊 | Long Distance Runner🏃‍♂️ | Hiking 🥾 | Traveler 🧳 | Citizen of the 🌎
  • Location
    Ennetbaden, Switzerland
  • Education
    Bachelor in Computer Science Engineering (CSE)
  • Joined

More fromArindam Mitra

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp