Skip to content

Commit

Permalink
Terraform: Update models to include ARG table selection feature and i…
Browse files Browse the repository at this point in the history
…mport block export feature (Azure#31546)

* Terraform: Update models to include ARG table selection feature and import block export feature
  • Loading branch information
magodo authored Jan 15, 2025
1 parent f7e9063 commit 3feb9e3
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,13 @@
"azapi"
]
},
{
"filename": "**/specification/terraform/Microsoft.AzureTerraform.Management/**/*.tsp",
"words": [
"azurerm",
"azapi"
]
},
{
"filename": "**/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/**/*.json",
"words": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ union targetProvider {
azapi: "azapi",
}

@doc("The Azure Resource Graph Authorization Scope Filter parameter")
union authorizationScopeFilter {
string,

@doc("Returns assignments for the given scope and all child scopes.")
AtScopeAndBelow: "AtScopeAndBelow",

@doc("Returns assignments for the given scope and all parent scopes, but not child scopes.")
AtScopeAndAbove: "AtScopeAndAbove",

@doc("Returns assignments for the given scope, all parent scopes, and all child scopes.")
AtScopeAboveAndBelow: "AtScopeAboveAndBelow",

@doc("Returns assignments only for the given scope; no parent or child scopes are included.")
AtScopeExact: "AtScopeExact",
}

@doc("The base export parameter")
@discriminator("type")
model BaseExportModel {
Expand Down Expand Up @@ -62,6 +79,12 @@ model ExportQuery extends BaseExportModel {

@doc("The parameter type")
type: "ExportQuery";

@doc("The ARG table name")
table?: string = "Resources";

@doc("The ARG Scope Filter parameter")
authorizationScopeFilter?: authorizationScopeFilter;
}

@doc("Export parameter for individual resources.")
Expand Down Expand Up @@ -102,6 +125,9 @@ model ExportResult {
@doc("The Terraform configuration content")
configuration?: string;

@doc("The Terraform import blocks for the current export, which users can use to run \"terraform plan\" with to import the resources")
`import`?: string;

@doc("A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform")
skippedResources?: armResourceIdentifier[];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@
"type": "boolean",
"description": "Whether to recursively list child resources of the query result",
"default": false
},
"table": {
"type": "string",
"description": "The ARG table name",
"default": "Resources"
},
"authorizationScopeFilter": {
"$ref": "#/definitions/authorizationScopeFilter",
"description": "The ARG Scope Filter parameter"
}
},
"required": [
Expand Down Expand Up @@ -330,6 +339,10 @@
"type": "string",
"description": "The Terraform configuration content"
},
"import": {
"type": "string",
"description": "The Terraform import blocks for the current export, which users can use to run \"terraform plan\" with to import the resources"
},
"skippedResources": {
"type": "array",
"description": "A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform",
Expand Down Expand Up @@ -426,6 +439,42 @@
}
]
}
},
"authorizationScopeFilter": {
"type": "string",
"description": "The Azure Resource Graph Authorization Scope Filter parameter",
"enum": [
"AtScopeAndBelow",
"AtScopeAndAbove",
"AtScopeAboveAndBelow",
"AtScopeExact"
],
"x-ms-enum": {
"name": "authorizationScopeFilter",
"modelAsString": true,
"values": [
{
"name": "AtScopeAndBelow",
"value": "AtScopeAndBelow",
"description": "Returns assignments for the given scope and all child scopes."
},
{
"name": "AtScopeAndAbove",
"value": "AtScopeAndAbove",
"description": "Returns assignments for the given scope and all parent scopes, but not child scopes."
},
{
"name": "AtScopeAboveAndBelow",
"value": "AtScopeAboveAndBelow",
"description": "Returns assignments for the given scope, all parent scopes, and all child scopes."
},
{
"name": "AtScopeExact",
"value": "AtScopeExact",
"description": "Returns assignments only for the given scope; no parent or child scopes are included."
}
]
}
}
},
"parameters": {}
Expand Down

0 comments on commit 3feb9e3

Please sign in to comment.