Skip to content

terraform: add new version 2025-06-01-preview #34857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview"
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview",
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"title": "ExportTerraform",
"operationId": "Terraform_ExportTerraform",
"parameters": {
"api-version": "2025-06-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"body": {
"type": "ExportResourceGroup",
"resourceGroupName": "rg1"
}
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title": "Get a list of operations for a resource provider",
"operationId": "Operations_List",
"parameters": {
"subscriptionId": "12345678-1234-1234-12345678abc",
"api-version": "2025-06-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "Microsoft.AzureTerraform/operations/read",
"display": {
"provider": "Microsoft AzureTerraform",
"resource": "Azure Terraform Resource Provider",
"operation": "ListOperations",
"description": "Lists all of the available RP operations."
}
},
{
"name": "Microsoft.AzureTerraform/exportTerraform/action",
"display": {
"provider": "Microsoft AzureTerraform",
"resource": "Azure Terraform Resource Provider",
"operation": "ExportTerraform",
"description": "Exports the Terraform configuration used for the specified scope."
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import "@azure-tools/typespec-azure-resource-manager";
import "./models.tsp";
import "./routes.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.ResourceManager.Foundations;
using Azure.Core;
using Azure.ResourceManager;
using TypeSpec.Versioning;

Expand All @@ -31,4 +27,10 @@ enum Versions {
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
v2023_07_01_preview: "2023-07-01-preview",

@doc("The 2025-06-01-preview API version.")
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
v2025_06_01_preview: "2025-06-01-preview",
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import "@typespec/rest";
import "@typespec/http";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Rest;
using TypeSpec.Http;
import "@typespec/versioning";
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using OpenAPI;
using TypeSpec.Versioning;

namespace Microsoft.AzureTerraform;

Expand Down Expand Up @@ -64,6 +62,14 @@ model BaseExportModel {

@doc("Mask sensitive attributes in the Terraform configuration")
maskSensitive?: boolean = true;

@added(Versions.v2025_06_01_preview)
@doc("Exclude resources from being exported based on the Azure resource ID pattern (case-insensitive regexp)")
excludeAzureResource?: string[];

@added(Versions.v2025_06_01_preview)
@doc("Exclude resources from being exported based on the Terraform resource type")
excludeTerraformResource?: string[];
}

@doc("Export parameter for resources queried by ARG (Azure Resource Graph)")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import "@azure-tools/typespec-azure-core";
import "@typespec/rest";
import "./models.tsp";
import "@azure-tools/typespec-azure-resource-manager";
import "@azure-tools/typespec-client-generator-core";
import "./models.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.Core;
using Azure.ClientGenerator.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using OpenAPI;

namespace Microsoft.AzureTerraform;

Expand All @@ -24,7 +18,10 @@ interface Terraform {
@useFinalStateVia("azure-async-operation")
exportTerraform is ArmProviderActionAsync<
BaseExportModel,
ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>,
ArmAcceptedLroResponse<
"Resource operation accepted.",
LroHeaders
> | TerraformOperationStatus,
Scope = SubscriptionActionScope,
LroHeaders = LroHeaders
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview"
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview",
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/TerraformOperationStatus"
}
},
"202": {
"description": "Resource operation accepted.",
"headers": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"title": "ExportTerraform",
"operationId": "Terraform_ExportTerraform",
"parameters": {
"api-version": "2025-06-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"body": {
"type": "ExportResourceGroup",
"resourceGroupName": "rg1"
}
},
"responses": {
"202": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview",
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title": "Get a list of operations for a resource provider",
"operationId": "Operations_List",
"parameters": {
"subscriptionId": "12345678-1234-1234-12345678abc",
"api-version": "2025-06-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "Microsoft.AzureTerraform/operations/read",
"display": {
"provider": "Microsoft AzureTerraform",
"resource": "Azure Terraform Resource Provider",
"operation": "ListOperations",
"description": "Lists all of the available RP operations."
}
},
{
"name": "Microsoft.AzureTerraform/exportTerraform/action",
"display": {
"provider": "Microsoft AzureTerraform",
"resource": "Azure Terraform Resource Provider",
"operation": "ExportTerraform",
"description": "Exports the Terraform configuration used for the specified scope."
}
}
]
}
}
}
}
Loading
Loading