Skip to content

Commit

Permalink
docs: minor corrections post v0.10.0 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-FFFFFF authored Mar 6, 2024
1 parent e342112 commit 121092a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 47 deletions.
18 changes: 7 additions & 11 deletions docs/data-sources/archetype.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ data "alz_archetype" "example" {
defaults = {
location = "westeurope"
}
id = "alz-root"
base_archetype = "root"
display_name = "alz-root"
parent_id = data.azurerm_client_config.current.tenant_id
policy_definitions_to_add = ["MyPolicyDefinition"]
policy_assignments_to_add = ["MyPolicyAssignment"]
id = "alz-root"
base_archetype = "root"
display_name = "alz-root"
parent_id = data.azurerm_client_config.current.tenant_id
}
```

Expand Down Expand Up @@ -74,9 +72,7 @@ Optional:
- `identity_ids` (Set of String) A list of zero or one identity ids to assign to the policy assignment. Required if `identity` is `UserAssigned`.
- `non_compliance_message` (Attributes Set) The non-compliance messages to use for the policy assignment. (see [below for nested schema](#nestedatt--policy_assignments_to_modify--non_compliance_message))
- `overrides` (Attributes List) The overrides for this policy assignment. There are a maximum of 10 overrides allowed per assignment. If specified here the overrides will replace the existing overrides.The overrides are processed in the order they are specified. (see [below for nested schema](#nestedatt--policy_assignments_to_modify--overrides))
- `parameters` (String) The parameters to use for the policy assignment. **Note:** This is a JSON string, and not a map. This is because the parameter values have different types, which confuses the type system used by the provider sdk. Use `jsonencode()` to construct the map. The map keys must be strings, the values are `any` type.

Example: `jsonencode({"param1": "value1", "param2": 2})`
- `parameters` (String) The parameters to use for the policy assignment. **Note:** This is a JSON string, and not a map. This is because the parameter values have different types, which confuses the type system used by the provider sdk. Use `jsonencode()` to construct the map. The map keys must be strings, the values are `any` type. Example: `jsonencode({"param1": "value1", "param2": 2})`
- `resource_selectors` (Attributes List) The resource selectors to use for the policy assignment. A maximum of 10 resource selectors are allowed per assignment. If specified here the resource selectors will replace the existing resource selectors. (see [below for nested schema](#nestedatt--policy_assignments_to_modify--resource_selectors))

<a id="nestedatt--policy_assignments_to_modify--non_compliance_message"></a>
Expand Down Expand Up @@ -139,8 +135,8 @@ Required:

Optional:

- `in` (Set of String) The list of values that the selector will match. The values are the policy definition reference ids. Conflicts with `in`.
- `not_in` (Set of String) The list of values that the selector will not match. The values are the policy definition reference ids. Conflicts with `in`.
- `in` (Set of String) The list of values that the selector will match. Conflicts with `not_in`.
- `not_in` (Set of String) The list of values that the selector will not match. Conflicts with `in`.



Expand Down
4 changes: 1 addition & 3 deletions docs/data-sources/archetype_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ Archetype keys data source. Produces sets of strings to be used in `for_each` lo

```terraform
data "alz_archetype_keys" "example" {
base_archetype = "root"
policy_definitions_to_add = ["MyPolicyDefinition"]
policy_assignments_to_add = ["MyPolicyAssignment"]
base_archetype = "root"
}
```

Expand Down
35 changes: 17 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ terraform {
As this provider is still at version zero, you should constrain the acceptable
provider versions on the minor version.

## Azure Landing Zones Library

The provider will download the Azure Landing Zones Library from the [Azure Landing Zones Library GitHub repository](https://github.com/Azure/Azure-Landing-Zones-Library).
The asserts are in the `platform/alz` directory and are version tagged in order to provide a consistent experience.
Within the library are the following types of asserts:

- **policy definitions** - These are the policy definitions that are used to enforce the policies in the Azure Policy service.
- **policy assignments** - These are the policy assignments that are used to assign the policy definitions to the appropriate scope.
- **policy set definitions** - These are the policy set definitions that are used to group policy definitions together.
- **role definitions** - These are the role definitions that are used to define the roles in the Azure Role-Based Access Control (RBAC) service.
- **archetype definitions** - These group together the policy definitions, policy assignments, policy set definitions, and role definitions that and can be assigned to a management group.
- **archetype overrides** - These create new archetypes based off an existing archetype.

~> **Important** If the provider does not have access to download the library, please download and use the `lib_urls` to specify the local directory.

For more information please visit the [GitHub repository](https://github.com/Azure/Azure-Landing-Zones-Library).

<!-- schema generated by tfplugindocs -->
## Schema

Expand All @@ -84,21 +101,3 @@ provider versions on the minor version.
- `use_cli` (Boolean) Allow Azure CLI to be used for authentication. Default is `true`. If not specified, value will be attempted to be read from the `ARM_USE_CLI` environment variable.
- `use_msi` (Boolean) Allow managed service identity to be used for authentication. Default is `false`. If not specified, value will be attempted to be read from the `ARM_USE_MSI` environment variable.
- `use_oidc` (Boolean) Allow OpenID Connect to be used for authentication. Default is `false`. If not specified, value will be attempted to be read from the `ARM_USE_OIDC` environment variable.


## Azure Landing Zones Library

The provider will download the Azure Landing Zones Library from the [Azure Landing Zones Library GitHub repository](https://github.com/Azure/Azure-Landing-Zones-Library).
The asserts are in the `platform/alz` directory and are version tagged in order to provide a consistent experience.
Within the library are the following types of asserts:

- **policy definitions** - These are the policy definitions that are used to enforce the policies in the Azure Policy service.
- **policy assignments** - These are the policy assignments that are used to assign the policy definitions to the appropriate scope.
- **policy set definitions** - These are the policy set definitions that are used to group policy definitions together.
- **role definitions** - These are the role definitions that are used to define the roles in the Azure Role-Based Access Control (RBAC) service.
- **archetype definitions** - These group together the policy definitions, policy assignments, policy set definitions, and role definitions that and can be assigned to a management group.
- **archetype overrides** - These create new archetypes based off an existing archetype.

~> **Important** If the provider does not have access to download the library, please download and use the `lib_urls` to specify the local directory.

For more information please visit the [GitHub repository](https://github.com/Azure/Azure-Landing-Zones-Library).
10 changes: 4 additions & 6 deletions examples/data-sources/alz_archetype/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ data "alz_archetype" "example" {
defaults = {
location = "westeurope"
}
id = "alz-root"
base_archetype = "root"
display_name = "alz-root"
parent_id = data.azurerm_client_config.current.tenant_id
policy_definitions_to_add = ["MyPolicyDefinition"]
policy_assignments_to_add = ["MyPolicyAssignment"]
id = "alz-root"
base_archetype = "root"
display_name = "alz-root"
parent_id = data.azurerm_client_config.current.tenant_id
}
4 changes: 1 addition & 3 deletions examples/data-sources/alz_archetype_keys/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
data "alz_archetype_keys" "example" {
base_archetype = "root"
policy_definitions_to_add = ["MyPolicyDefinition"]
policy_assignments_to_add = ["MyPolicyAssignment"]
base_archetype = "root"
}
6 changes: 3 additions & 3 deletions internal/provider/archetype_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (d *ArchetypeDataSource) Schema(ctx context.Context, req datasource.SchemaR
},
},
"in": schema.SetAttribute{
MarkdownDescription: "The list of values that the selector will match. The values are the policy definition reference ids. Conflicts with `in`.",
MarkdownDescription: "The list of values that the selector will match. Conflicts with `not_in`.",
Optional: true,
ElementType: types.StringType,
Validators: []validator.Set{
Expand All @@ -323,7 +323,7 @@ func (d *ArchetypeDataSource) Schema(ctx context.Context, req datasource.SchemaR
},
},
"not_in": schema.SetAttribute{
MarkdownDescription: "The list of values that the selector will not match. The values are the policy definition reference ids. Conflicts with `in`.",
MarkdownDescription: "The list of values that the selector will not match. Conflicts with `in`.",
Optional: true,
ElementType: types.StringType,
Validators: []validator.Set{
Expand All @@ -342,7 +342,7 @@ func (d *ArchetypeDataSource) Schema(ctx context.Context, req datasource.SchemaR
MarkdownDescription: "The parameters to use for the policy assignment. " +
"**Note:** This is a JSON string, and not a map. This is because the parameter values have different types, which confuses the type system used by the provider sdk. " +
"Use `jsonencode()` to construct the map. " +
"The map keys must be strings, the values are `any` type.\n\n" +
"The map keys must be strings, the values are `any` type. " +
"Example: `jsonencode({\"param1\": \"value1\", \"param2\": 2})`",
CustomType: alztypes.PolicyParameterType{},
Optional: true,
Expand Down
5 changes: 2 additions & 3 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ automatically installed by `terraform init` in the future:
As this provider is still at version zero, you should constrain the acceptable
provider versions on the minor version.

{{ .SchemaMarkdown | trimspace }}


## Azure Landing Zones Library

The provider will download the Azure Landing Zones Library from the [Azure Landing Zones Library GitHub repository](https://github.com/Azure/Azure-Landing-Zones-Library).
Expand All @@ -62,3 +59,5 @@ Within the library are the following types of asserts:
~> **Important** If the provider does not have access to download the library, please download and use the `lib_urls` to specify the local directory.

For more information please visit the [GitHub repository](https://github.com/Azure/Azure-Landing-Zones-Library).

{{ .SchemaMarkdown | trimspace }}

0 comments on commit 121092a

Please sign in to comment.