diff --git a/docs-chef-io/content/inspec/resources/azure_synapse_workspace.md b/docs-chef-io/content/inspec/resources/azure_synapse_workspace.md new file mode 100644 index 000000000..a7f274b03 --- /dev/null +++ b/docs-chef-io/content/inspec/resources/azure_synapse_workspace.md @@ -0,0 +1,103 @@ ++++ +title = "azure_synapse_workspace Resource" +platform = "azure" +draft = false +gh_repo = "inspec-azure" + +[menu.inspec] +title = "azure_synapse_workspace" +identifier = "inspec/resources/azure/azure_synapse_workspace Resource" +parent = "inspec/resources/azure" ++++ + +Use the `azure_synapse_workspace` InSpec audit resource to test properties related to an Azure Synapse workspace. + +## Azure REST API Version, Endpoint, and HTTP Client Parameters + +{{% inspec_azure_common_parameters %}} + +## Installation + +{{% inspec_azure_install %}} + +## Syntax + +```ruby +describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do + it { should exist } + its('type') { should eq 'Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups' } + its('location') { should eq 'eastus' } +end +``` + +```ruby +describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do + it { should exist } +end +``` + +## Parameters + +`name` _(required)_ +: Name of the Azure Synapse workspace to test. + +`resource_group` _(required)_ +: Azure resource group that the targeted resource resides in. + +## Properties + +`id` +: Resource Id. + +`name` +: Resource name. + +`type` +: Resource type. `Microsoft.Synapse/workspaces`. + +`location` +: The Geo-location where the resource lives. + +`properties` +: The properties of the Synapse workspaces. + +`properties.provisioningState` +: State of the resource. + + +For properties applicable to all resources, such as `type`, `name`, `id`, `properties`, refer to [`azure_generic_resource`]({{< relref "azure_generic_resource.md#properties" >}}). + +Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/synapse/workspaces/get) for other properties available. + +## Examples + +**Test that the Synapse workspaces is provisioned successfully.** + +```ruby +describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do + its('properties.provisioningState') { should eq 'Succeeded' } +end +``` + +## Matchers + +{{% inspec_matchers_link %}} + +### exists + +```ruby +# If a Synapse workspaces is found it will exist + +describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do + it { should exist } +end +# if Synapse workspaces is not found it will not exist + +describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do + it { should_not exist } +end +``` + +## Azure Permissions + +{{% azure_permissions_service_principal role="reader" %}} diff --git a/docs-chef-io/content/inspec/resources/azure_synapse_workspaces.md b/docs-chef-io/content/inspec/resources/azure_synapse_workspaces.md new file mode 100644 index 000000000..6909b50ac --- /dev/null +++ b/docs-chef-io/content/inspec/resources/azure_synapse_workspaces.md @@ -0,0 +1,113 @@ ++++ +title = "azure_synapse_workspaces Resource" +platform = "azure" +draft = false +gh_repo = "inspec-azure" + +[menu.inspec] +title = "azure_synapse_workspaces" +identifier = "inspec/resources/azure/azure_synapse_workspaces Resource" +parent = "inspec/resources/azure" ++++ + +Use the `azure_synapse_workspaces` InSpec audit resource to test properties related to all Azure Synapse workspaces. + +## Azure REST API Version, Endpoint, and HTTP Client Parameters + +{{% inspec_azure_common_parameters %}} + +## Installation + +{{% inspec_azure_install %}} + +## Syntax + +An `azure_synapse_workspaces` resource block returns all Azure Synapse workspaces. + +```ruby +describe azure_synapse_workspaces do + #... +end +``` + +## Parameters + +`resource_group` _(optional)_ +: Azure resource group that the targeted resource resides in. + +## Properties + +`ids` +: A list of resource IDs. + +: **Field**: `id` + +`names` +: A list of resource Names. + +: **Field**: `name` + +`types` +: A list of the resource types. + +: **Field**: `type` + +`properties` +: A list of Properties for all the Synapse workspaces. + +: **Field**: `properties` + +`locations` +: A list of the Geo-locations. + +: **Field**: `location` + +`provisioningStates` +: A list of provisioning states of the Synapse workspaces. + +: **Field**: `provisioningState` + +{{% inspec_filter_table %}} + +## Examples + +**Loop through Synapse workspaces by their names.** + +```ruby +azure_synapse_workspaces.names.each do |name| + describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: name) do + it { should exist } + end +end +``` + +**Test that there are Synapse workspaces that are successfully provisioned.** + +```ruby +describe azure_synapse_workspaces(resource_group: 'RESOURCE_GROUP').where(provisioningState: 'Succeeded') do + it { should exist } +end +``` + +## Matchers + +{{% inspec_matchers_link %}} + +### exists + +```ruby +# Should not exist if no Synapse workspaces are present + +describe azure_synapse_workspaces(resource_group: 'RESOURCE_GROUP') do + it { should_not exist } +end +# Should exist if the filter returns at least one Synapse workspaces + +describe azure_synapse_workspaces(resource_group: 'RESOURCE_GROUP') do + it { should exist } +end +``` + +## Azure Permissions + +{{% azure_permissions_service_principal role="reader" %}} diff --git a/docs-chef-io/resources/azure_synapse_workspace.md b/docs-chef-io/resources/azure_synapse_workspace.md deleted file mode 100644 index 44bb02577..000000000 --- a/docs-chef-io/resources/azure_synapse_workspace.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: About the azure_synapse_workspace Resource -platform: azure ---- - -# azure_synapse_workspace - -Use the `azure_synapse_workspace` InSpec audit resource to test properties related to an Azure Synapse Workspaces. - -## Azure REST API version, endpoint and http client parameters - -This resource interacts with api versions supported by the resource provider. -The `api_version` can be defined as a resource parameter. -If not provided, the latest version will be used. -For more information, refer to [`azure_generic_resource`](azure_generic_resource.md). - -Unless defined, `azure_cloud` global endpoint, and default values for the http client will be used. -For more information, refer to the resource pack [README](../../README.md). - -## Availability - -### Installation - -This resource is available in the [InSpec Azure resource pack](https://github.com/inspec/inspec-azure). -For an example `inspec.yml` file and how to set up your Azure credentials, refer to resource pack [README](../../README.md#Service-Principal). - -## Syntax - -`name`, `resource_group` is a required parameter. - -```ruby -describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do - it { should exist } - its('type') { should eq 'Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups' } - its('location') { should eq 'eastus' } -end -``` - -```ruby -describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do - it { should exist } -end -``` -## Parameters - -| Name | Description | -|----------------|----------------------------------------------------------------------------------| -| name | Name of the Azure Synapse Workspace to test. | -| resource_group | Azure resource group that the targeted resource resides in. `MyResourceGroup` | - -The parameter set should be provided for a valid query: -- `resource_group` and `name` - -## Properties - -| Property | Description | -|--------------------------|------------------------------------------------------------------| -| id | Resource Id. | -| name | Resource name. | -| type | Resource type. `Microsoft.Synapse/workspaces` | -| location | The Geo-location where the resource lives. | -| properties | The properties of the Synapse Workspaces. | -| properties.provisioningState | State of the resource. | - - -For properties applicable to all resources, such as `type`, `name`, `id`, `properties`, refer to [`azure_generic_resource`](azure_generic_resource.md#properties). - -Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/synapse/workspaces/get) for other properties available. - -## Examples - -### Test that the Synapse Workspaces is provisioned successfully. - -```ruby -describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do - its('properties.provisioningState') { should eq 'Succeeded' } -end -``` - -## Matchers - -This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our [Universal Matchers page](/inspec/matchers/). - -### exists - -```ruby -# If a Synapse Workspaces is found it will exist -describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do - it { should exist } -end -# if Synapse Workspaces is not found it will not exist -describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: 'SYNAPSE_WORKSPACE_NAME') do - it { should_not exist } -end -``` - -## Azure Permissions - -Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be setup with a `reader` role on the subscription you wish to test. \ No newline at end of file diff --git a/docs-chef-io/resources/azure_synapse_workspaces.md b/docs-chef-io/resources/azure_synapse_workspaces.md deleted file mode 100644 index d3ec6f16e..000000000 --- a/docs-chef-io/resources/azure_synapse_workspaces.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: About the azure_synapse_workspaces Resource -platform: azure ---- - -# azure_synapse_workspaces - -Use the `azure_synapse_workspaces` InSpec audit resource to test properties related to all Azure Synapse Workspaces. - -## Azure REST API version, endpoint and http client parameters - -This resource interacts with api versions supported by the resource provider. -The `api_version` can be defined as a resource parameter. -If not provided, the latest version will be used. -For more information, refer to [`azure_generic_resource`](azure_generic_resource.md). - -Unless defined, `azure_cloud` global endpoint, and default values for the http client will be used. -For more information, refer to the resource pack [README](../../README.md). - -## Availability - -### Installation - -This resource is available in the [InSpec Azure resource pack](https://github.com/inspec/inspec-azure). -For an example `inspec.yml` file and how to set up your Azure credentials, refer to resource pack [README](../../README.md#Service-Principal). - -## Syntax - -An `azure_synapse_workspaces` resource block returns all Azure Synapse Workspaces. - -```ruby -describe azure_synapse_workspaces do - #... -end -``` - -## Parameters -| Name | Description | -|----------------|----------------------------------------------------------------------------------| -| resource_group | Azure resource group that the targeted resource resides in. `MyResourceGroup` (Optional) | - -The parameter set optionally be provided for a valid query: -- `resource_group` - -## Properties - -|Property | Description | Filter Criteria* | -|--------------------------------|------------------------------------------------------------------------|------------------| -| ids | A list of resource IDs. | `id` | -| names | A list of resource Names. | `name` | -| types | A list of the resource types. | `type` | -| properties | A list of Properties for all the Synapse Workspaces. | `properties` | -| locations | A list of the Geo-locations. | `location` | -| provisioningStates | A list of provisioning states of the Synapse Workspaces. | `provisioningState`| - -* For information on how to use filter criteria on plural resources refer to [FilterTable usage](https://github.com/inspec/inspec/blob/master/dev-docs/filtertable-usage.md). - -## Examples - -### Loop through Synapse Workspaces by their names. - -```ruby -azure_synapse_workspaces.names.each do |name| - describe azure_synapse_workspace(resource_group: 'RESOURCE_GROUP', name: name) do - it { should exist } - end -end -``` -### Test that there are Synapse Workspaces that are successfully provisioned. - -```ruby -describe azure_synapse_workspaces(resource_group: 'RESOURCE_GROUP').where(provisioningState: 'Succeeded') do - it { should exist } -end -``` - -## Matchers - -This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our [Universal Matchers page](https://www.inspec.io/docs/reference/matchers/). - -### exists - -```ruby -# Should not exist if no Synapse Workspaces are present -describe azure_synapse_workspaces(resource_group: 'RESOURCE_GROUP') do - it { should_not exist } -end -# Should exist if the filter returns at least one Synapse Workspaces -describe azure_synapse_workspaces(resource_group: 'RESOURCE_GROUP') do - it { should exist } -end -``` -## Azure Permissions - -Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be setup with a `reader` role on the subscription you wish to test. \ No newline at end of file