![]() |
VOOZH | about |
dotnet add package Microsoft.Cdktf.Azure.TFConstructs --version 0.0.3-pre.11
NuGet\Install-Package Microsoft.Cdktf.Azure.TFConstructs -Version 0.0.3-pre.11
<PackageReference Include="Microsoft.Cdktf.Azure.TFConstructs" Version="0.0.3-pre.11" />
<PackageVersion Include="Microsoft.Cdktf.Azure.TFConstructs" Version="0.0.3-pre.11" />Directory.Packages.props
<PackageReference Include="Microsoft.Cdktf.Azure.TFConstructs" />Project file
paket add Microsoft.Cdktf.Azure.TFConstructs --version 0.0.3-pre.11
#r "nuget: Microsoft.Cdktf.Azure.TFConstructs, 0.0.3-pre.11"
#:package Microsoft.Cdktf.Azure.TFConstructs@0.0.3-pre.11
#addin nuget:?package=Microsoft.Cdktf.Azure.TFConstructs&version=0.0.3-pre.11&prereleaseInstall as a Cake Addin
#tool nuget:?package=Microsoft.Cdktf.Azure.TFConstructs&version=0.0.3-pre.11&prereleaseInstall as a Cake Tool
Welcome to the Azure Terraform CDK Constructs project! This library offers a comprehensive suite of L2 Constructs designed to simplify and enhance the experience of building and managing Azure infrastructure with the Cloud Development Kit for Terraform (CDKTF).
With L2 Constructs, you get the following benefits:
This is a quick example that showcases the simplicity and power of L2 Constructs. We'll create a storage account, add a container to it, and then upload a blob—all with a few lines of intuitive, object-oriented code:
// Create a new instance of a storage account as an object
const sa = new azcdk.azure_storageaccount.Account(stack, "storageaccount", {
name: "testStorageAccount",
location: "eastus",
});
// Add a container to the storage account by calling a method on the storage account object
const container = sa.addContainer("testcontainer");
// Add a blob to the container by calling a method on the container object
// The path "../../../test.txt" points to the source file to be uploaded as a blob
container.addBlob("testblob.txt", "../../../test.txt");
This guide will walk you through the process of using the Azure L2 Constructs to define and provision infrastructure on Azure.
Make sure you have Node.js and npm installed on your machine. These will be used to install the CDK for Terraform and Azure provider packages.
First, install the CDK for Terraform CLI globally using npm:
npm install -g cdktf-cli
Next, initialize a new CDK for Terraform project with TypeScript template:
cdktf init --template="TypeScript" --local
Install the AzureRM provider for CDKTF:
npm install @cdktf/provider-azurerm
Then, add the Microsoft Terraform CDK constructs for Azure:
npm install @micrsoft/terraform-cdk-constructs
Now let's create a simple Azure storage account. The following TypeScript snippet defines a storage account resource using the CDKTF:
// Import necessary modules and classes
import * as azcdk from "@microsoft/terraform-cdk-constructs";
import { Construct } from 'constructs';
import { App, TerraformStack } from 'cdktf';
import { AzurermProvider } from "@cdktf/provider-azurerm/lib/provider";
// Define a new Terraform stack
class AzureAppInfra extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
// Initialize Azure provider
new AzurermProvider(this, "azureFeature", { features: {} });
// Create a new Azure storage account with the specified name and location
new azcdk.azure_storageaccount.Account(this, "storageaccount", {
name: "test42348808",
location: "eastus",
});
}
}
// Initialize the CDK app and synthesize Terraform configurations
const app = new App();
new AzureAppInfra(app, 'cdk');
app.synth();
After defining your infrastructure, generate the Terraform configuration files:
cdktf synth
Finally, deploy your infrastructure to Azure:
cdktf deploy
Currently, our CDK L2 constructs are available in the following languages:
| Language | Status |
|---|---|
| TypeScript | Available |
| Python | Coming soon |
| Java | Coming soon |
| Go | Coming soon |
| C# | Coming soon |
Stay tuned for updates as we work to expand support to other popular programming languages!
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
We welcome contributions to this project! See our documentation on .
To open this repository in a Code Space, click the button below:
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.3-pre.11 | 200 | 6/12/2024 |