Resources are the most crucial element when defining infrastructure in CDKTF applications. Each resource describes infrastructure objects, such as virtual networks, compute instances, or higher-level components such as DNS records.
Resource definitions and properties vary depending on the resource type and the provider. Therefore, you need to consult the provider’s documentation for a complete list of available resources and configuration options.
We need to start coding our resources in the main.ts file, generated by the ‘cdktf init’ command.
First, we need to import and define the Providers in the beginning block of main.ts, just after the super command.
And the final main.ts should be something like below, depending on the resources you need to create.