-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from inspec/support-service-bus-regions
RESOURCE-124 Support service bus regions
- Loading branch information
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
docs-chef-io/content/inspec/resources/azure_service_bus_regions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
+++ | ||
title = "azure_service_bus_regions Resource" | ||
platform = "azure" | ||
draft = false | ||
gh_repo = "inspec-azure" | ||
|
||
[menu.inspec] | ||
title = "azure_service_bus_regions" | ||
identifier = "inspec/resources/azure/azure_service_bus_regions Resource" | ||
parent = "inspec/resources/azure" | ||
+++ | ||
|
||
Use the `azure_service_bus_regions` InSpec audit resource to test properties related to all Azure Service Bus regions. | ||
|
||
## Azure REST API Version, Endpoint, and HTTP Client Parameters | ||
|
||
{{% inspec_azure_common_parameters %}} | ||
|
||
## Installation | ||
|
||
{{% inspec_azure_install %}} | ||
|
||
## Syntax | ||
|
||
An `azure_service_bus_regions` resource block returns all Azure Service Bus regions. | ||
|
||
```ruby | ||
describe azure_service_bus_regions(sku: 'SKU_NAME') do | ||
#... | ||
end | ||
``` | ||
|
||
## Parameters | ||
|
||
`sku` _(required)_ | ||
: The sku type. | ||
|
||
## 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 Service Bus regions. | ||
|
||
: **Field**: `properties` | ||
|
||
`locations` | ||
: A list of the Resource locations. | ||
|
||
: **Field**: `location` | ||
|
||
`codes` | ||
: A list of Region codes. | ||
|
||
: **Field**: `code` | ||
|
||
`fullNames` | ||
: A list of Full name of the regions. | ||
|
||
: **Field**: `fullName` | ||
|
||
{{% inspec_filter_table %}} | ||
|
||
## Examples | ||
|
||
**Test that there are Service Bus regions that are successfully provisioned.** | ||
|
||
```ruby | ||
describe azure_service_bus_regions(sku: 'SKU_NAME').where(code: 'Central US') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Matchers | ||
|
||
{{% inspec_matchers_link %}} | ||
|
||
### exists | ||
|
||
```ruby | ||
# Should not exist if no Service Bus regions are present | ||
|
||
describe azure_service_bus_regions(sku: 'SKU_NAME') do | ||
it { should_not exist } | ||
end | ||
# Should exist if the filter returns at least one Service Bus regions | ||
|
||
describe azure_service_bus_regions(sku: 'SKU_NAME') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Azure Permissions | ||
|
||
{{% azure_permissions_service_principal role="reader" %}} |