microsoft-cdktfconstructs 0.0.3.dev12__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/LICENSE +1 -1
- microsoft_cdktfconstructs-1.0.0/PKG-INFO +258 -0
- microsoft_cdktfconstructs-1.0.0/README.md +231 -0
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/pyproject.toml +2 -2
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/setup.py +10 -26
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/__init__.py +13512 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/_jsii/__init__.py +45 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/_jsii/terraform-cdk-constructs@1.0.0.jsii.tgz +0 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/azure_resourcegroup/__init__.py +669 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/azure_storageaccount/__init__.py +1562 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/core_azure/__init__.py +11452 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs/testing/__init__.py +107 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs.egg-info/PKG-INFO +258 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs.egg-info/SOURCES.txt +18 -0
- microsoft_cdktfconstructs-1.0.0/src/microsoft_cdktfconstructs.egg-info/requires.txt +5 -0
- microsoft-cdktfconstructs-0.0.3.dev12/PKG-INFO +0 -178
- microsoft-cdktfconstructs-0.0.3.dev12/README.md +0 -155
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/__init__.py +0 -216
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/_jsii/__init__.py +0 -31
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/_jsii/terraform-cdk-constructs@0.0.3-pre.12.jsii.tgz +0 -0
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_applicationgateway/__init__.py +0 -823
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_applicationinsights/__init__.py +0 -397
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_containerregistry/__init__.py +0 -320
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_eventhub/__init__.py +0 -2218
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_functionapp/__init__.py +0 -908
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_keyvault/__init__.py +0 -1982
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_kubernetes/__init__.py +0 -400
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_kusto/__init__.py +0 -2522
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_loganalytics/__init__.py +0 -676
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_metricalert/__init__.py +0 -1260
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_networksecuritygroup/__init__.py +0 -1742
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_queryrulealert/__init__.py +0 -1189
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_resourcegroup/__init__.py +0 -320
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_storageaccount/__init__.py +0 -1931
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_virtualmachine/__init__.py +0 -1514
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_virtualmachinescaleset/__init__.py +0 -1239
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/azure_virtualnetwork/__init__.py +0 -707
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs/core_azure/__init__.py +0 -940
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs.egg-info/PKG-INFO +0 -178
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs.egg-info/SOURCES.txt +0 -32
- microsoft-cdktfconstructs-0.0.3.dev12/src/microsoft_cdktfconstructs.egg-info/requires.txt +0 -6
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/MANIFEST.in +0 -0
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/setup.cfg +0 -0
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/src/microsoft_cdktfconstructs/py.typed +0 -0
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/src/microsoft_cdktfconstructs.egg-info/dependency_links.txt +0 -0
- {microsoft-cdktfconstructs-0.0.3.dev12 → microsoft_cdktfconstructs-1.0.0}/src/microsoft_cdktfconstructs.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: microsoft-cdktfconstructs
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Azure CDK constructs using AZAPI provider for direct Azure REST API access. Version 1.0.0 - Major breaking change migration from AzureRM to AZAPI.
|
|
5
|
+
Home-page: https://github.com/azure/terraform-cdk-constructs.git
|
|
6
|
+
Author: Microsoft
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Source, https://github.com/azure/terraform-cdk-constructs.git
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: JavaScript
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
18
|
+
Classifier: License :: OSI Approved
|
|
19
|
+
Requires-Python: ~=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: cdktf==0.20.8
|
|
23
|
+
Requires-Dist: constructs<11.0.0,>=10.3.0
|
|
24
|
+
Requires-Dist: jsii<2.0.0,>=1.117.0
|
|
25
|
+
Requires-Dist: publication>=0.0.3
|
|
26
|
+
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
27
|
+
|
|
28
|
+
# Azure Terraform CDK Constructs
|
|
29
|
+
|
|
30
|
+
Welcome to the Azure Terraform CDK Constructs project! This library offers Azure L2 Constructs using the AZAPI provider for direct Azure REST API access, providing immediate access to new Azure features and API versions.
|
|
31
|
+
|
|
32
|
+
## 🚀 Version 1.0.0 - AZAPI Provider Migration
|
|
33
|
+
|
|
34
|
+
**Breaking Change Notice:** Version 1.0.0 represents a major architectural shift from AzureRM provider to AZAPI provider. This migration provides:
|
|
35
|
+
|
|
36
|
+
* **Direct Azure REST API Access**: No dependency on AzureRM provider
|
|
37
|
+
* **Immediate Feature Access**: Get new Azure features as soon as they're available in Azure APIs
|
|
38
|
+
* **Version-Specific Implementations**: Multiple API versions supported for each service
|
|
39
|
+
* **Enhanced Type Safety**: Improved IDE support and compile-time validation
|
|
40
|
+
* **Included Provider Bindings**: AZAPI provider classes are included - no need to generate bindings
|
|
41
|
+
|
|
42
|
+
## Benefits of Using AZAPI L2 Constructs
|
|
43
|
+
|
|
44
|
+
With AZAPI L2 Constructs, you get the following benefits:
|
|
45
|
+
|
|
46
|
+
* **Direct API Access**: Bypass provider limitations and access Azure REST APIs directly
|
|
47
|
+
* **Version Flexibility**: Choose specific API versions for your resources
|
|
48
|
+
* **Rapid Feature Adoption**: Access new Azure features immediately without waiting for provider updates
|
|
49
|
+
* **Enhanced Abstraction**: Higher-level abstractions over Azure resources with type safety
|
|
50
|
+
* **Reusability**: Encapsulate common patterns and best practices in your infrastructure code
|
|
51
|
+
* **Direct IDE Integration**: Access detailed documentation directly within your IDE
|
|
52
|
+
* **Zero Provider Setup**: AZAPI provider bindings included in the package
|
|
53
|
+
|
|
54
|
+
## Currently Supported Services
|
|
55
|
+
|
|
56
|
+
| Service | API Versions | Status |
|
|
57
|
+
|---------|-------------|--------|
|
|
58
|
+
| Resource Groups | 2024-11-01, 2025-01-01, 2025-03-01 | ✅ Available |
|
|
59
|
+
| Storage Accounts | 2023-01-01, 2023-05-01, 2024-01-01 | ✅ Available |
|
|
60
|
+
|
|
61
|
+
*More services will be added in future releases using the same AZAPI architecture.*
|
|
62
|
+
|
|
63
|
+
## Quick Example
|
|
64
|
+
|
|
65
|
+
Create Azure resources using AZAPI provider:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
import * as azcdk from "@microsoft/terraform-cdk-constructs";
|
|
69
|
+
import { Construct } from 'constructs';
|
|
70
|
+
import { App, TerraformStack } from 'cdktf';
|
|
71
|
+
|
|
72
|
+
class AzureAppInfra extends TerraformStack {
|
|
73
|
+
constructor(scope: Construct, name: string) {
|
|
74
|
+
super(scope, name);
|
|
75
|
+
|
|
76
|
+
// Create a new Azure Resource Group using AZAPI
|
|
77
|
+
const rg = new azcdk.azure_resourcegroup.ResourceGroup(this, "resourcegroup", {
|
|
78
|
+
name: "rg-myapp-prod",
|
|
79
|
+
location: "eastus",
|
|
80
|
+
tags: {
|
|
81
|
+
environment: "production",
|
|
82
|
+
project: "myapp"
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Create a Storage Account
|
|
87
|
+
new azcdk.azure_storageaccount.StorageAccount(this, "storage", {
|
|
88
|
+
name: "mystorageaccount",
|
|
89
|
+
location: "eastus",
|
|
90
|
+
resourceGroupId: rg.id,
|
|
91
|
+
sku: { name: "Standard_LRS" }
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const app = new App();
|
|
97
|
+
new AzureAppInfra(app, 'cdk');
|
|
98
|
+
app.synth();
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Getting Started
|
|
102
|
+
|
|
103
|
+
### Prerequisites
|
|
104
|
+
|
|
105
|
+
* Node.js and npm installed (for TypeScript/JavaScript)
|
|
106
|
+
* Azure CLI configured with appropriate permissions
|
|
107
|
+
|
|
108
|
+
### Installation
|
|
109
|
+
|
|
110
|
+
Install the CDK for Terraform CLI globally:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
npm install -g cdktf-cli
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Initialize a new CDK for Terraform project:
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
cdktf init --template="TypeScript" --local
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Install the Microsoft Terraform CDK constructs (includes AZAPI provider bindings):
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
npm install @microsoft/terraform-cdk-constructs
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
That's it! The AZAPI provider classes are included in the package, so you don't need to configure additional providers or generate bindings.
|
|
129
|
+
|
|
130
|
+
### Basic Usage Example
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
import * as azcdk from "@microsoft/terraform-cdk-constructs";
|
|
134
|
+
import { Construct } from 'constructs';
|
|
135
|
+
import { App, TerraformStack } from 'cdktf';
|
|
136
|
+
|
|
137
|
+
class MyAzureInfra extends TerraformStack {
|
|
138
|
+
constructor(scope: Construct, name: string) {
|
|
139
|
+
super(scope, name);
|
|
140
|
+
|
|
141
|
+
// Create a resource group
|
|
142
|
+
const rg = new azcdk.azure_resourcegroup.ResourceGroup(this, "main-rg", {
|
|
143
|
+
name: "rg-myproject-prod",
|
|
144
|
+
location: "eastus",
|
|
145
|
+
tags: {
|
|
146
|
+
environment: "production",
|
|
147
|
+
project: "myproject"
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Create a storage account
|
|
152
|
+
const storage = new azcdk.azure_storageaccount.StorageAccount(this, "storage", {
|
|
153
|
+
name: "mystorageaccount",
|
|
154
|
+
location: "eastus",
|
|
155
|
+
resourceGroupId: rg.id,
|
|
156
|
+
sku: { name: "Standard_LRS" },
|
|
157
|
+
tags: {
|
|
158
|
+
environment: "production",
|
|
159
|
+
project: "myproject"
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const app = new App();
|
|
166
|
+
new MyAzureInfra(app, 'azure-infra');
|
|
167
|
+
app.synth();
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Version-Specific Usage
|
|
171
|
+
|
|
172
|
+
You can use specific API versions for fine-grained control:
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
// Use latest version (recommended) - automatically resolves to newest API version
|
|
176
|
+
import { ResourceGroup } from "@microsoft/terraform-cdk-constructs/azure-resourcegroup";
|
|
177
|
+
import { StorageAccount } from "@microsoft/terraform-cdk-constructs/azure-storageaccount";
|
|
178
|
+
|
|
179
|
+
// Or specify explicit API version for version pinning
|
|
180
|
+
const rg = new ResourceGroup(this, "rg", {
|
|
181
|
+
name: "my-resource-group",
|
|
182
|
+
location: "eastus",
|
|
183
|
+
apiVersion: "2025-03-01" // Pin to specific version
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const storage = new StorageAccount(this, "storage", {
|
|
187
|
+
name: "mystorageaccount",
|
|
188
|
+
location: "eastus",
|
|
189
|
+
resourceGroupId: rg.id,
|
|
190
|
+
sku: { name: "Standard_LRS" },
|
|
191
|
+
apiVersion: "2024-01-01" // Pin to specific version
|
|
192
|
+
});
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Migration from v0.x
|
|
196
|
+
|
|
197
|
+
If you're migrating from version 0.x (AzureRM-based), please see our [Versioning and Migrations User Guide](./docs/versioning-and-migrations-user-guide.md) for detailed instructions.
|
|
198
|
+
|
|
199
|
+
## Deployment
|
|
200
|
+
|
|
201
|
+
Generate Terraform configuration:
|
|
202
|
+
|
|
203
|
+
```sh
|
|
204
|
+
cdktf synth
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Deploy your infrastructure:
|
|
208
|
+
|
|
209
|
+
```sh
|
|
210
|
+
cdktf deploy
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Supported Languages
|
|
214
|
+
|
|
215
|
+
Thanks to JSII, this library is available in multiple programming languages:
|
|
216
|
+
|
|
217
|
+
| Language | Package | Status |
|
|
218
|
+
|------------|---------|--------|
|
|
219
|
+
| TypeScript/JavaScript | [`@microsoft/terraform-cdk-constructs`](https://www.npmjs.com/package/@microsoft/terraform-cdk-constructs) | ✅ Available |
|
|
220
|
+
| Python | [`microsoft-cdktfconstructs`](https://pypi.org/project/microsoft-cdktfconstructs/) | ✅ Available |
|
|
221
|
+
| Java | [`com.microsoft.terraformcdkconstructs`](https://search.maven.org/artifact/com.microsoft.terraformcdkconstructs/cdktf-azure-constructs) | ✅ Available |
|
|
222
|
+
| C#/.NET | [`Microsoft.Cdktf.Azure.TFConstructs`](https://www.nuget.org/packages/Microsoft.Cdktf.Azure.TFConstructs) | ✅ Available |
|
|
223
|
+
|
|
224
|
+
## Contributing
|
|
225
|
+
|
|
226
|
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
227
|
+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
228
|
+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
|
|
229
|
+
|
|
230
|
+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
|
|
231
|
+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
|
|
232
|
+
provided by the bot. You will only need to do this once across all repos using our CLA.
|
|
233
|
+
|
|
234
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
235
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
|
236
|
+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
237
|
+
|
|
238
|
+
We welcome contributions to this project! See our documentation on [how to get started contributing](./CONTRIBUTING.md).
|
|
239
|
+
|
|
240
|
+
## Documentation
|
|
241
|
+
|
|
242
|
+
* [Architecture Documentation](./docs/ARCHITECTURE.md) - High-level architecture and design patterns
|
|
243
|
+
* [Versioning and Migrations User Guide](./docs/versioning-and-migrations-user-guide.md) - API version management and migration guidance
|
|
244
|
+
* [Testing Guide](./docs/testing.md) - Testing practices and utilities
|
|
245
|
+
* [Design Guide](./docs/design_guide.md) - Module design guidelines
|
|
246
|
+
* [API Documentation](./API.md) - Complete API reference
|
|
247
|
+
|
|
248
|
+
## Code Spaces
|
|
249
|
+
|
|
250
|
+
[](https://github.com/Azure/terraform-cdk-constructs/codespaces)
|
|
251
|
+
|
|
252
|
+
## Trademarks
|
|
253
|
+
|
|
254
|
+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
|
|
255
|
+
trademarks or logos is subject to and must follow
|
|
256
|
+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
257
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
258
|
+
Any use of third-party trademarks or logos are subject to those third-party's policies.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Azure Terraform CDK Constructs
|
|
2
|
+
|
|
3
|
+
Welcome to the Azure Terraform CDK Constructs project! This library offers Azure L2 Constructs using the AZAPI provider for direct Azure REST API access, providing immediate access to new Azure features and API versions.
|
|
4
|
+
|
|
5
|
+
## 🚀 Version 1.0.0 - AZAPI Provider Migration
|
|
6
|
+
|
|
7
|
+
**Breaking Change Notice:** Version 1.0.0 represents a major architectural shift from AzureRM provider to AZAPI provider. This migration provides:
|
|
8
|
+
|
|
9
|
+
* **Direct Azure REST API Access**: No dependency on AzureRM provider
|
|
10
|
+
* **Immediate Feature Access**: Get new Azure features as soon as they're available in Azure APIs
|
|
11
|
+
* **Version-Specific Implementations**: Multiple API versions supported for each service
|
|
12
|
+
* **Enhanced Type Safety**: Improved IDE support and compile-time validation
|
|
13
|
+
* **Included Provider Bindings**: AZAPI provider classes are included - no need to generate bindings
|
|
14
|
+
|
|
15
|
+
## Benefits of Using AZAPI L2 Constructs
|
|
16
|
+
|
|
17
|
+
With AZAPI L2 Constructs, you get the following benefits:
|
|
18
|
+
|
|
19
|
+
* **Direct API Access**: Bypass provider limitations and access Azure REST APIs directly
|
|
20
|
+
* **Version Flexibility**: Choose specific API versions for your resources
|
|
21
|
+
* **Rapid Feature Adoption**: Access new Azure features immediately without waiting for provider updates
|
|
22
|
+
* **Enhanced Abstraction**: Higher-level abstractions over Azure resources with type safety
|
|
23
|
+
* **Reusability**: Encapsulate common patterns and best practices in your infrastructure code
|
|
24
|
+
* **Direct IDE Integration**: Access detailed documentation directly within your IDE
|
|
25
|
+
* **Zero Provider Setup**: AZAPI provider bindings included in the package
|
|
26
|
+
|
|
27
|
+
## Currently Supported Services
|
|
28
|
+
|
|
29
|
+
| Service | API Versions | Status |
|
|
30
|
+
|---------|-------------|--------|
|
|
31
|
+
| Resource Groups | 2024-11-01, 2025-01-01, 2025-03-01 | ✅ Available |
|
|
32
|
+
| Storage Accounts | 2023-01-01, 2023-05-01, 2024-01-01 | ✅ Available |
|
|
33
|
+
|
|
34
|
+
*More services will be added in future releases using the same AZAPI architecture.*
|
|
35
|
+
|
|
36
|
+
## Quick Example
|
|
37
|
+
|
|
38
|
+
Create Azure resources using AZAPI provider:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import * as azcdk from "@microsoft/terraform-cdk-constructs";
|
|
42
|
+
import { Construct } from 'constructs';
|
|
43
|
+
import { App, TerraformStack } from 'cdktf';
|
|
44
|
+
|
|
45
|
+
class AzureAppInfra extends TerraformStack {
|
|
46
|
+
constructor(scope: Construct, name: string) {
|
|
47
|
+
super(scope, name);
|
|
48
|
+
|
|
49
|
+
// Create a new Azure Resource Group using AZAPI
|
|
50
|
+
const rg = new azcdk.azure_resourcegroup.ResourceGroup(this, "resourcegroup", {
|
|
51
|
+
name: "rg-myapp-prod",
|
|
52
|
+
location: "eastus",
|
|
53
|
+
tags: {
|
|
54
|
+
environment: "production",
|
|
55
|
+
project: "myapp"
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Create a Storage Account
|
|
60
|
+
new azcdk.azure_storageaccount.StorageAccount(this, "storage", {
|
|
61
|
+
name: "mystorageaccount",
|
|
62
|
+
location: "eastus",
|
|
63
|
+
resourceGroupId: rg.id,
|
|
64
|
+
sku: { name: "Standard_LRS" }
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const app = new App();
|
|
70
|
+
new AzureAppInfra(app, 'cdk');
|
|
71
|
+
app.synth();
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Getting Started
|
|
75
|
+
|
|
76
|
+
### Prerequisites
|
|
77
|
+
|
|
78
|
+
* Node.js and npm installed (for TypeScript/JavaScript)
|
|
79
|
+
* Azure CLI configured with appropriate permissions
|
|
80
|
+
|
|
81
|
+
### Installation
|
|
82
|
+
|
|
83
|
+
Install the CDK for Terraform CLI globally:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
npm install -g cdktf-cli
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Initialize a new CDK for Terraform project:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
cdktf init --template="TypeScript" --local
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Install the Microsoft Terraform CDK constructs (includes AZAPI provider bindings):
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
npm install @microsoft/terraform-cdk-constructs
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
That's it! The AZAPI provider classes are included in the package, so you don't need to configure additional providers or generate bindings.
|
|
102
|
+
|
|
103
|
+
### Basic Usage Example
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import * as azcdk from "@microsoft/terraform-cdk-constructs";
|
|
107
|
+
import { Construct } from 'constructs';
|
|
108
|
+
import { App, TerraformStack } from 'cdktf';
|
|
109
|
+
|
|
110
|
+
class MyAzureInfra extends TerraformStack {
|
|
111
|
+
constructor(scope: Construct, name: string) {
|
|
112
|
+
super(scope, name);
|
|
113
|
+
|
|
114
|
+
// Create a resource group
|
|
115
|
+
const rg = new azcdk.azure_resourcegroup.ResourceGroup(this, "main-rg", {
|
|
116
|
+
name: "rg-myproject-prod",
|
|
117
|
+
location: "eastus",
|
|
118
|
+
tags: {
|
|
119
|
+
environment: "production",
|
|
120
|
+
project: "myproject"
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Create a storage account
|
|
125
|
+
const storage = new azcdk.azure_storageaccount.StorageAccount(this, "storage", {
|
|
126
|
+
name: "mystorageaccount",
|
|
127
|
+
location: "eastus",
|
|
128
|
+
resourceGroupId: rg.id,
|
|
129
|
+
sku: { name: "Standard_LRS" },
|
|
130
|
+
tags: {
|
|
131
|
+
environment: "production",
|
|
132
|
+
project: "myproject"
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const app = new App();
|
|
139
|
+
new MyAzureInfra(app, 'azure-infra');
|
|
140
|
+
app.synth();
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Version-Specific Usage
|
|
144
|
+
|
|
145
|
+
You can use specific API versions for fine-grained control:
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
// Use latest version (recommended) - automatically resolves to newest API version
|
|
149
|
+
import { ResourceGroup } from "@microsoft/terraform-cdk-constructs/azure-resourcegroup";
|
|
150
|
+
import { StorageAccount } from "@microsoft/terraform-cdk-constructs/azure-storageaccount";
|
|
151
|
+
|
|
152
|
+
// Or specify explicit API version for version pinning
|
|
153
|
+
const rg = new ResourceGroup(this, "rg", {
|
|
154
|
+
name: "my-resource-group",
|
|
155
|
+
location: "eastus",
|
|
156
|
+
apiVersion: "2025-03-01" // Pin to specific version
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const storage = new StorageAccount(this, "storage", {
|
|
160
|
+
name: "mystorageaccount",
|
|
161
|
+
location: "eastus",
|
|
162
|
+
resourceGroupId: rg.id,
|
|
163
|
+
sku: { name: "Standard_LRS" },
|
|
164
|
+
apiVersion: "2024-01-01" // Pin to specific version
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Migration from v0.x
|
|
169
|
+
|
|
170
|
+
If you're migrating from version 0.x (AzureRM-based), please see our [Versioning and Migrations User Guide](./docs/versioning-and-migrations-user-guide.md) for detailed instructions.
|
|
171
|
+
|
|
172
|
+
## Deployment
|
|
173
|
+
|
|
174
|
+
Generate Terraform configuration:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
cdktf synth
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Deploy your infrastructure:
|
|
181
|
+
|
|
182
|
+
```sh
|
|
183
|
+
cdktf deploy
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Supported Languages
|
|
187
|
+
|
|
188
|
+
Thanks to JSII, this library is available in multiple programming languages:
|
|
189
|
+
|
|
190
|
+
| Language | Package | Status |
|
|
191
|
+
|------------|---------|--------|
|
|
192
|
+
| TypeScript/JavaScript | [`@microsoft/terraform-cdk-constructs`](https://www.npmjs.com/package/@microsoft/terraform-cdk-constructs) | ✅ Available |
|
|
193
|
+
| Python | [`microsoft-cdktfconstructs`](https://pypi.org/project/microsoft-cdktfconstructs/) | ✅ Available |
|
|
194
|
+
| Java | [`com.microsoft.terraformcdkconstructs`](https://search.maven.org/artifact/com.microsoft.terraformcdkconstructs/cdktf-azure-constructs) | ✅ Available |
|
|
195
|
+
| C#/.NET | [`Microsoft.Cdktf.Azure.TFConstructs`](https://www.nuget.org/packages/Microsoft.Cdktf.Azure.TFConstructs) | ✅ Available |
|
|
196
|
+
|
|
197
|
+
## Contributing
|
|
198
|
+
|
|
199
|
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
200
|
+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
201
|
+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
|
|
202
|
+
|
|
203
|
+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
|
|
204
|
+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
|
|
205
|
+
provided by the bot. You will only need to do this once across all repos using our CLA.
|
|
206
|
+
|
|
207
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
208
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
|
209
|
+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
210
|
+
|
|
211
|
+
We welcome contributions to this project! See our documentation on [how to get started contributing](./CONTRIBUTING.md).
|
|
212
|
+
|
|
213
|
+
## Documentation
|
|
214
|
+
|
|
215
|
+
* [Architecture Documentation](./docs/ARCHITECTURE.md) - High-level architecture and design patterns
|
|
216
|
+
* [Versioning and Migrations User Guide](./docs/versioning-and-migrations-user-guide.md) - API version management and migration guidance
|
|
217
|
+
* [Testing Guide](./docs/testing.md) - Testing practices and utilities
|
|
218
|
+
* [Design Guide](./docs/design_guide.md) - Module design guidelines
|
|
219
|
+
* [API Documentation](./API.md) - Complete API reference
|
|
220
|
+
|
|
221
|
+
## Code Spaces
|
|
222
|
+
|
|
223
|
+
[](https://github.com/Azure/terraform-cdk-constructs/codespaces)
|
|
224
|
+
|
|
225
|
+
## Trademarks
|
|
226
|
+
|
|
227
|
+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
|
|
228
|
+
trademarks or logos is subject to and must follow
|
|
229
|
+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
230
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
231
|
+
Any use of third-party trademarks or logos are subject to those third-party's policies.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools~=
|
|
2
|
+
requires = ["setuptools~=75.3.2", "build~=1.3.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[tool.pyright]
|
|
6
6
|
defineConstant = { DEBUG = true }
|
|
7
|
-
pythonVersion = "3.
|
|
7
|
+
pythonVersion = "3.9"
|
|
8
8
|
pythonPlatform = "All"
|
|
9
9
|
reportSelfClsParameterName = false
|
|
@@ -5,8 +5,8 @@ kwargs = json.loads(
|
|
|
5
5
|
"""
|
|
6
6
|
{
|
|
7
7
|
"name": "microsoft-cdktfconstructs",
|
|
8
|
-
"version": "0.0
|
|
9
|
-
"description": "
|
|
8
|
+
"version": "1.0.0",
|
|
9
|
+
"description": "Azure CDK constructs using AZAPI provider for direct Azure REST API access. Version 1.0.0 - Major breaking change migration from AzureRM to AZAPI.",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"url": "https://github.com/azure/terraform-cdk-constructs.git",
|
|
12
12
|
"long_description_content_type": "text/markdown",
|
|
@@ -23,48 +23,32 @@ kwargs = json.loads(
|
|
|
23
23
|
"packages": [
|
|
24
24
|
"microsoft_cdktfconstructs",
|
|
25
25
|
"microsoft_cdktfconstructs._jsii",
|
|
26
|
-
"microsoft_cdktfconstructs.azure_applicationgateway",
|
|
27
|
-
"microsoft_cdktfconstructs.azure_applicationinsights",
|
|
28
|
-
"microsoft_cdktfconstructs.azure_containerregistry",
|
|
29
|
-
"microsoft_cdktfconstructs.azure_eventhub",
|
|
30
|
-
"microsoft_cdktfconstructs.azure_functionapp",
|
|
31
|
-
"microsoft_cdktfconstructs.azure_keyvault",
|
|
32
|
-
"microsoft_cdktfconstructs.azure_kubernetes",
|
|
33
|
-
"microsoft_cdktfconstructs.azure_kusto",
|
|
34
|
-
"microsoft_cdktfconstructs.azure_loganalytics",
|
|
35
|
-
"microsoft_cdktfconstructs.azure_metricalert",
|
|
36
|
-
"microsoft_cdktfconstructs.azure_networksecuritygroup",
|
|
37
|
-
"microsoft_cdktfconstructs.azure_queryrulealert",
|
|
38
26
|
"microsoft_cdktfconstructs.azure_resourcegroup",
|
|
39
27
|
"microsoft_cdktfconstructs.azure_storageaccount",
|
|
40
|
-
"microsoft_cdktfconstructs.
|
|
41
|
-
"microsoft_cdktfconstructs.
|
|
42
|
-
"microsoft_cdktfconstructs.azure_virtualnetwork",
|
|
43
|
-
"microsoft_cdktfconstructs.core_azure"
|
|
28
|
+
"microsoft_cdktfconstructs.core_azure",
|
|
29
|
+
"microsoft_cdktfconstructs.testing"
|
|
44
30
|
],
|
|
45
31
|
"package_data": {
|
|
46
32
|
"microsoft_cdktfconstructs._jsii": [
|
|
47
|
-
"terraform-cdk-constructs@0.0.
|
|
33
|
+
"terraform-cdk-constructs@1.0.0.jsii.tgz"
|
|
48
34
|
],
|
|
49
35
|
"microsoft_cdktfconstructs": [
|
|
50
36
|
"py.typed"
|
|
51
37
|
]
|
|
52
38
|
},
|
|
53
|
-
"python_requires": "~=3.
|
|
39
|
+
"python_requires": "~=3.9",
|
|
54
40
|
"install_requires": [
|
|
55
|
-
"cdktf
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"jsii>=1.98.0, <2.0.0",
|
|
41
|
+
"cdktf==0.20.8",
|
|
42
|
+
"constructs>=10.3.0, <11.0.0",
|
|
43
|
+
"jsii>=1.117.0, <2.0.0",
|
|
59
44
|
"publication>=0.0.3",
|
|
60
|
-
"typeguard
|
|
45
|
+
"typeguard>=2.13.3,<4.3.0"
|
|
61
46
|
],
|
|
62
47
|
"classifiers": [
|
|
63
48
|
"Intended Audience :: Developers",
|
|
64
49
|
"Operating System :: OS Independent",
|
|
65
50
|
"Programming Language :: JavaScript",
|
|
66
51
|
"Programming Language :: Python :: 3 :: Only",
|
|
67
|
-
"Programming Language :: Python :: 3.8",
|
|
68
52
|
"Programming Language :: Python :: 3.9",
|
|
69
53
|
"Programming Language :: Python :: 3.10",
|
|
70
54
|
"Programming Language :: Python :: 3.11",
|