Skip to content
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

RESOURCE-124 Support service bus regions #566

Merged
merged 3 commits into from
Mar 12, 2022
Merged
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ The following is a list of static resources.
- [azure_data_factory_datasets](docs/resources/azure_data_factory_datasets.md)
- [azure_data_factory_linked_service](docs/resources/azure_data_factory_linked_service.md)
- [azure_data_factory_linked_services](docs/resources/azure_data_factory_linked_services.md)
- [azure_data_factory_pipeline](docs/resources/azure_data_factory_pipeline.md)
- [azure_data_factory_pipelines](docs/resources/azure_data_factory_pipelines.md)
- [azure_data_lake_storage_gen2_filesystem](docs/resources/azure_data_lake_storage_gen2_filesystem.md)
- [azure_data_lake_storage_gen2_filesystems](docs/resources/azure_data_lake_storage_gen2_filesystems.md)
- [azure_db_migration_service](docs/resources/azure_db_migration_service.md)
- [azure_db_migration_services](docs/resources/azure_db_migration_services.md)
- [azure_ddos_protection_resource](docs/resources/azure_ddos_protection_resource.md)
Expand Down Expand Up @@ -413,6 +417,7 @@ The following is a list of static resources.
- [azure_service_bus_subscription_rules](docs/resources/azure_service_bus_subscription_rules.md)
- [azure_service_bus_topic](docs/resources/azure_service_bus_topic.md)
- [azure_service_bus_topics](docs/resources/azure_service_bus_topics.md)
- [azure_service_bus_regions](docs/resources/azure_service_bus_regions.md)
- [azure_sql_database](docs/resources/azure_sql_database.md)
- [azure_sql_databases](docs/resources/azure_sql_databases.md)
- [azure_sql_server](docs/resources/azure_sql_server.md)
Expand Down
108 changes: 108 additions & 0 deletions docs-chef-io/content/inspec/resources/azure_service_bus_regions.md
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" %}}