diff --git a/README.md b/README.md
index 2126c478f..35d4ed040 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ This InSpec resource pack uses the Azure REST API and provides the required reso
### Service Principal
-Your Azure Service Principal Account must have a minimum of `reader` role of the [Azure roles](https://docs.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles#azure-roles) to any subscription that you'd like to use this resource pack against.
+Your Azure Service Principal Account must have a minimum of `reader` role of the [Azure roles](https://docs.microsoft.com/en-us/azure/role-based-access-control/rbac-and-directory-admin-roles#azure-roles) to any subscription that you'd like to use this resource pack against.
You should have the following pieces of information:
@@ -110,14 +110,14 @@ The following is a list of generic resources.
- [azure_generic_resources](docs/resources/azure_generic_resources.md)
- [azure_graph_generic_resource](docs/resources/azure_graph_generic_resource.md)
- [azure_graph_generic_resources](docs/resources/azure_graph_generic_resources.md)
-
+
With the generic resources:
- Azure cloud resources that this resource pack does not include a static InSpec resource for can be tested.
- Azure resources from different resource providers and resource groups can be tested at the same time.
- Server side filtering can be used for more efficient tests.
-
-The following is a list of static resources.
+
+The following is a list of static resources.
- [azure_active_directory_domain_service](docs/resources/azure_active_directory_domain_service.md)
- [azure_active_directory_domain_services](docs/resources/azure_active_directory_domain_services.md)
@@ -276,7 +276,7 @@ azure_generic_resources(substring_of_name: 'project_A').ids.each do |id|
its('location') { should eq 'eastus' }
end
end
-```
+```
### Interrogate All Resources that Have a Tag Defined with the Name `project_A` Regardless of its Value
@@ -286,7 +286,7 @@ azure_generic_resources(tag_name: 'project_A').ids.each do |id|
its('location') { should eq 'eastus' }
end
end
-```
+```
### Verify Properties of an Azure Virtual Machine
@@ -313,11 +313,11 @@ describe azure_network_security_group(resource_group: 'ProductionResourceGroup',
it { should_not allow_rdp_from_internet }
it { should_not allow_ssh_from_internet }
it { should allow(source_ip_range: '0.0.0.0', destination_port: '22', direction: 'inbound') }
- it { should allow_in(service_tag: 'Internet', port: %w{1433-1434 1521 4300-4350 5000-6000}) }
+ it { should allow_in(service_tag: 'Internet', port: %w{1433-1434 1521 4300-4350 5000-6000}) }
end
```
-## Parameters Applicable To All Resources
+## Parameters Applicable To All Resources
The generic resources and their derivations support following parameters unless stated otherwise in their specific resource page.
@@ -400,59 +400,15 @@ The behavior of the http client can be defined with the following parameters:
They can be defined as environment variables or resource parameters (has priority).
-
-
-> WARNING The following resources are using their `azure_` counterparts under the hood and they will be deprecated in the InSpec Azure version **2**.
-> Their api versions are fixed (see below) for full backward compatibility.
-> It is strongly advised to start using the resources with `azure_` prefix for an up-to-date testing experience.
-
-| Legacy Resource Name | Fixed [api version](#api_version) | Replaced by |
-|------------------------------------------|----------------------------|-------------------------------|
-| azurerm_ad_user, azurerm_ad_users | `v1.0` | [azure_graph_user](docs/resources/azure_graph_user.md), [azure_graph_users](docs/resources/azure_graph_users.md) |
-| azurerm_aks_cluster, azurerm_aks_clusters | `2018-03-31` | [azure_aks_cluster](docs/resources/azure_aks_cluster.md), [azure_aks_cluster](docs/resources/azure_aks_cluster.md) |
-| azurerm_api_management, azurerm_api_managements | `2019-12-01` | [azure_api_management](docs/resources/azure_api_management.md), [azure_api_managements](docs/resources/azure_api_managements.md) |
-| azurerm_application_gateway, azurerm_application_gateways | `2019-12-01` | [azure_application_gateway](docs/resources/azure_application_gateway.md), [azure_application_gateways](docs/resources/azure_application_gateways.md) |
-| azurerm_cosmosdb_database_account | `2015-04-08` | [azure_cosmosdb_database_account](docs/resources/azure_cosmosdb_database_account.md) |
-| azurerm_event_hub_authorization_rule | `2017-04-01` | [azure_event_hub_authorization_rule](docs/resources/azure_event_hub_authorization_rule.md) |
-| azurerm_event_hub_event_hub | `2017-04-01` | [azure_event_hub_event_hub](docs/resources/azure_event_hub_event_hub.md) |
-| azurerm_event_hub_namespace | `2017-04-01` | [azure_event_hub_namespace](docs/resources/azure_event_hub_namespace.md) |
-| azurerm_hdinsight_cluster | `2015-03-01-preview` | [azure_hdinsight_cluster](docs/resources/azure_hdinsight_cluster.md) |
-| azurerm_iothub | `2018-04-01` | [azure_iothub](docs/resources/azure_iothub.md) |
-| azurerm_iothub_event_hub_consumer_group, azurerm_iothub_event_hub_consumer_groups |`2018-04-01` | [azure_iothub_event_hub_consumer_group](docs/resources/azure_iothub_event_hub_consumer_group.md), [azure_iothub_event_hub_consumer_groups](docs/resources/azure_iothub_event_hub_consumer_groups.md) |
-| azurerm_key_vault, azurerm_key_vaults | `2016-10-01` | [azure_key_vault](docs/resources/azure_key_vault.md), [azure_key_vaults](docs/resources/azure_key_vaults.md) |
-| azurerm_key_vault_key, azurerm_key_vault_keys | `2016-10-01` | [azure_key_vault_key](docs/resources/azure_key_vault_key.md), [azure_key_vault_keys](docs/resources/azure_key_vault_keys.md) |
-| azurerm_key_vault_secret, azurerm_key_vault_secrets | `2016-10-01` | [azure_key_vault_secret](docs/resources/azure_key_vault_secret.md), [azure_key_vault_secrets](docs/resources/azure_key_vault_secrets.md) |
-| azurerm_load_balancer, azurerm_load_balancers | `2018-11-01` | [azure_load_balancer](docs/resources/azure_load_balancer.md), [azure_load_balancers](docs/resources/azure_load_balancers.md) |
-| azurerm_locks | `2016-09-01` | [azure_locks](docs/resources/azure_locks.md) |
-| azurerm_management_group, azurerm_management_groups | `2018-03-01-preview` | [azure_management_group](docs/resources/azure_management_group.md), [azure_management_groups](docs/resources/azure_management_groups.md) |
-| azurerm_mariadb_server, azurerm_mariadb_servers | `2018-06-01-preview` | [azure_mariadb_server](docs/resources/azure_mariadb_server.md), [azure_mariadb_servers](docs/resources/azure_mariadb_servers.md) |
-| azurerm_monitor_activity_log_alert, azurerm_monitor_activity_log_alerts | `2017-04-01` | [azure_monitor_activity_log_alert](docs/resources/azure_monitor_activity_log_alert.md), [azure_monitor_activity_log_alerts](docs/resources/azure_monitor_activity_log_alerts.md) |
-| azurerm_monitor_log_profile, azurerm_monitor_log_profiles | `2016-03-01` | [azure_monitor_log_profile](docs/resources/azure_monitor_log_profile.md), [azure_monitor_log_profiles](docs/resources/azure_monitor_log_profiles.md) |
-| azurerm_mysql_database, azurerm_mysql_databases | `2017-12-01` | [azure_mysql_database](docs/resources/azure_mysql_database.md), [azure_mysql_databases](docs/resources/azure_mysql_databases.md) |
-| azurerm_mysql_server, azurerm_mysql_servers | `2017-12-01` | [azure_mysql_server](docs/resources/azure_mysql_server.md), [azure_mysql_servers](docs/resources/azure_mysql_servers.md) |
-| azurerm_network_interface, azurerm_network_interfaces | `2018-11-01` | [azure_network_interface](docs/resources/azure_network_interface.md), [azure_network_interfaces](docs/resources/azure_network_interfaces.md) |
-| azurerm_network_security_group, azurerm_network_security_groups | `2018-02-01` | [azure_network_security_group](docs/resources/azure_network_security_group.md), [azure_network_security_groups](docs/resources/azure_network_security_groups.md) |
-| azurerm_network_watcher, azurerm_network_watchers | `2018-02-01` | [azure_network_watcher](docs/resources/azure_network_watcher.md), [azure_network_watchers](docs/resources/azure_network_watchers.md) |
-| azurerm_postgresql_database, azurerm_postgresql_databases | `2017-12-01` | [azure_postgresql_database](docs/resources/azure_postgresql_database.md), [azure_postgresql_databases](docs/resources/azure_postgresql_databases.md) |
-| azurerm_postgresql_server, azurerm_postgresql_servers | `2017-12-01` | [azure_postgresql_server](docs/resources/azure_postgresql_server.md), [azure_postgresql_servers](docs/resources/azure_postgresql_servers.md) |
-| azurerm_public_ip | `2020-05-01` | [azure_public_ip](docs/resources/azure_public_ip.md) |
-| azurerm_resource_groups | `2018-02-01` | [azure_resource_groups](docs/resources/azure_resource_groups.md) |
-| azurerm_role_definition, azurerm_role_definitions | `2015-07-01` | [azure_role_definition](docs/resources/azure_role_definition.md), [azure_role_definitions](docs/resources/azure_role_definitions.md) |
-| azurerm_security_center_policy, azurerm_security_center_policies | `2015-06-01-Preview` | [azure_security_center_policy](docs/resources/azure_security_center_policy.md), [azure_security_center_policies](docs/resources/azure_security_center_policies.md) |
-| azurerm_sql_database, azurerm_sql_databases | `2017-10-01-preview` | [azure_sql_database](docs/resources/azure_sql_database.md), [azure_sql_databases](docs/resources/azure_sql_databases.md) |
-| azurerm_sql_server, azurerm_sql_servers | `2018-06-01-preview` | [azure_sql_server](docs/resources/azure_sql_server.md), [azure_sql_servers](docs/resources/azure_sql_servers.md) |
-| azurerm_storage_account, azurerm_storage_accounts | `2017-06-01` | [azure_storage_account](docs/resources/azure_storage_account.md), [azure_storage_accounts](docs/resources/azure_storage_accounts.md) |
-| azurerm_storage_account_blob_container, azurerm_storage_account_blob_containers | `2018-07-01` | [azure_storage_account_blob_container](docs/resources/azure_storage_account_blob_container.md), [azure_storage_account_blob_containers](docs/resources/azure_storage_account_blob_containers.md) |
-| azurerm_subnet, azurerm_subnets | `2018-02-01` | [azure_subnet](docs/resources/azure_subnet.md), [azure_subnets](docs/resources/azure_subnets.md) |
-| azurerm_subscription | `2019-10-01` | [azure_subscription](docs/resources/azure_subscription.md) |
-| azurerm_virtual_machine, azurerm_virtual_machines | `2017-12-01` | [azure_virtual_machine](docs/resources/azure_virtual_machine.md), [azure_virtual_machines](docs/resources/azure_virtual_machines.md) |
-| azurerm_virtual_machine_disk, azurerm_virtual_machine_disks | `2017-03-30` | [azure_virtual_machine_disk](docs/resources/azure_virtual_machine_disk.md), [azure_virtual_machine_disks](docs/resources/azure_virtual_machine_disks.md) |
-| azurerm_virtual_network, azurerm_virtual_networks | `2018-02-01` | [azure_virtual_network](docs/resources/azure_virtual_network.md), [azure_virtual_networks](docs/resources/azure_virtual_networks.md) |
-| azurerm_webapp, azurerm_webapps | `2016-08-01` | [azure_webapp](docs/resources/azure_webapp.md), [azure_webapps](docs/resources/azure_webapps.md) |
+{{< warning >}}
+
+The `azurerm_` resources are removed from the inspec-azure version 2. It is highly recommended to use resources with the `azure_` prefix for a reliable testing experience.
+
+{{< /warning >}}
## Development
-If you'd like to contribute to this project please see [Contributing Rules](CONTRIBUTING.md).
+If you'd like to contribute to this project please see [Contributing Rules](CONTRIBUTING.md).
For a detailed walk-through of resource creation, see the [Resource Creation Guide](dev-docs/resource_creation_guide.md).
@@ -464,10 +420,10 @@ The easiest way to start is checking the existing static resources. They have de
The common parameters are:
-- `resource_provider`: Such as `Microsoft.Compute/virtualMachines`. It has to be hardcoded in the code by the resource author via the `specific_resource_constraint` method, and it should be the first parameter defined in the resource. This method includes user-supplied input validation.
+- `resource_provider`: Such as `Microsoft.Compute/virtualMachines`. It has to be hardcoded in the code by the resource author via the `specific_resource_constraint` method, and it should be the first parameter defined in the resource. This method includes user-supplied input validation.
- `display_name`: A generic one will be created unless defined.
- `required_parameters`: Define mandatory parameters. The `resource_group` and resource `name` in the singular resources are default mandatory in the base class.
-- `allowed_parameters`: Define optional parameters. The `resource_group` is optional in plural resources, but this can be made mandatory in the static resource.
+- `allowed_parameters`: Define optional parameters. The `resource_group` is optional in plural resources, but this can be made mandatory in the static resource.
- `resource_uri`: Azure REST API URI of a resource. This parameter should be used when a resource does not reside in a resource group. It requires `add_subscription_id` to be set to either `true` or `false`. See [azure_policy_definition](libraries/azure_policy_definition.rb) and [azure_policy_definitions](libraries/azure_policy_definitions.rb).
- `add_subscription_id`: It indicates whether the subscription ID should be included in the `resource_uri` or not.
@@ -478,7 +434,7 @@ The singular resource is used to test a specific resource of a specific type and
- In most cases `resource_group` and resource `name` should be required from the users and a single API call would be enough for creating methods on the resource. See [azure_virtual_machine](libraries/azure_virtual_machine.rb) for a standard singular resource and how to create static methods from resource properties.
- If it is beneficial to accept the resource name with a more specific keyword, such as `server_name`, see [azure_mysql_server](libraries/azure_mysql_server.rb).
- If a resource exists in another resource, such as a subnet on a virtual network, see [azure_subnet](libraries/azure_subnet.rb).
-- If it is necessary to make an additional API call within a static method, the `create_additional_properties` should be used. See [azure_key_vault](libraries/azure_key_vault.rb).
+- If it is necessary to make an additional API call within a static method, the `create_additional_properties` should be used. See [azure_key_vault](libraries/azure_key_vault.rb).
#### Plural Resources
@@ -581,7 +537,7 @@ Please refer to the [Microsoft Documentation](https://docs.microsoft.com/en-us/a
To run a control called `azure_virtual_machine` only:
```shell
-rake test:integration[azurerm_virtual_machine]
+rake test:integration[azure_virtual_machine]
```
Note that in zsh you need to escape the `[`, `]` characters.
diff --git a/dev-docs/resource_creation_guide.md b/dev-docs/resource_creation_guide.md
index 8d997c2e3..765e80403 100644
--- a/dev-docs/resource_creation_guide.md
+++ b/dev-docs/resource_creation_guide.md
@@ -8,39 +8,42 @@ The singular resource is used to test a specific resource of that type and shoul
In this tutorial `azure_key_vault` and `azure_key_vaults` resources will be created.
-InSpec Azure backend classes constitute a simple interface between the InSpec and the desired Azure REST API endpoint.
+InSpec Azure backend classes constitute a simple interface between the InSpec and the desired Azure REST API endpoint.
For the Azure Key Vault resource, the inheritance order is:
+
- `AzureKeyVault`: Resource specific input validation.
- `AzureGenericResource`: Construct the resource URI/ID, talk to the API, validate the returned data, create dynamic methods(properties), define the `exists?` method.
-- `AzureResourceBase`: Initiate an HTTP client, provide tools for validation and decision making.
+- `AzureResourceBase`: Initiate an HTTP client, provide tools for validation and decision making.
- `Inspec.resource(1)`: InSpec base class for resources.
## Table of Contents
-- [Singular Resource](#singular-resource)
- - [Singular Resource Initiation Logic](#singular-resource-initiation-logic)
- - [Singular Resource Creation](#singular-resource-creation)
- - [Resource Identifier](#resource-identifier)
- - [Additional Resource Properties](#additional-resource-properties)
- - [Processing Additional Resource Properties](#processing-additional-resource-properties)
- - [Allowed Parameters](#allowed-parameters)
-- [Plural Resource](#plural-resource)
- - [Plural Resource Initiation Logic](#plural-resource-initiation-logic)
- - [Plural Resource Creation](#plural-resource-creation)
- - [Manipulating Data in FilterTable](#manipulating-data-in-filtertable)
-- [Resources Living in/on Another Resources](#resources-living-inon-another-resources)
- - [Required Parameters](#required-parameters)
- - [Resource Path](#resource-path)
-- [Resources without a Resource Group](#resources-without-a-resource-group)
- - [Resource URI](#resource-uri)
-- [Common Parameters](#common-parameters)
- - [Display Name](#display-name)
-- [Update Terraform Outputs](#update-terraform-outputs)
- - [Apply the Terraform Plan](#apply-the-terraform-plan)
-- [Create Controls](#create-controls)
-- [Create Documentation](#create-documentation)
-- [Create a Pull Request](#create-a-pull-request)
+- [Resource Creation Guide](#resource-creation-guide)
+ - [Table of Contents](#table-of-contents)
+ - [Singular Resource](#singular-resource)
+ - [Singular Resource Initiation Logic](#singular-resource-initiation-logic)
+ - [Singular Resource Creation](#singular-resource-creation)
+ - [Resource Identifier](#resource-identifier)
+ - [Additional Resource Properties](#additional-resource-properties)
+ - [Processing Additional Resource Properties](#processing-additional-resource-properties)
+ - [Allowed Parameters](#allowed-parameters)
+ - [Plural Resource](#plural-resource)
+ - [Plural Resource Initiation Logic](#plural-resource-initiation-logic)
+ - [Plural Resource Creation](#plural-resource-creation)
+ - [Manipulating Data in FilterTable](#manipulating-data-in-filtertable)
+ - [Resources Living in/on Another Resources](#resources-living-inon-another-resources)
+ - [Required Parameters](#required-parameters)
+ - [Resource Path](#resource-path)
+ - [Resources without a Resource Group](#resources-without-a-resource-group)
+ - [Resource URI](#resource-uri)
+ - [Common Parameters](#common-parameters)
+ - [Display Name](#display-name)
+ - [Update Terraform Outputs](#update-terraform-outputs)
+ - [Apply the Terraform Plan](#apply-the-terraform-plan)
+ - [Create Controls](#create-controls)
+ - [Create Documentation](#create-documentation)
+ - [Create a Pull Request](#create-a-pull-request)
## Singular Resource
@@ -67,23 +70,27 @@ Find the Azure REST API documentation for the resource being developed, [Azure k
### Singular Resource Creation
-- Create the library file: All of the InSpec resource extensions are located in the `libraries` directory. Copy a similar resource as a starting point.
+- Create the library file: All of the InSpec resource extensions are located in the `libraries` directory. Copy a similar resource as a starting point.
- Change the name to match the resource you are creating.
- i.e. `libraries/azure_key_vault.rb`
- Rename the class match the resource. The `name` will be used as the resource name in InSpec profiles. It has to be unique.
+
```ruby
class AzureKeyVault < AzureGenericResource
name 'azure_key_vault'
```
+
- Update the `desc` and `example`
- Remove any definitions that don't apply to this resource.
- Update the `initialize` method with the following order:
+
```ruby
+
def initialize(opts = {}) # Accept parameters as key: value pairs.
# Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
+
# Ensure that the resource will talk to the intended Azure Rest API endpoint and validate user input.
opts[:resource_provider] = specific_resource_constraint('Microsoft.KeyVault/vaults', opts)
@@ -91,14 +98,19 @@ def initialize(opts = {}) # Accept parameters as key: value pairs.
super(opts, true)
end
```
+
- Update the `to_s` method.
+
This can be any string relevant to the resource. However, the following is advised for a standard naming convention across the resources.
+
```ruby
def to_s
super(AzureKeyVault)
end
```
+
At this point, the `libraries/azure_key_vault` should look like:
+
```ruby
require 'azure_generic_resource'
@@ -127,31 +139,40 @@ class AzureKeyVault < AzureGenericResource
end
end
```
+
### Resource Identifier
+
Even though using the `name` keyword as a resource identifier is advised, a more specific keyword can be defined with the `resource_identifiers` parameter.
+
```ruby
opts[:resource_identifiers] = %i(vault_name)
```
+
Adding this line to the `initialize` method will enable `vault_name` to be used as a keyword along with `name`.
-Both are valid in an InSpec profile.
+Both are valid in an InSpec profile.
+
```ruby
describe azure_key_vault(resource_group: 'rg-1', vault_name: 'vault-1') do
its('name') { should eq('vault-1') }
end
```
+
```ruby
describe azure_key_vault(resource_group: 'rg-1', name: 'vault-1') do
its('name') { should eq('vault-1') }
end
```
+
### Additional Resource Properties
-A single API call will be made in the backend for creating the InSpec resource with the data provided in the `initialize` method.
+
+A single API call will be made in the backend for creating the InSpec resource with the data provided in the `initialize` method.
It is preferred not to make additional calls in the static methods for easy maintenance and more readable controls in InSpec profiles.
However, in some cases, it might be necessary to aggregate the relevant data and make them available through a single resource.
`additional_resource_properties` method should be used to accomplish this.
The below method can be used to list the `diagnostic settings` of an Azure key vault.
+
```ruby
def diagnostic_settings
return unless exists?
@@ -166,7 +187,8 @@ def diagnostic_settings
)
end
```
-- `return unless exists?` should be the first check in every static method. If the resource is failed, then we can not add a property to it.
+
+- `return unless exists?` should be the first check in every static method. If the resource is failed, then we can not add a property to it.
- `property_name`: A singleton method will be created with the provided `property_name`. The diagnostic settings and its content will be accessible via dot notation, e.g., `azure_key_vault.diagnostic_settings`, `azure_key_vault.diagnostic_settings.first.name`.
Note that the method name (`def diagnostic_settings`) and the `property_name` (`property_name: 'diagnostic_settings'`) in `additional_resource_properties` are identical.
@@ -182,10 +204,12 @@ end
#### Processing Additional Resource Properties
If we want to create a property returning only the names of the diagnostic settings, we need to create 2 methods for that.
-1) For fetching the diagnostic settings,
-2) For extracting the names from the diagnostic settings.
+
+1. For fetching the diagnostic settings,
+1. For extracting the names from the diagnostic settings.
Fetching the diagnostic settings.
+
```ruby
def diagnostic_settings
return unless exists?
@@ -200,7 +224,9 @@ def diagnostic_settings
)
end
```
+
Extracting the names of diagnostic settings. Please pay attention to the comments.
+
```ruby
def diagnostic_settings_names
# Ensure that the resource is created.
@@ -211,12 +237,14 @@ def diagnostic_settings_names
diagnostic_settings.map { |setting| setting.name } # [`my_setting_1`, `my_setting_2`, ..]
end
```
+
- The `diagnostic_settings` in the line `diagnostic_settings unless respond_to?(:diagnostic_settings)` is the actual method created on the resource for fetching the diagnostic settings, `def diagnostic_settings`.
- - It might be more convenient to name this method to prevent confusion, such as `fetch_diagnostic_settings`.
+ - It might be more convenient to name this method to prevent confusion, such as `fetch_diagnostic_settings`.
In that case `azure_key_vault.diagnostic_settings` won't be available unless the `fetch_diagnostic_settings` method is called up front, such as in the `initialize` method.
- The `diagnostic_settings` in the line `diagnostic_settings.map { |setting| setting.name}` is the singleton method created by the `additional_resource_properties` method via `property_name: 'diagnostic_settings'` at the diagnostic settings fetching stage.
There might be a tendency to chain the after processing to the `additional_resource_properties`, such as:
+
```ruby
def diagnostic_settings_names
return unless exists?
@@ -231,24 +259,32 @@ def diagnostic_settings_names
).map { |setting| setting.name }
end
```
+
However, this is not an advised pattern, because:
+
- Every test using the `azure_key_vault.diagnostic_settings_names` will make a new API call to fetch the diagnostic settings. This might not be the intended action and it will increase the test completion time.
- It will make it difficult to reuse the diagnostic settings in another method, such as `diagnostic_settings_types`, `diagnostic_settings_enabled`.
### Allowed Parameters
-`allowed_parameters` can be used to enable the resource to accept specific parameters beyond the common ones, such as `resource_group`, `name`, and `api_version`.
+
+`allowed_parameters` can be used to enable the resource to accept specific parameters beyond the common ones, such as `resource_group`, `name`, and `api_version`.
API version of the diagnostic settings for the Azure key vault can be defined by the user after adding the following code to the `initialize` method.
+
```ruby
opts[:allowed_parameters] = %i(diagnostic_settings_api_version)
```
+
A default value has to be assigned to prevent using `nil` value.
+
```ruby
opts[:allowed_parameters] = %i(diagnostic_settings_api_version)
# Assign a default value.
opts[:diagnostic_settings_api_version] ||= 'latest'
```
+
At this point the resource should look like:
+
```ruby
require 'azure_generic_resource'
@@ -274,7 +310,7 @@ class AzureKeyVault < AzureGenericResource
opts[:diagnostic_settings_api_version] ||= 'latest'
# static_resource parameter must be true for setting the resource_provider in the backend.
- super(opts, true)
+ super(opts, true)
end
def to_s
@@ -308,8 +344,9 @@ Find the Azure REST API documentation for the resource being developed, [Azure k
- or in a resource group only: `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults?api-version=2019-09-01`
- The dynamic part that has to be created for this resource: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults?api-version=2019-09-01`
- Parameters acquired from environment variables:
- - `{subscriptionId}` => Required parameter. It will be acquired by the backend from environment variables.
-- User supplied parameters:
+
+- `{subscriptionId}` => Required parameter. It will be acquired by the backend from environment variables.
+ - User supplied parameters:
- `resource_group` => Optional parameter. If not provided all key vaults within the subscription will be listed.
- `api_version` => Optional parameter. The latest version will be used unless provided.
- `resource_provider` has to be defined/created with the help of `specific_resource_constraint` method for input validation.
@@ -317,23 +354,26 @@ Find the Azure REST API documentation for the resource being developed, [Azure k
### Plural Resource Creation
-- Create the library file: All of the InSpec resource extensions are located in the `libraries` directory. Copy a similar resource as a starting point.
+- Create the library file: All of the InSpec resource extensions are located in the `libraries` directory. Copy a similar resource as a starting point.
- Change the name to match the resource you are creating.
- i.e. `libraries/azure_key_vaults.rb`
- Rename the class match the resource. The `name` will be used as the resource name in InSpec profiles. It has to be unique.
+
```ruby
class AzureKeyVaults < AzureGenericResource
name 'azure_key_vaults'
```
+
- Update the `desc` and `example`
- Remove any definitions that don't apply to this resource.
- Update the `initialize` method with the following order:
+
```ruby
def initialize(opts = {}) # Accept parameters as key: value pairs.
# Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
+
# Ensure that the resource will talk to the intended Azure Rest API endpoint and validate user input.
opts[:resource_provider] = specific_resource_constraint('Microsoft.KeyVault/vaults', opts)
@@ -343,7 +383,7 @@ def initialize(opts = {}) # Accept parameters as key: value pairs.
# Check if the resource is failed.
# It is recommended to check that after every usage of inherited methods or making an API call.
return if failed_resource?
-
+
# Define the column and field names for FilterTable.
table_schema = [
{ column: :ids, field: :id },
@@ -353,26 +393,31 @@ def initialize(opts = {}) # Accept parameters as key: value pairs.
{ column: :tags, field: :tags },
{ column: :properties, field: :properties },
]
-
+
# FilterTable is populated at the very end due to being an expensive operation.
AzureGenericResources.populate_filter_table(:table, table_schema)
end
```
-- `table_schema`: A list of hashes with standard keys, `column`, and `field`.
- The plural resources utilize the [FilterTable](https://github.com/inspec/inspec/blob/master/dev-docs/filtertable-usage.md) and the `table_schema` list is a template for it.
+
+- `table_schema`: A list of hashes with standard keys, `column`, and `field`.
+ The plural resources utilize the [FilterTable](https://github.com/inspec/inspec/blob/master/dev-docs/filtertable-usage.md) and the `table_schema` list is a template for it.
The columns will become properties of the plural resources which can be filtered by the fields. They are defined by the resource author and usually the plural form of the corresponding field.
The fields must be valid properties of the interrogated cloud resource. For the Azure key vault, they must be chosen from the listed properties in [here](https://docs.microsoft.com/en-us/rest/api/keyvault/vaults/get#vault).
- `azure_key_vaults.names` => A list of all Azure vault names.
- `azure_key_vaults.where { name.include?('production') }` => A subset of Azure key vault resources with the `production` string in their names.
- Populate the FilterTable with `AzureGenericResources.populate_filter_table(:table, table_schema)`. See [here](https://github.com/inspec/inspec/blob/master/dev-docs/filtertable-usage.md) for more on FilterTable.
- Update the `to_s` method.
+
This can be any string relevant to the resource. However, the following is advised for a standard naming convention across the resources.
+
```ruby
def to_s
super(AzureKeyVaults)
end
```
+
At this point, the resource should look like:
+
```ruby
require 'azure_generic_resources'
@@ -380,7 +425,7 @@ class AzureKeyVaults < AzureGenericResources
name 'azure_key_vaults'
desc 'Verifies settings for a collection of Azure Key Vaults'
example <<-EXAMPLE
- describe azurerm_key_vaults(resource_group: 'rg-1') do
+ describe azure_key_vaults(resource_group: 'rg-1') do
it { should exist }
its('names') { should include 'vault-1'}
end
@@ -421,23 +466,30 @@ class AzureKeyVaults < AzureGenericResources
end
end
```
+
### Manipulating Data in FilterTable
+
The `populate_table` must be defined in the resource to override the generic behavior.
Let's assume:
- - We want to create 2 columns, `ids` and `enabled_for_deployment`.
- - List the resource ids in the `ids` column.
- - Return the value of the `enabledForDeployment` status (presented in the `properties` hash) of each Azure key vault. See [here](https://docs.microsoft.com/en-us/rest/api/keyvault/vaults/get#vaultproperties).
+
+- We want to create 2 columns, `ids` and `enabled_for_deployment`.
+ - List the resource ids in the `ids` column.
+ - Return the value of the `enabledForDeployment` status (presented in the `properties` hash) of each Azure key vault. See [here](https://docs.microsoft.com/en-us/rest/api/keyvault/vaults/get#vaultproperties).
Required steps:
- - Create the `table_schema` in the `initialize` method.
+
+- Create the `table_schema` in the `initialize` method.
+
```ruby
table_schema = [
{ column: :ids, field: :id },
{ column: :enabled_for_deployment, field: :enabled_for_deployment },
]
```
- - Create a new method `populate_table`.
+
+- Create a new method `populate_table`.
+
```ruby
def populate_table
# If @resources empty than @table should stay as an empty array as declared in superclass.
@@ -450,20 +502,25 @@ Required steps:
}
end
end
-```
+```
+
This will allow:
+
```ruby
describe azure_key_vaults.where(enabled_for_deployment: false) do
it { should exist }
end
```
+
Background:
+
- `@resources`: Instance variable. A list containing the all resources.
- `return [] if @resources.empty?`: Ensure constructing the resource and passing `should_not exist` test.
-- `@table`: Instance variable. A list of hashes containing the field keys defined in the `table_schema` and their values.
+- `@table`: Instance variable. A list of hashes containing the field keys defined in the `table_schema` and their values.
The keys used in `@table` must be the same in `field` values defined in `table_schema`.
-
+
With the custom `populate_table` method added, the resource should look like:
+
```ruby
require 'azure_generic_resources'
@@ -471,7 +528,7 @@ class AzureKeyVaults < AzureGenericResources
name 'azure_key_vaults'
desc 'Verifies settings for a collection of Azure Key Vaults'
example <<-EXAMPLE
- describe azurerm_key_vaults(resource_group: 'rg-1') do
+ describe azure_key_vaults(resource_group: 'rg-1') do
it { should exist }
its('names') { should include 'vault-1'}
end
@@ -524,10 +581,12 @@ end
## Resources Living in/on Another Resources
### Required Parameters
+
`required_parameters` should be used to make some parameters mandatory at resource creation.
### Resource Path
-`resource_path` should be used to construct the URL path between the resource provider and the actual resource name.
+
+`resource_path` should be used to construct the URL path between the resource provider and the actual resource name.
Let's use these new parameters in an example resource, [`azure_sql_database`](resources/azure_sql_database.md).
@@ -539,12 +598,15 @@ Here is the the API endpoint for the Azure SQL database:
In that scenario, the resource identifiers for the SQL server must be provided by the user.
If we want the test look like this:
+
```ruby
describe azure_sql_database(resource_group: 'rg-1', server_name: 'sql-server-1', database_name: 'customer-db') do
it { should exist }
end
```
+
The `initialize` method should be:
+
```ruby
def initialize(opts = {})
# Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
@@ -559,35 +621,38 @@ def initialize(opts = {})
super(opts, true)
end
```
+
- `opts[:required_parameters]`: Makes `server_name` parameter mandatory.`{serverName}`
-- `opts[:resource_path]`: The URL path, `{serverName}/databases` to the SQL database name from the resource provider, `Microsoft.Sql/servers`.
+- `opts[:resource_path]`: The URL path, `{serverName}/databases` to the SQL database name from the resource provider, `Microsoft.Sql/servers`.
- `opts[:resource_identifiers]`: Makes `database_name` a resource identifier along with the `name` keyword.
## Resources without a Resource Group
### Resource URI
+
Azure REST API URI of a resource. It requires `add_subscription_id` to be set to either `true` or `false`.
Some Azure resources are not tied to a resource group and do not follow the common pattern explained above.
Let's take a look at the [`azure_policy_definiton`](../libraries/azure_policy_definition.rb).
-- The URL endpoint:
+- The URL endpoint:
- for a policy in a subscription: `https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}?api-version=2019-09-01`
- for a built-in policy: `https://management.azure.com/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}?api-version=2019-09-01`
-- The dynamic part that has to be created:
- - for a policy in a subscription: `/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}?api-version=2019-09-01`
- - `{subscriptionId}`: It will be acquired by the backend from environment variables.
- - for a built-in policy: `/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}?api-version=2019-09-01`
+- The dynamic part that has to be created:
+ - for a policy in a subscription: `/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}?api-version=2019-09-01`
+ - `{subscriptionId}`: It will be acquired by the backend from environment variables.
+ - for a built-in policy: `/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}?api-version=2019-09-01`
- The resource URI:
- for a policy in a subscription: `/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/`
- for a built-in policy: `/providers/Microsoft.Authorization/policyDefinitions/`
-
+
The only difference between these resource URIs is the subscription ID. Since it is available in the backend, we only need to inform backend when to add the subscription ID to the resource URI.
-
+
- The policy name should be provided via `name` parameter and it will be validated in the backend.
The `initialize` method should look like:
+
```ruby
def initialize(opts = {})
# Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
@@ -607,25 +672,30 @@ The `initialize` method should look like:
super(opts, true)
end
```
+
- The resource URI is defined with `opts[:resource_uri]`.
- Subscription ID will be added to the resource URI in the backend if the `opts[:add_subscription_id]` is `true`.
- A new parameter, `built_in`, is declared to hide the technical complexity of making a decision whether or not to add the subscription ID in the resource URI.
-
+
## Common Parameters
The following optional parameters can be used both in singular and plural resources:
+
- [`allowed_parameters`](###allowed-parameters)
- [`required_parameters`](###required-parameters)
-- [`display_name`](###display-name)
+- [`display_name`](###display-name)
### Display Name
+
In InSpec tests, the display name is used while presenting the test results.
Unless it is defined in the static resource, a generic one will be created. E.g., `Azure Sql Databases - api_version: 2020-08-01-preview latest {resourceGroup} {serverName}/databases Microsoft.Sql/servers`
It can be partially customised via `display_name` parameter in the `initialize` method as:
+
```ruby
opts[:display_name] = "Databases on #{opts[:server_name]} SQL Server"
```
+
The display name will be: `Azure Sql Databases - api_version: 2020-08-01-preview latest Databases on {serverName} SQL Server`
## Update Terraform Outputs
@@ -647,6 +717,7 @@ The display name will be: `Azure Sql Databases - api_version: 2020-08-01-preview
Azure controls are located in `test/integration/verify/controls/`. Copy two of the files (singular and plural) for a similar resource as a starting point. This is where InSpec tests are defined to ensure the resources that are being developed are working correctly.
Consider the following:
+
- The names should match the corresponding library files (i.e. `azure_key_vault.rb` and `azure_key_vaults.rb`)
- These files are basically broken into two sections, the attributes, and the control.
- At the top attributes are defined for each property that will be tested.
@@ -663,6 +734,7 @@ Consider the following:
- Other `describe` statements as needed.
- Run `rake test:integration` to verify that the check is included and the definition tests appropriately.
- Pry can be used to debug code. Add `require 'pry'; binding.pry` to create a breakpoint. When `rake test` is run, InSpec will stop at the breakpoint so that Pry can be used to debug the code.
+
```ruby
resource_group = input('resource_group', value: nil)
vault_name = input('key_vault_name', value: nil)
@@ -685,10 +757,12 @@ control 'azure_key_vault' do
end
```
+
## Create Documentation
Once everything is working, documentation must be added for the resources that have been added. Copy similar resource documents in `docs/resources/` and edit them as appropriate. Include enough examples to give a good idea of how the resource works. Make sure to include any special case examples that might exist.
After writing the documentation:
+
- Run `bundle exec rake docs:resource_links`
- Copy/Paste all display links in the Readme.md
diff --git a/docs/resources/azure_api_management.md b/docs/resources/azure_api_management.md
index 7286076ca..294f0444f 100644
--- a/docs/resources/azure_api_management.md
+++ b/docs/resources/azure_api_management.md
@@ -80,7 +80,7 @@ azure_api_managements.ids.each do |resource_id|
end
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_api_management.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_api_management.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_application_gateway.md b/docs/resources/azure_application_gateway.md
index 03917700d..4a1a1cd7f 100644
--- a/docs/resources/azure_application_gateway.md
+++ b/docs/resources/azure_application_gateway.md
@@ -77,7 +77,7 @@ describe azure_application_gateway(resource_id: '/subscriptions/{subscriptionId}
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_application_gateway.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_application_gateway.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_hdinsight_cluster.md b/docs/resources/azure_hdinsight_cluster.md
index d744f954a..409e56c6b 100644
--- a/docs/resources/azure_hdinsight_cluster.md
+++ b/docs/resources/azure_hdinsight_cluster.md
@@ -79,7 +79,7 @@ describe azure_hdinsight_cluster(resource_group: 'example', name: 'ClusterName')
its('properties.clusterVersion') { should cmp '4.0' }
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_hdinsight_cluster.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_hdinsight_cluster.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_management_group.md b/docs/resources/azure_management_group.md
index 7083cfc65..88fb73be8 100644
--- a/docs/resources/azure_management_group.md
+++ b/docs/resources/azure_management_group.md
@@ -80,7 +80,7 @@ describe azure_management_group(group_id: 'abc-1234', recurse: true, expand: 'ch
its('children_display_names') { should include('I am a child of the group!') }
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_management_group.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_management_group.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_network_watcher.md b/docs/resources/azure_network_watcher.md
index fd38968c0..a596c987e 100644
--- a/docs/resources/azure_network_watcher.md
+++ b/docs/resources/azure_network_watcher.md
@@ -90,7 +90,7 @@ azure_network_security_groups.where(location: 'eastus').ids.each do |nsg_id|
end
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_network_watcher.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_network_watcher.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_public_ip.md b/docs/resources/azure_public_ip.md
index 1adcd29f6..e50e8981a 100644
--- a/docs/resources/azure_public_ip.md
+++ b/docs/resources/azure_public_ip.md
@@ -73,7 +73,7 @@ describe azure_public_ip(resource_id: '/subscriptions/{subscriptionId}/resourceG
its('properties.ipAddress') { should cmp '51.224.11.75' }
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_public_ip.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_public_ip.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_security_center_policy.md b/docs/resources/azure_security_center_policy.md
index 49f5bbc95..082d7f6c0 100644
--- a/docs/resources/azure_security_center_policy.md
+++ b/docs/resources/azure_security_center_policy.md
@@ -104,7 +104,7 @@ describe azure_security_center_policy(resource_group: 'my-rg', name: 'my_policy'
its('notifications_enabled') { should be true }
end
```
-See [integration tests](../../test/integration/verify/controls/azurerm_security_center_policy.rb) for more examples.
+See [integration tests](../../test/integration/verify/controls/azure_security_center_policy.rb) for more examples.
## Matchers
diff --git a/docs/resources/azure_storage_account_blob_containers.md b/docs/resources/azure_storage_account_blob_containers.md
index e60b85a24..954340664 100644
--- a/docs/resources/azure_storage_account_blob_containers.md
+++ b/docs/resources/azure_storage_account_blob_containers.md
@@ -28,7 +28,7 @@ For an example `inspec.yml` file and how to set up your Azure credentials, refer
The `resource_group`, and `storage_account_name` must be given as a parameter.
```ruby
-describe azurerm_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
+describe azure_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
its('names') { should include 'my-container'}
end
```
@@ -55,7 +55,7 @@ end
### Check If a Specific Container Exists
```ruby
-describe azurerm_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
+describe azure_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
its('names') { should include('my-container') }
end
```
@@ -64,12 +64,12 @@ end
The control will pass if the filter returns at least one result. Use `should_not` if you expect zero matches.
```ruby
# If we expect at least one resource to exists on a specified account
-describe azurerm_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
+describe azure_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
it { should exist }
end
# If we expect not to exist any containers on a specified account
-describe azurerm_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
+describe azure_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'production') do
it { should_not exist }
end
```
diff --git a/libraries/azure_aks_cluster.rb b/libraries/azure_aks_cluster.rb
index 08d80ba21..ec0cd42e7 100644
--- a/libraries/azure_aks_cluster.rb
+++ b/libraries/azure_aks_cluster.rb
@@ -52,25 +52,3 @@ def disabled_logging_types
result
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermAksCluster < AzureAksCluster
- name 'azurerm_aks_cluster'
- desc 'Verifies settings for AKS Clusters'
- example <<-EXAMPLE
- describe azurerm_aks_cluster(resource_group: 'example', name: 'name') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureAksCluster.name)
- # For backward compatibility.
- opts[:api_version] ||= '2018-03-31'
- super
- end
-end
diff --git a/libraries/azure_aks_clusters.rb b/libraries/azure_aks_clusters.rb
index 15767d220..b378e00c0 100644
--- a/libraries/azure_aks_clusters.rb
+++ b/libraries/azure_aks_clusters.rb
@@ -43,25 +43,3 @@ def to_s
super(AzureAksClusters)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermAksClusters < AzureAksClusters
- name 'azurerm_aks_clusters'
- desc 'Verifies settings for AKS Clusters'
- example <<-EXAMPLE
- azurerm_aks_clusters(resource_group: 'example') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureAksClusters.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-03-31'
- super
- end
-end
diff --git a/libraries/azure_api_management.rb b/libraries/azure_api_management.rb
index 0a8a8250c..700df298e 100644
--- a/libraries/azure_api_management.rb
+++ b/libraries/azure_api_management.rb
@@ -25,25 +25,3 @@ def to_s
super(AzureApiManagement)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermApiManagement < AzureApiManagement
- name 'azurerm_api_management'
- desc 'Verifies settings for an Azure Api Management Service'
- example <<-EXAMPLE
- describe azurerm_api_management(resource_group: 'rg-1', api_management_name: 'apim01') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApiManagement.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-12-01'
- super
- end
-end
diff --git a/libraries/azure_api_managements.rb b/libraries/azure_api_managements.rb
index 65afd8eb5..39d07a690 100644
--- a/libraries/azure_api_managements.rb
+++ b/libraries/azure_api_managements.rb
@@ -44,25 +44,3 @@ def to_s
super(AzureApiManagements)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermApiManagements < AzureApiManagements
- name 'azurerm_api_managements'
- desc 'Verifies settings for a collection of Azure Api Management Services'
- example <<-EXAMPLE
- describe azurerm_api_managements do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApiManagements.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-12-01'
- super
- end
-end
diff --git a/libraries/azure_application_gateway.rb b/libraries/azure_application_gateway.rb
index 0ec4fdfab..e9f6dfa2a 100644
--- a/libraries/azure_application_gateway.rb
+++ b/libraries/azure_application_gateway.rb
@@ -24,25 +24,3 @@ def to_s
super(AzureApplicationGateway)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermApplicationGateway < AzureApplicationGateway
- name 'azurerm_application_gateway'
- desc 'Verifies settings for an Azure Application Gateway'
- example <<-EXAMPLE
- describe azurerm_application_gateway(resource_group: 'rg-1', application_gateway_name: 'lb-1') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApplicationGateway.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-12-01'
- super
- end
-end
diff --git a/libraries/azure_application_gateways.rb b/libraries/azure_application_gateways.rb
index a031b7d89..7be5833e5 100644
--- a/libraries/azure_application_gateways.rb
+++ b/libraries/azure_application_gateways.rb
@@ -44,25 +44,3 @@ def to_s
super(AzureApplicationGateways)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermApplicationGateways < AzureApplicationGateways
- name 'azurerm_application_gateways'
- desc 'Verifies settings for a collection of Azure Application Gateways'
- example <<-EXAMPLE
- describe azurerm_application_gateways do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApplicationGateways.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-12-01'
- super
- end
-end
diff --git a/libraries/azure_container_registries.rb b/libraries/azure_container_registries.rb
index 342d76d52..06fdc1a0b 100644
--- a/libraries/azure_container_registries.rb
+++ b/libraries/azure_container_registries.rb
@@ -44,25 +44,3 @@ def to_s
super(AzureContainerRegistries)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermContainerRegistries < AzureContainerRegistries
- name 'azurerm_container_registries'
- desc 'Verifies settings for a collection of Azure Container Registries'
- example <<-EXAMPLE
- describe azurerm_container_registries do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureContainerRegistries.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-05-01'
- super
- end
-end
diff --git a/libraries/azure_container_registry.rb b/libraries/azure_container_registry.rb
index 0de447e48..f547fecbb 100644
--- a/libraries/azure_container_registry.rb
+++ b/libraries/azure_container_registry.rb
@@ -24,25 +24,3 @@ def to_s
super(AzureContainerRegistry)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermContainerRegistry < AzureContainerRegistry
- name 'azurerm_container_registry'
- desc 'Verifies settings for an Azure Container Registry'
- example <<-EXAMPLE
- describe azurerm_container_registry(resource_group: 'rg-1', registry_name: 'lb-1') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureContainerRegistry.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-05-01'
- super
- end
-end
diff --git a/libraries/azure_cosmosdb_database_account.rb b/libraries/azure_cosmosdb_database_account.rb
index 20124e711..0f900198b 100644
--- a/libraries/azure_cosmosdb_database_account.rb
+++ b/libraries/azure_cosmosdb_database_account.rb
@@ -24,25 +24,3 @@ def to_s
super(AzureCosmosDbDatabaseAccount)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermCosmosDbDatabaseAccount < AzureCosmosDbDatabaseAccount
- name 'azurerm_cosmosdb_database_account'
- desc 'Verifies settings for CosmosDb Database Account'
- example <<-EXAMPLE
- describe azurerm_cosmosdb_database_account(resource_group: 'example', cosmosdb_database_account: 'my-cosmos-db-account') do
- its('name') { should eq 'my-cosmos-db-account'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureCosmosDbDatabaseAccount.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2015-04-08'
- super
- end
-end
diff --git a/libraries/azure_event_hub_authorization_rule.rb b/libraries/azure_event_hub_authorization_rule.rb
index 43c2f3fb7..c62f3139a 100644
--- a/libraries/azure_event_hub_authorization_rule.rb
+++ b/libraries/azure_event_hub_authorization_rule.rb
@@ -26,25 +26,3 @@ def to_s
super(AzureEventHubAuthorizationRule)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermEventHubAuthorizationRule < AzureEventHubAuthorizationRule
- name 'azurerm_event_hub_authorization_rule'
- desc 'Verifies settings for Event Hub Authorization Rule'
- example <<-EXAMPLE
- describe azurerm_event_hub_authorization_rule(resource_group: 'example', namespace_name: 'namespace-ns', event_hub_endpoint: 'eventhub', authorization_rule_name: 'auth-rule'") do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureEventHubAuthorizationRule.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-04-01'
- super
- end
-end
diff --git a/libraries/azure_event_hub_event_hub.rb b/libraries/azure_event_hub_event_hub.rb
index 242da4e16..6a58038b8 100644
--- a/libraries/azure_event_hub_event_hub.rb
+++ b/libraries/azure_event_hub_event_hub.rb
@@ -26,25 +26,3 @@ def to_s
super(AzureEventHubEventHub)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermEventHubEventHub < AzureEventHubEventHub
- name 'azurerm_event_hub_event_hub'
- desc 'Verifies settings for Event Hub description'
- example <<-EXAMPLE
- describe azurerm_event_hub_event_hub(resource_group: 'example', namespace_name: 'namespace-ns', event_hub_name: 'eventHubName') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureEventHubEventHub.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-04-01'
- super
- end
-end
diff --git a/libraries/azure_event_hub_namespace.rb b/libraries/azure_event_hub_namespace.rb
index 0e3579453..f05fcf64b 100644
--- a/libraries/azure_event_hub_namespace.rb
+++ b/libraries/azure_event_hub_namespace.rb
@@ -24,25 +24,3 @@ def to_s
super(AzureEventHubNamespace)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermEventHubNamespace < AzureEventHubNamespace
- name 'azurerm_event_hub_namespace'
- desc 'Verifies settings for Event Hub Namespace'
- example <<-EXAMPLE
- describe azurerm_event_hub_namespace(resource_group: 'example', namespace_name: 'namespace-ns') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureEventHubNamespace.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-04-01'
- super
- end
-end
diff --git a/libraries/azure_graph_user.rb b/libraries/azure_graph_user.rb
index c1a777144..fefd4b5f5 100644
--- a/libraries/azure_graph_user.rb
+++ b/libraries/azure_graph_user.rb
@@ -88,20 +88,3 @@ def guest?
end
# Methods for backward compatibility ends here <<<<
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermAdUser < AzureGraphUser
- name 'azurerm_ad_user'
- desc 'Verifies settings for an Azure Active Directory User'
- example <<-EXAMPLE
- describe azurerm_ad_user(user_id: 'userId') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureGraphUser.name)
- super
- end
-end
diff --git a/libraries/azure_graph_users.rb b/libraries/azure_graph_users.rb
index ca36b3337..67a6b1939 100644
--- a/libraries/azure_graph_users.rb
+++ b/libraries/azure_graph_users.rb
@@ -68,27 +68,3 @@ def to_s
super(AzureGraphUsers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermAdUsers < AzureGraphUsers
- name 'azurerm_ad_users'
- desc 'Verifies settings for an Azure Active Directory User'
- example <<-EXAMPLE
- describe azurerm_ad_users do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- if opts[:filter].is_a?(String)
- # This is for backward compatibility.
- # Same feature is supported via `filter_free_text` parameter with the new backend.
- opts[:filter_free_text] = opts[:filter]
- opts.delete(:filter)
- end
-
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureGraphUsers.name)
- super
- end
-end
diff --git a/libraries/azure_hdinsight_cluster.rb b/libraries/azure_hdinsight_cluster.rb
index fbb703e53..cbe1da085 100644
--- a/libraries/azure_hdinsight_cluster.rb
+++ b/libraries/azure_hdinsight_cluster.rb
@@ -23,25 +23,3 @@ def to_s
super(AzureHdinsightCluster)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermHdinsightCluster < AzureHdinsightCluster
- name 'azurerm_hdinsight_cluster'
- desc 'Verifies settings for HDInsight Clusters'
- example <<-EXAMPLE
- describe azurerm_hdinsight_cluster(resource_group: 'example', name: 'name') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureHdinsightCluster.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2015-03-01-preview'
- super
- end
-end
diff --git a/libraries/azure_iothub.rb b/libraries/azure_iothub.rb
index 2d6534ed3..f5d94881f 100644
--- a/libraries/azure_iothub.rb
+++ b/libraries/azure_iothub.rb
@@ -25,25 +25,3 @@ def to_s
super(AzureIotHub)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermIotHub < AzureIotHub
- name 'azurerm_iothub'
- desc 'Verifies settings for Iot Hub'
- example <<-EXAMPLE
- describe azurerm_iothub(resource_group: 'example', resource_name: 'my-iot-hub') do
- its(name) { should eq 'my-iot-hub'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureIotHub.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-04-01'
- super
- end
-end
diff --git a/libraries/azure_iothub_event_hub_consumer_group.rb b/libraries/azure_iothub_event_hub_consumer_group.rb
index e74fa84bd..eee703c93 100644
--- a/libraries/azure_iothub_event_hub_consumer_group.rb
+++ b/libraries/azure_iothub_event_hub_consumer_group.rb
@@ -26,25 +26,3 @@ def to_s
super(AzureIotHubEventHubConsumerGroup)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermIotHubEventHubConsumerGroup < AzureIotHubEventHubConsumerGroup
- name 'azurerm_iothub_event_hub_consumer_group'
- desc 'Verifies settings for Iot Hub Event HUb Consumer Group'
- example <<-EXAMPLE
- describe azurerm_iothub_event_hub_consumer_group(resource_group: 'my-rg', resource_name: 'my-iot-hub', event_hub_endpoint: 'myeventhub', consumer_group: 'my-consumer-group') do
- its(name) { should eq 'my-consumer-group'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureIotHubEventHubConsumerGroup.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-04-01'
- super
- end
-end
diff --git a/libraries/azure_iothub_event_hub_consumer_groups.rb b/libraries/azure_iothub_event_hub_consumer_groups.rb
index f666c7eba..84d436d41 100644
--- a/libraries/azure_iothub_event_hub_consumer_groups.rb
+++ b/libraries/azure_iothub_event_hub_consumer_groups.rb
@@ -47,25 +47,3 @@ def to_s
super(AzureIotHubEventHubConsumerGroups)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermIotHubEventHubConsumerGroups < AzureIotHubEventHubConsumerGroups
- name 'azurerm_iothub_event_hub_consumer_groups'
- desc 'Verifies settings for Iot Hub Event Hub Consumer Groups'
- example <<-EXAMPLE
- describe azurerm_iothub_event_hub_consumer_groups(resource_group: 'my-rg', resource_name: 'my-iot-hub', event_hub_endpoint: 'myeventhub') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureIotHubEventHubConsumerGroups.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-04-01'
- super
- end
-end
diff --git a/libraries/azure_key_vault.rb b/libraries/azure_key_vault.rb
index 514df45d7..7412ddb01 100644
--- a/libraries/azure_key_vault.rb
+++ b/libraries/azure_key_vault.rb
@@ -100,26 +100,3 @@ def diagnostic_settings_logs
result
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermKeyVault < AzureKeyVault
- name 'azurerm_key_vault'
- desc 'Verifies settings and configuration for an Azure Key Vault'
- example <<-EXAMPLE
- describe azurerm_key_vault(resource_group: 'rg-1', vault_name: 'vault-1') do
- it { should exist }
- its('name') { should eq('vault-1') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVault.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-10-01'
- super
- end
-end
diff --git a/libraries/azure_key_vault_key.rb b/libraries/azure_key_vault_key.rb
index d66ea03d7..1f3049bae 100644
--- a/libraries/azure_key_vault_key.rb
+++ b/libraries/azure_key_vault_key.rb
@@ -57,28 +57,3 @@ def valid_version?(version)
version.downcase.scan(VALID_VERSION_REGEX).any?
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermKeyVaultKey < AzureKeyVaultKey
- name 'azurerm_key_vault_key'
- desc 'Verifies configuration for an Azure Key within a Vault'
- example <<-EXAMPLE
- describe azurerm_key_vault_key('vault-101', 'key') do
- it { should exist }
- its('attributes.enabled') { should eq true }
- end
- EXAMPLE
-
- def initialize(vault_name, key_name, key_version = nil)
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVaultKey.name)
- # This is for backward compatibility.
- opts = {
- vault_name: vault_name,
- key_name: key_name,
- api_version: '2016-10-01',
- }
- opts[:key_version] = key_version unless key_version.nil?
- super(opts)
- end
-end
diff --git a/libraries/azure_key_vault_keys.rb b/libraries/azure_key_vault_keys.rb
index 351ef3312..d546f28b4 100644
--- a/libraries/azure_key_vault_keys.rb
+++ b/libraries/azure_key_vault_keys.rb
@@ -67,25 +67,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermKeyVaultKeys < AzureKeyVaultKeys
- name 'azurerm_key_vault_keys'
- desc 'Verifies settings for a collection of Azure Keys belonging to a Vault'
- example <<-EXAMPLE
- describe azurerm_key_vault_keys('vault-101') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(vault_name)
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVaultKeys.name)
- # This is for backward compatibility.
- opts = {
- vault_name: vault_name,
- api_version: '2016-10-01',
- }
- super(opts)
- end
-end
diff --git a/libraries/azure_key_vault_secret.rb b/libraries/azure_key_vault_secret.rb
index 815b174fb..4b6936634 100644
--- a/libraries/azure_key_vault_secret.rb
+++ b/libraries/azure_key_vault_secret.rb
@@ -62,28 +62,3 @@ def valid_version?(version)
version.downcase.scan(VALID_VERSION_REGEX).any?
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermKeyVaultSecret < AzureKeyVaultSecret
- name 'azurerm_key_vault_secret'
- desc 'Verifies configuration for a Secret within a Vault'
- example <<-EXAMPLE
- describe azurerm_key_vault_secret('vault-name', 'secret-name') do
- it { should exist }
- its('attributes.enabled') { should eq true }
- end
- EXAMPLE
-
- def initialize(vault_name, secret_name, secret_version = nil)
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVaultSecret.name)
- # This is for backward compatibility.
- opts = {
- vault_name: vault_name,
- secret_name: secret_name,
- api_version: '2016-10-01',
- }
- opts[:secret_version] = secret_version unless secret_version.nil?
- super(opts)
- end
-end
diff --git a/libraries/azure_key_vault_secrets.rb b/libraries/azure_key_vault_secrets.rb
index 389bceaa0..2b82c257b 100644
--- a/libraries/azure_key_vault_secrets.rb
+++ b/libraries/azure_key_vault_secrets.rb
@@ -69,26 +69,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermKeyVaultSecrets < AzureKeyVaultSecrets
- name 'azurerm_key_vault_secrets'
- desc 'Verifies settings for a collection of Azure Secrets within to a Vault'
- example <<-EXAMPLE
- describe azurerm_key_vault_secrets('vault-101') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(vault_name)
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVaultKeys.name)
- # This is for backward compatibility.
- opts = {
- vault_name: vault_name,
- api_version: '2016-10-01',
- }
- super(opts)
- super
- end
-end
diff --git a/libraries/azure_key_vaults.rb b/libraries/azure_key_vaults.rb
index e0121a96b..5bb7083af 100644
--- a/libraries/azure_key_vaults.rb
+++ b/libraries/azure_key_vaults.rb
@@ -4,7 +4,7 @@ class AzureKeyVaults < AzureGenericResources
name 'azure_key_vaults'
desc 'Verifies settings for a collection of Azure Key Vaults'
example <<-EXAMPLE
- describe azurerm_key_vaults(resource_group: 'rg-1') do
+ describe azure_key_vaults(resource_group: 'rg-1') do
it { should exist }
its('names') { should include 'vault-1'}
end
@@ -73,26 +73,3 @@ def to_s
super(AzureKeyVaults)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermKeyVaults < AzureKeyVaults
- name 'azurerm_key_vaults'
- desc 'Verifies settings for a collection of Azure Key Vaults'
- example <<-EXAMPLE
- describe azurerm_key_vaults(resource_group: 'rg-1') do
- it { should exist }
- its('names') { should include 'vault-1'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVaults.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-10-01'
- super
- end
-end
diff --git a/libraries/azure_load_balancer.rb b/libraries/azure_load_balancer.rb
index cb7ebb8e7..fd9b1a7ef 100644
--- a/libraries/azure_load_balancer.rb
+++ b/libraries/azure_load_balancer.rb
@@ -24,25 +24,3 @@ def to_s
super(AzureLoadBalancer)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermLoadBalancer < AzureLoadBalancer
- name 'azurerm_load_balancer'
- desc 'Verifies settings for an Azure Load Balancer'
- example <<-EXAMPLE
- describe azurerm_load_balancer(resource_group: 'rg-1', loadbalancer_name: 'lb-1') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureLoadBalancer.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-11-01'
- super
- end
-end
diff --git a/libraries/azure_load_balancers.rb b/libraries/azure_load_balancers.rb
index a6b1d1637..35c282cc4 100644
--- a/libraries/azure_load_balancers.rb
+++ b/libraries/azure_load_balancers.rb
@@ -45,25 +45,3 @@ def to_s
super(AzureLoadBalancers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermLoadBalancers < AzureLoadBalancers
- name 'azurerm_load_balancers'
- desc 'Verifies settings for a collection of Azure Load Balancers'
- example <<-EXAMPLE
- describe azurerm_load_balancers do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureLoadBalancers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-11-01'
- super
- end
-end
diff --git a/libraries/azure_locks.rb b/libraries/azure_locks.rb
index 1e8028194..b88334624 100644
--- a/libraries/azure_locks.rb
+++ b/libraries/azure_locks.rb
@@ -65,25 +65,3 @@ def to_s
super(AzureLocks)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermLocks < AzureLocks
- name 'azurerm_locks'
- desc 'Verifies settings for an Azure Lock on a Resource'
- example <<-EXAMPLE
- describe azurerm_locks(resource_group: 'my-rg', resource_name: 'my-vm', resource_type: 'Microsoft.Compute/virtualMachines') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureLocks.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-09-01'
- super
- end
-end
diff --git a/libraries/azure_management_group.rb b/libraries/azure_management_group.rb
index 2bcb3872f..50825f47d 100644
--- a/libraries/azure_management_group.rb
+++ b/libraries/azure_management_group.rb
@@ -108,25 +108,3 @@ def children_types
Array(children).map(&:type)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermManagementGroup < AzureManagementGroup
- name 'azurerm_management_group'
- desc 'Verifies settings for an Azure Management Group'
- example <<-EXAMPLE
- describe azurerm_management_group(group_id: 'example-group') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureManagementGroup.name)
- # For backward compatibility.
- opts[:api_version] ||= '2018-03-01-preview'
- super
- end
-end
diff --git a/libraries/azure_management_groups.rb b/libraries/azure_management_groups.rb
index 1d4b983b2..619a80b22 100644
--- a/libraries/azure_management_groups.rb
+++ b/libraries/azure_management_groups.rb
@@ -62,25 +62,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermManagementGroups < AzureManagementGroups
- name 'azurerm_management_groups'
- desc 'Verifies settings for an Azure Management Groups'
- example <<-EXAMPLE
- describe azurerm_management_groups do
- its('names') { should include 'example-group' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureManagementGroups.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-03-01-preview'
- super
- end
-end
diff --git a/libraries/azure_mariadb_server.rb b/libraries/azure_mariadb_server.rb
index 21b0258f6..739b4e22f 100644
--- a/libraries/azure_mariadb_server.rb
+++ b/libraries/azure_mariadb_server.rb
@@ -45,25 +45,3 @@ def firewall_rules
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMariaDBServer < AzureMariaDBServer
- name 'azurerm_mariadb_server'
- desc 'Verifies settings for an Azure MariaDB Server'
- example <<-EXAMPLE
- describe azurerm_mariadb_server(resource_group: 'rg-1', server_name: 'my-server-name') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMariaDBServer.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-06-01-preview'
- super
- end
-end
diff --git a/libraries/azure_mariadb_servers.rb b/libraries/azure_mariadb_servers.rb
index b96479fd1..69efa0049 100644
--- a/libraries/azure_mariadb_servers.rb
+++ b/libraries/azure_mariadb_servers.rb
@@ -45,25 +45,3 @@ def to_s
super(AzureMariaDBServers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMariaDBServers < AzureMariaDBServers
- name 'azurerm_mariadb_servers'
- desc 'Verifies settings for a collection of Azure MariaDB Servers'
- example <<-EXAMPLE
- describe azurerm_mariadb_servers do
- its('names') { should include 'mariadb-server' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMariaDBServers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-06-01-preview'
- super
- end
-end
diff --git a/libraries/azure_monitor_activity_log_alert.rb b/libraries/azure_monitor_activity_log_alert.rb
index 6bd447167..e1a57dd95 100644
--- a/libraries/azure_monitor_activity_log_alert.rb
+++ b/libraries/azure_monitor_activity_log_alert.rb
@@ -45,26 +45,3 @@ def to_s
super(AzureMonitorActivityLogAlert)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMonitorActivityLogAlert < AzureMonitorActivityLogAlert
- name 'azurerm_monitor_activity_log_alert'
- desc 'Verifies settings for a Azure Monitor Activity Log Alert'
- example <<-EXAMPLE
- describe azurerm_monitor_activity_log_alert(resource_group: 'example', name: 'AlertName') do
- it { should exist }
- its('operations') { should include 'Microsoft.Authorization/policyAssignments/write' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorActivityLogAlert.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-04-01'
- super
- end
-end
diff --git a/libraries/azure_monitor_activity_log_alerts.rb b/libraries/azure_monitor_activity_log_alerts.rb
index 2c52372d6..93cd57e83 100644
--- a/libraries/azure_monitor_activity_log_alerts.rb
+++ b/libraries/azure_monitor_activity_log_alerts.rb
@@ -65,25 +65,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMonitorActivityLogAlerts < AzureMonitorActivityLogAlerts
- name 'azurerm_monitor_activity_log_alerts'
- desc 'Verifies settings for Azure Monitor Activity Log Alerts'
- example <<-EXAMPLE
- describe azurerm_monitor_activity_log_alerts do
- its('names') { should include('example-log-alert') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorActivityLogAlerts.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-04-01'
- super
- end
-end
diff --git a/libraries/azure_monitor_log_profile.rb b/libraries/azure_monitor_log_profile.rb
index 700fbd96d..ae930aa03 100644
--- a/libraries/azure_monitor_log_profile.rb
+++ b/libraries/azure_monitor_log_profile.rb
@@ -56,27 +56,3 @@ def storage_account
{ name: sa.split('/').last, resource_group: resource_group }
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMonitorLogProfile < AzureMonitorLogProfile
- name 'azurerm_monitor_log_profile'
- desc 'Verifies settings for a Azure Monitor Log Profile'
- example <<-EXAMPLE
- describe azurerm_monitor_log_profile(name: 'default') do
- it { should exist }
- its('retention_enabled') { should be true }
- its('retention_days') { should eq(365) }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorLogProfile.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-03-01'
- super
- end
-end
diff --git a/libraries/azure_monitor_log_profiles.rb b/libraries/azure_monitor_log_profiles.rb
index 035d405f0..23452f00a 100644
--- a/libraries/azure_monitor_log_profiles.rb
+++ b/libraries/azure_monitor_log_profiles.rb
@@ -43,25 +43,3 @@ def to_s
super(AzureMonitorLogProfiles)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMonitorLogProfiles < AzureMonitorLogProfiles
- name 'azurerm_monitor_log_profiles'
- desc 'Fetches all Azure Monitor Log Profiles'
- example <<-EXAMPLE
- describe azurerm_monitor_log_profiles do
- its('names') { should include('default') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorLogProfiles.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-03-01'
- super
- end
-end
diff --git a/libraries/azure_mysql_database.rb b/libraries/azure_mysql_database.rb
index 8842805c0..6a4c1d145 100644
--- a/libraries/azure_mysql_database.rb
+++ b/libraries/azure_mysql_database.rb
@@ -26,25 +26,3 @@ def to_s
super(AzureMySqlDatabase)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMySqlDatabase < AzureMySqlDatabase
- name 'azurerm_mysql_database'
- desc 'Verifies settings for an Azure MySQL Database'
- example <<-EXAMPLE
- describe azurerm_mysql_database(resource_group: 'rg-1', server_name: 'mysql-server-1' database_name: 'customer-db') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMySqlDatabase.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_mysql_databases.rb b/libraries/azure_mysql_databases.rb
index 87c68a3d3..f6612c776 100644
--- a/libraries/azure_mysql_databases.rb
+++ b/libraries/azure_mysql_databases.rb
@@ -48,26 +48,3 @@ def to_s
super(AzureMySqlDatabases)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMySqlDatabases < AzureMySqlDatabases
- name 'azurerm_mysql_databases'
- desc 'Verifies settings for a collection of Azure MySQL Databases on a MySQL Server'
- example <<-EXAMPLE
- describe azurerm_mysql_databases(resource_group: 'my-rg', server_name: 'server-1') do
- it { should exist }
- its('names') { should_not be_empty }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMySqlDatabases.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_mysql_server.rb b/libraries/azure_mysql_server.rb
index f5ddae4d7..d389a8b8d 100644
--- a/libraries/azure_mysql_server.rb
+++ b/libraries/azure_mysql_server.rb
@@ -4,7 +4,7 @@ class AzureMysqlServer < AzureGenericResource
name 'azure_mysql_server'
desc 'Verifies settings for an Azure My SQL Server'
example <<-EXAMPLE
- describe azurerm_mysql_server(resource_group: 'example', server_name: 'vm-name') do
+ describe azure_mysql_server(resource_group: 'example', server_name: 'vm-name') do
it { should have_monitoring_agent_installed }
end
EXAMPLE
@@ -79,25 +79,3 @@ def firewall_rules
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMysqlServer < AzureMysqlServer
- name 'azurerm_mysql_server'
- desc 'Verifies settings for an Azure My SQL Server'
- example <<-EXAMPLE
- describe azurerm_mysql_server(resource_group: 'example', server_name: 'vm-name') do
- it { should have_monitoring_agent_installed }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMysqlServer.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_mysql_servers.rb b/libraries/azure_mysql_servers.rb
index 2e37225f1..d9c10e7e6 100644
--- a/libraries/azure_mysql_servers.rb
+++ b/libraries/azure_mysql_servers.rb
@@ -4,7 +4,7 @@ class AzureMysqlServers < AzureGenericResources
name 'azure_mysql_servers'
desc 'Verifies settings for a collection of Azure MySQL Servers'
example <<-EXAMPLE
- describe azurerm_mysql_servers do
+ describe azure_mysql_servers do
its('names') { should include 'my-sql-server' }
end
EXAMPLE
@@ -73,25 +73,3 @@ def to_s
super(AzureMysqlServers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermMysqlServers < AzureMysqlServers
- name 'azurerm_mysql_servers'
- desc 'Verifies settings for a collection of Azure MySQL Servers'
- example <<-EXAMPLE
- describe azurerm_mysql_servers do
- its('names') { should include 'my-sql-server' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMysqlServers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_network_interface.rb b/libraries/azure_network_interface.rb
index 19d56c44c..8f0b310cf 100644
--- a/libraries/azure_network_interface.rb
+++ b/libraries/azure_network_interface.rb
@@ -65,25 +65,3 @@ def to_s
super(AzureNetworkInterface)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermNetworkInterface < AzureNetworkInterface
- name 'azurerm_network_interface'
- desc 'Verifies settings for an Azure Network Interface'
- example <<-EXAMPLE
- describe azurerm_network_interface(resource_group: 'rg-1', name: 'my-nic-name') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkInterface.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-11-01'
- super
- end
-end
diff --git a/libraries/azure_network_interfaces.rb b/libraries/azure_network_interfaces.rb
index e86e79c85..b21727627 100644
--- a/libraries/azure_network_interfaces.rb
+++ b/libraries/azure_network_interfaces.rb
@@ -44,25 +44,3 @@ def to_s
super(AzureNetworkInterfaces)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermNetworkInterfaces < AzureNetworkInterfaces
- name 'azurerm_network_interfaces'
- desc 'Verifies settings for a collection of Azure Network Interfaces'
- example <<-EXAMPLE
- describe azurerm_network_interfaces do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkInterfaces.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-11-01'
- super
- end
-end
diff --git a/libraries/azure_network_security_group.rb b/libraries/azure_network_security_group.rb
index d0c5b898a..cc2f8fa07 100644
--- a/libraries/azure_network_security_group.rb
+++ b/libraries/azure_network_security_group.rb
@@ -213,25 +213,3 @@ def not_icmp?(properties)
# Code for backward compatibility ends here <<<<<<<<
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermNetworkSecurityGroup < AzureNetworkSecurityGroup
- name 'azurerm_network_security_group'
- desc 'Verifies settings for Network Security Groups'
- example <<-EXAMPLE
- describe azurerm_network_security_group(resource_group: 'example', name: 'name') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkSecurityGroup.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_network_security_groups.rb b/libraries/azure_network_security_groups.rb
index 58e1c169c..7621bab82 100644
--- a/libraries/azure_network_security_groups.rb
+++ b/libraries/azure_network_security_groups.rb
@@ -71,25 +71,3 @@ def to_s
super(AzureNetworkSecurityGroups)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermNetworkSecurityGroups < AzureNetworkSecurityGroups
- name 'azurerm_network_security_groups'
- desc 'Verifies settings for Network Security Groups'
- example <<-EXAMPLE
- azurerm_network_security_groups(resource_group: 'example') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkSecurityGroups.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_network_watcher.rb b/libraries/azure_network_watcher.rb
index cee71bda9..e74c561fd 100644
--- a/libraries/azure_network_watcher.rb
+++ b/libraries/azure_network_watcher.rb
@@ -82,26 +82,3 @@ def flow_logs
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermNetworkWatcher < AzureNetworkWatcher
- name 'azurerm_network_watcher'
- desc 'Verifies settings for Network Watchers'
- example <<-EXAMPLE
- describe azurerm_network_watcher(resource_group: 'example', name: 'name') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkWatcher.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- opts[:flow_logs_api_version] ||= '2019-04-01'
- super
- end
-end
diff --git a/libraries/azure_network_watchers.rb b/libraries/azure_network_watchers.rb
index 5eada464d..ca9d4010c 100644
--- a/libraries/azure_network_watchers.rb
+++ b/libraries/azure_network_watchers.rb
@@ -43,25 +43,3 @@ def to_s
super(AzureNetworkWatchers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermNetworkWatchers < AzureNetworkWatchers
- name 'azurerm_network_watchers'
- desc 'Verifies settings for Network Watchers'
- example <<-EXAMPLE
- azurerm_network_watchers(resource_group: 'example') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkWatchers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_postgresql_database.rb b/libraries/azure_postgresql_database.rb
index 71837585a..3039ba39b 100644
--- a/libraries/azure_postgresql_database.rb
+++ b/libraries/azure_postgresql_database.rb
@@ -26,25 +26,3 @@ def to_s
super(AzurePostgreSQLDatabase)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermPostgreSQLDatabase < AzurePostgreSQLDatabase
- name 'azurerm_postgresql_database'
- desc 'Verifies settings for an Azure PostgreSQL Database'
- example <<-EXAMPLE
- describe azurerm_postgresql_database(resource_group: 'rg-1', server_name: 'psql-server-1' database_name: 'customer-db') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLDatabase.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_postgresql_databases.rb b/libraries/azure_postgresql_databases.rb
index aed0119f4..69d2129fa 100644
--- a/libraries/azure_postgresql_databases.rb
+++ b/libraries/azure_postgresql_databases.rb
@@ -48,26 +48,3 @@ def to_s
super(AzurePostgreSQLDatabases)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermPostgreSQLDatabases < AzurePostgreSQLDatabases
- name 'azurerm_postgresql_databases'
- desc 'Verifies settings for a collection of Azure PostgreSQL Databases on a PostgreSQL Server'
- example <<-EXAMPLE
- describe azurerm_postgresql_databases(resource_group: 'my-rg', server_name: 'server-1') do
- it { should exist }
- its('names') { should_not be_empty }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLDatabases.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_postgresql_server.rb b/libraries/azure_postgresql_server.rb
index 65a4465b4..7d721ae5a 100644
--- a/libraries/azure_postgresql_server.rb
+++ b/libraries/azure_postgresql_server.rb
@@ -49,26 +49,3 @@ def collect_configurations
create_resource_methods({ configurations: confs })
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermPostgreSQLServer < AzurePostgreSQLServer
- name 'azurerm_postgresql_server'
- desc 'Verifies settings for an Azure PostgreSQL Server'
- example <<-EXAMPLE
- describe azurerm_postgresql_server(resource_group: 'rg-1', server_name: 'psql-srv') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLServer.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # This is for backward compatibility
- opts[:api_version] ||= '2017-12-01'
- opts[:configurations_api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_postgresql_servers.rb b/libraries/azure_postgresql_servers.rb
index f89e64f25..68c28cfe1 100644
--- a/libraries/azure_postgresql_servers.rb
+++ b/libraries/azure_postgresql_servers.rb
@@ -45,25 +45,3 @@ def to_s
super(AzurePostgreSQLServers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermPostgreSQLServers < AzurePostgreSQLServers
- name 'azurerm_postgresql_servers'
- desc 'Verifies settings for a collection of Azure PostgreSQL Servers'
- example <<-EXAMPLE
- describe azurerm_postgresql_servers do
- its('names') { should include 'my-sql-server' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLServers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_public_ip.rb b/libraries/azure_public_ip.rb
index c5573ece3..39c0c0c83 100644
--- a/libraries/azure_public_ip.rb
+++ b/libraries/azure_public_ip.rb
@@ -23,25 +23,3 @@ def to_s
super(AzurePublicIp)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermPublicIp < AzurePublicIp
- name 'azurerm_public_ip'
- desc 'Verifies settings for public IP address'
- example <<-EXAMPLE
- describe azurerm_public_ip(resource_group: 'example', name: 'name') do
- its(name) { should eq 'name'}
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePublicIp.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2020-05-01'
- super
- end
-end
diff --git a/libraries/azure_resource_groups.rb b/libraries/azure_resource_groups.rb
index 14481fb76..528470b99 100644
--- a/libraries/azure_resource_groups.rb
+++ b/libraries/azure_resource_groups.rb
@@ -60,25 +60,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermResourceGroups < AzureResourceGroups
- name 'azurerm_resource_groups'
- desc 'Fetches all available resource groups'
- example <<-EXAMPLE
- describe azurerm_resource_groups do
- its('names') { should include('example-group') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureResourceGroups.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_role_definition.rb b/libraries/azure_role_definition.rb
index 5944caafe..d96e6e122 100644
--- a/libraries/azure_role_definition.rb
+++ b/libraries/azure_role_definition.rb
@@ -39,27 +39,3 @@ def to_s
super(AzureRoleDefinition)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermRoleDefinition < AzureRoleDefinition
- name 'azurerm_role_definition'
- desc 'Verifies settings for an Azure Role'
- example <<-EXAMPLE
- describe azurerm_role_definition(name: 'Mail-Account') do
- it { should exist }
- its ('role_name') { should be 'Mail-Account' }
- its ('role_type') { should be 'CustomRole' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureRoleDefinition.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2015-07-01'
- super
- end
-end
diff --git a/libraries/azure_role_definitions.rb b/libraries/azure_role_definitions.rb
index 17da7f63c..acdff75c1 100644
--- a/libraries/azure_role_definitions.rb
+++ b/libraries/azure_role_definitions.rb
@@ -64,25 +64,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermRoleDefinitions < AzureRoleDefinitions
- name 'azurerm_role_definitions'
- desc 'Verifies settings for a collection of Azure Roles'
- example <<-EXAMPLE
- describe azurerm_role_definitions do
- its('names') { should include('role') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureRoleDefinitions.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2015-07-01'
- super
- end
-end
diff --git a/libraries/azure_security_center_policies.rb b/libraries/azure_security_center_policies.rb
index 385c3b55d..c4987fbc3 100644
--- a/libraries/azure_security_center_policies.rb
+++ b/libraries/azure_security_center_policies.rb
@@ -37,25 +37,3 @@ def to_s
super(AzureSecurityCenterPolicies)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSecurityCenterPolicies < AzureSecurityCenterPolicies
- name 'azurerm_security_center_policies'
- desc 'Verifies settings for Security Center'
- example <<-EXAMPLE
- describe azurerm_security_center_policies do
- its('policy_names') { should include('default') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSecurityCenterPolicies.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2015-06-01-Preview'
- super
- end
-end
diff --git a/libraries/azure_security_center_policy.rb b/libraries/azure_security_center_policy.rb
index 79129cbf3..01d46f669 100644
--- a/libraries/azure_security_center_policy.rb
+++ b/libraries/azure_security_center_policy.rb
@@ -109,27 +109,3 @@ def auto_provisioning_settings
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSecurityCenterPolicy < AzureSecurityCenterPolicy
- name 'azurerm_security_center_policy'
- desc 'Verifies settings for Security Center'
- example <<-EXAMPLE
- describe azurerm_security_center_policy(name: 'default') do
- its('log_collection') { should eq('On') }
- end
- EXAMPLE
-
- def initialize(opts = { name: 'default' })
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSecurityCenterPolicy.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2015-06-01-Preview'
- opts[:default_policy_api_version] ||= '2018-05-01'
- opts[:auto_provisioning_settings_api_version] ||= '2017-08-01-preview'
- super
- end
-end
diff --git a/libraries/azure_sql_database.rb b/libraries/azure_sql_database.rb
index 6b9c5d8c5..3a379806e 100644
--- a/libraries/azure_sql_database.rb
+++ b/libraries/azure_sql_database.rb
@@ -71,28 +71,3 @@ def encryption_settings
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSqlDatabase < AzureSqlDatabase
- name 'azurerm_sql_database'
- desc 'Verifies settings for an Azure SQL Database'
- example <<-EXAMPLE
- describe azurerm_sql_database(resource_group: 'rg-1', server_name: 'sql-server-1' database_name: 'customer-db') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlDatabase.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-10-01-preview'
- opts[:auditing_settings_api_version] ||= '2017-03-01-preview'
- opts[:threat_detection_settings_api_version] ||= '2014-04-01'
- opts[:encryption_settings_api_version] ||= '2014-04-01'
- super
- end
-end
diff --git a/libraries/azure_sql_databases.rb b/libraries/azure_sql_databases.rb
index abde63a2f..5da8b1edc 100644
--- a/libraries/azure_sql_databases.rb
+++ b/libraries/azure_sql_databases.rb
@@ -49,26 +49,3 @@ def to_s
super(AzureSqlDatabases)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSqlDatabases < AzureSqlDatabases
- name 'azurerm_sql_databases'
- desc 'Verifies settings for a collection of Azure SQL Databases on a SQL Server'
- example <<-EXAMPLE
- describe azurerm_sql_databases(resource_group: 'my-rg', server_name: 'server-1') do
- it { should exist }
- its('names') { should_not be_empty }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlDatabases.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-10-01-preview'
- super
- end
-end
diff --git a/libraries/azure_sql_server.rb b/libraries/azure_sql_server.rb
index d29928aa8..2783c9f43 100644
--- a/libraries/azure_sql_server.rb
+++ b/libraries/azure_sql_server.rb
@@ -92,30 +92,3 @@ def encryption_protector
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSqlServer < AzureSqlServer
- name 'azurerm_sql_server'
- desc 'Verifies settings for an Azure SQL Server'
- example <<-EXAMPLE
- describe azurerm_sql_server(resource_group: 'rg-1', server_name: 'my-server-name') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlServer.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-06-01-preview'
- opts[:firewall_rules_api_version] ||= '2014-04-01'
- opts[:auditing_settings_api_version] ||= '2017-03-01-preview'
- opts[:threat_detection_settings_api_version] ||= '2017-03-01-preview'
- opts[:administrators_api_version] ||= '2014-04-01'
- opts[:encryption_protector_api_version] ||= '2015-05-01-preview'
- super
- end
-end
diff --git a/libraries/azure_sql_servers.rb b/libraries/azure_sql_servers.rb
index b380a8490..68fe51d8f 100644
--- a/libraries/azure_sql_servers.rb
+++ b/libraries/azure_sql_servers.rb
@@ -46,25 +46,3 @@ def to_s
super(AzureSqlServers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSqlServers < AzureSqlServers
- name 'azurerm_sql_servers'
- desc 'Verifies settings for a collection of Azure SQL Servers'
- example <<-EXAMPLE
- describe azurerm_sql_servers do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlServers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-06-01-preview'
- super
- end
-end
diff --git a/libraries/azure_storage_account.rb b/libraries/azure_storage_account.rb
index f2bc7ac67..6bc57a842 100644
--- a/libraries/azure_storage_account.rb
+++ b/libraries/azure_storage_account.rb
@@ -167,25 +167,3 @@ def to_utc(datetime)
datetime.to_time.utc.iso8601
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermStorageAccount < AzureStorageAccount
- name 'azurerm_storage_account'
- desc 'Verifies settings for a Azure Storage Account'
- example <<-EXAMPLE
- describe azurerm_storage_account(resource_group: resource_name, name: 'default') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccount.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-06-01'
- super
- end
-end
diff --git a/libraries/azure_storage_account_blob_container.rb b/libraries/azure_storage_account_blob_container.rb
index 51c114e8b..d6b186736 100644
--- a/libraries/azure_storage_account_blob_container.rb
+++ b/libraries/azure_storage_account_blob_container.rb
@@ -29,28 +29,3 @@ def to_s
super(AzureStorageAccountBlobContainer)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermStorageAccountBlobContainer < AzureStorageAccountBlobContainer
- name 'azurerm_storage_account_blob_container'
- desc 'Verifies settings for a Azure Storage Account Blob Container'
- example <<-EXAMPLE
- describe azurerm_storage_account_blob_container(resource_group: 'rg',
- storage_account_name: 'default',
- blob_container_name: 'logs') do
- it { should exist }
- its('name') { should eq('logs') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccountBlobContainer.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-07-01'
- super
- end
-end
diff --git a/libraries/azure_storage_account_blob_containers.rb b/libraries/azure_storage_account_blob_containers.rb
index a4a3c2dc8..8acf97ec5 100644
--- a/libraries/azure_storage_account_blob_containers.rb
+++ b/libraries/azure_storage_account_blob_containers.rb
@@ -45,25 +45,3 @@ def to_s
super(AzureStorageAccountBlobContainers)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class StorageAccountBlobContainers < AzureStorageAccountBlobContainers
- name 'azurerm_storage_account_blob_containers'
- desc 'Fetches all Blob Containers for an Azure Storage Account'
- example <<-EXAMPLE
- describe azurerm_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'sa') do
- its('names') { should include('my_blob_container') }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccountBlobContainers.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-07-01'
- super
- end
-end
diff --git a/libraries/azure_storage_accounts.rb b/libraries/azure_storage_accounts.rb
index bc682d24c..4f48fdf31 100644
--- a/libraries/azure_storage_accounts.rb
+++ b/libraries/azure_storage_accounts.rb
@@ -43,25 +43,3 @@ def to_s
super(AzureStorageAccounts)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermStorageAccounts < AzureStorageAccounts
- name 'azurerm_storage_accounts'
- desc 'Verifies settings for a collection of Azure Storage Accounts'
- example <<-EXAMPLE
- describe azurerm_storage_accounts do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccounts.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-06-01'
- super
- end
-end
diff --git a/libraries/azure_subnet.rb b/libraries/azure_subnet.rb
index 129adcb62..8ba80620d 100644
--- a/libraries/azure_subnet.rb
+++ b/libraries/azure_subnet.rb
@@ -76,26 +76,3 @@ def nsg
properties.networkSecurityGroup.id.split('/').last
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSubnet < AzureSubnet
- name 'azurerm_subnet'
- desc 'Verifies settings for an Azure Virtual Network Subnet'
- example <<-EXAMPLE
- describe azurerm_subnet(resource_group: 'example',vnet: 'virtual-network-name' name: 'subnet-name') do
- it { should exist }
- its('name') { should eq 'subnet-name' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSubnet.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_subnets.rb b/libraries/azure_subnets.rb
index 3dab4db3b..08170ea0e 100644
--- a/libraries/azure_subnets.rb
+++ b/libraries/azure_subnets.rb
@@ -75,25 +75,3 @@ def to_s
super(AzureSubnets)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSubnets < AzureSubnets
- name 'azurerm_subnets'
- desc 'Verifies settings for Azure Virtual Network Subnets'
- example <<-EXAMPLE
- azurerm_subnets(resource_group: 'example', vnet: 'virtual-network-name') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSubnets.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_subscription.rb b/libraries/azure_subscription.rb
index 92337d45c..51080f357 100644
--- a/libraries/azure_subscription.rb
+++ b/libraries/azure_subscription.rb
@@ -145,27 +145,3 @@ def fetch_locations
)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermSubscription < AzureSubscription
- name 'azurerm_subscription'
- desc 'Verifies settings for the current Azure Subscription'
- example <<-EXAMPLE
- describe azurerm_subscription do
- its('name') { should eq 'subscription-name' }
- its('locations') { should include 'eastus' }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSubscription.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2019-10-01'
- opts[:locations_api_version] ||= '2019-10-01'
- super
- end
-end
diff --git a/libraries/azure_virtual_machine.rb b/libraries/azure_virtual_machine.rb
index f87cc1f92..8e3679747 100644
--- a/libraries/azure_virtual_machine.rb
+++ b/libraries/azure_virtual_machine.rb
@@ -98,25 +98,3 @@ def has_monitoring_agent_installed?
resources.size == 1
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermVirtualMachine < AzureVirtualMachine
- name 'azurerm_virtual_machine'
- desc 'Verifies settings for an Azure Virtual Machine'
- example <<-EXAMPLE
- describe azurerm_virtual_machine(resource_group: 'example', name: 'vm-name') do
- it { should have_monitoring_agent_installed }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachine.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_virtual_machine_disk.rb b/libraries/azure_virtual_machine_disk.rb
index cefed1135..5153e997b 100644
--- a/libraries/azure_virtual_machine_disk.rb
+++ b/libraries/azure_virtual_machine_disk.rb
@@ -41,25 +41,3 @@ def to_s
super(AzureVirtualMachineDisk)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermVirtualMachineDisk < AzureVirtualMachineDisk
- name 'azurerm_virtual_machine_disk'
- desc 'Verifies settings for Azure Virtual Machine Disks'
- example <<-EXAMPLE
- describe azurerm_virtual_machine_disk(resource_group: 'example', name: 'disk-name') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachineDisk.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-03-30'
- super
- end
-end
diff --git a/libraries/azure_virtual_machine_disks.rb b/libraries/azure_virtual_machine_disks.rb
index 1361ff043..2d49ace08 100644
--- a/libraries/azure_virtual_machine_disks.rb
+++ b/libraries/azure_virtual_machine_disks.rb
@@ -72,25 +72,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermVirtualMachineDisks < AzureVirtualMachineDisks
- name 'azurerm_virtual_machine_disks'
- desc 'Verifies settings for a collection of Azure VM Disks'
- example <<-EXAMPLE
- describe azurerm_virtual_machine_disks do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachineDisks.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-03-30'
- super
- end
-end
diff --git a/libraries/azure_virtual_machines.rb b/libraries/azure_virtual_machines.rb
index 9a27b784d..828beab7e 100644
--- a/libraries/azure_virtual_machines.rb
+++ b/libraries/azure_virtual_machines.rb
@@ -105,25 +105,3 @@ def populate_table
end
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermVirtualMachines < AzureVirtualMachines
- name 'azurerm_virtual_machines'
- desc 'Verifies settings for Azure Virtual Machines'
- example <<-EXAMPLE
- azurerm_virtual_machines(resource_group: 'example') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachines.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2017-12-01'
- super
- end
-end
diff --git a/libraries/azure_virtual_network.rb b/libraries/azure_virtual_network.rb
index c33092a86..3a0ea0e8a 100644
--- a/libraries/azure_virtual_network.rb
+++ b/libraries/azure_virtual_network.rb
@@ -94,25 +94,3 @@ def subnets
subs.collect(&:name)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermVirtualNetwork < AzureVirtualNetwork
- name 'azurerm_virtual_network'
- desc 'Verifies settings for an Azure Virtual Network'
- example <<-EXAMPLE
- describe azurerm_virtual_network(resource_group: 'example', name: 'vnet-name') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualNetwork.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_virtual_networks.rb b/libraries/azure_virtual_networks.rb
index 84be52c21..d66ff1619 100644
--- a/libraries/azure_virtual_networks.rb
+++ b/libraries/azure_virtual_networks.rb
@@ -71,25 +71,3 @@ def to_s
super(AzureVirtualNetworks)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermVirtualNetworks < AzureVirtualNetworks
- name 'azurerm_virtual_networks'
- desc 'Verifies settings for Azure Virtual Networks'
- example <<-EXAMPLE
- azurerm_virtual_networks(resource_group: 'example') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualNetworks.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_webapp.rb b/libraries/azure_webapp.rb
index c495d0723..a4bf5c0bc 100644
--- a/libraries/azure_webapp.rb
+++ b/libraries/azure_webapp.rb
@@ -105,28 +105,3 @@ def latest(stack)
latest_supported
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermWebapp < AzureWebapp
- name 'azurerm_webapp'
- desc 'Verifies the settings for Azure Webapps'
- example <<-EXAMPLE
- describe azurerm_webapp(resource_group: 'example', name: 'webapp-name') do
- it { should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureWebapp.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-08-01'
- opts[:auth_settings_api_version] ||= '2016-08-01'
- opts[:configuration_api_version] ||= '2016-08-01'
- opts[:supported_stacks_api_version] ||= '2018-02-01'
- super
- end
-end
diff --git a/libraries/azure_webapps.rb b/libraries/azure_webapps.rb
index d799a081f..96c88d452 100644
--- a/libraries/azure_webapps.rb
+++ b/libraries/azure_webapps.rb
@@ -41,25 +41,3 @@ def to_s
super(AzureWebapps)
end
end
-
-# Provide the same functionality under the old resource name.
-# This is for backward compatibility.
-class AzurermWebapps < AzureWebapps
- name 'azurerm_webapps'
- desc 'Verifies settings for Webapps'
- example <<-EXAMPLE
- azurerm_webapps(resource_group: 'example') do
- it{ should exist }
- end
- EXAMPLE
-
- def initialize(opts = {})
- Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureWebapps.name)
- # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys.
- raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash)
-
- # For backward compatibility.
- opts[:api_version] ||= '2016-08-01'
- super
- end
-end
diff --git a/test/integration/verify/controls/azurerm_aks_cluster.rb b/test/integration/verify/controls/azure_aks_cluster.rb
similarity index 82%
rename from test/integration/verify/controls/azurerm_aks_cluster.rb
rename to test/integration/verify/controls/azure_aks_cluster.rb
index 57e0092f7..f74ab8208 100644
--- a/test/integration/verify/controls/azurerm_aks_cluster.rb
+++ b/test/integration/verify/controls/azure_aks_cluster.rb
@@ -1,8 +1,8 @@
resource_group = input('resource_group', value: nil)
cluster_fqdn = input('cluster_fqdn', value: nil)
-control 'azurerm_aks_cluster' do
- describe azurerm_aks_cluster(resource_group: resource_group, name: 'inspecakstest', api_version: '2018-03-31') do
+control 'azure_aks_cluster' do
+ describe azure_aks_cluster(resource_group: resource_group, name: 'inspecakstest', api_version: '2018-03-31') do
it { should exist }
its('name') { should cmp 'inspecakstest' }
its('type') { should cmp 'Microsoft.ContainerService/managedClusters' }
@@ -18,11 +18,11 @@
its('properties.kubernetesVersion') { should_not be nil }
end
- describe azurerm_aks_cluster(resource_group: resource_group, name: 'fake') do
+ describe azure_aks_cluster(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_aks_cluster(resource_group: 'does-not-exist', name: 'fake') do
+ describe azure_aks_cluster(resource_group: 'does-not-exist', name: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_aks_clusters.rb b/test/integration/verify/controls/azure_aks_clusters.rb
similarity index 52%
rename from test/integration/verify/controls/azurerm_aks_clusters.rb
rename to test/integration/verify/controls/azure_aks_clusters.rb
index 1242d8f8b..75eefc204 100644
--- a/test/integration/verify/controls/azurerm_aks_clusters.rb
+++ b/test/integration/verify/controls/azure_aks_clusters.rb
@@ -1,7 +1,7 @@
resource_group = input('resource_group', value: nil)
-control 'azurerm_aks_clusters' do
- describe azurerm_aks_clusters(resource_group: resource_group, api_version: '2018-03-31') do
+control 'azure_aks_clusters' do
+ describe azure_aks_clusters(resource_group: resource_group, api_version: '2018-03-31') do
it { should exist }
its('names') { should be_an(Array) }
end
diff --git a/test/integration/verify/controls/azurerm_api_management.rb b/test/integration/verify/controls/azure_api_management.rb
similarity index 77%
rename from test/integration/verify/controls/azurerm_api_management.rb
rename to test/integration/verify/controls/azure_api_management.rb
index 7d70d17c1..24838ae79 100644
--- a/test/integration/verify/controls/azurerm_api_management.rb
+++ b/test/integration/verify/controls/azure_api_management.rb
@@ -1,9 +1,9 @@
resource_group = attribute('resource_group', default: nil)
api_management_name = attribute('api_management_name', default: '')
-control 'azurerm_api_management' do
+control 'azure_api_management' do
only_if { !api_management_name.empty? }
- describe azurerm_api_management(resource_group: resource_group, api_management_name: api_management_name) do
+ describe azure_api_management(resource_group: resource_group, api_management_name: api_management_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq api_management_name }
diff --git a/test/integration/verify/controls/azurerm_api_managements.rb b/test/integration/verify/controls/azure_api_managements.rb
similarity index 71%
rename from test/integration/verify/controls/azurerm_api_managements.rb
rename to test/integration/verify/controls/azure_api_managements.rb
index b610ab1c1..df1b9f096 100644
--- a/test/integration/verify/controls/azurerm_api_managements.rb
+++ b/test/integration/verify/controls/azure_api_managements.rb
@@ -1,14 +1,14 @@
resource_group = attribute('resource_group', default: nil)
api_management_name = attribute('api_management_name', default: '')
-control 'azurerm_api_managements' do
+control 'azure_api_managements' do
only_if { !api_management_name.empty? }
- describe azurerm_api_managements(resource_group: resource_group) do
+ describe azure_api_managements(resource_group: resource_group) do
it { should exist }
its('names') { should include api_management_name }
end
- describe azurerm_api_managements do
+ describe azure_api_managements do
it { should exist }
its('names') { should include api_management_name }
end
diff --git a/test/integration/verify/controls/azurerm_application_gateway.rb b/test/integration/verify/controls/azure_application_gateway.rb
similarity index 74%
rename from test/integration/verify/controls/azurerm_application_gateway.rb
rename to test/integration/verify/controls/azure_application_gateway.rb
index c4fa5b675..06bbbcf0b 100644
--- a/test/integration/verify/controls/azurerm_application_gateway.rb
+++ b/test/integration/verify/controls/azure_application_gateway.rb
@@ -1,9 +1,9 @@
resource_group = attribute('resource_group', default: nil)
application_gateway_name = attribute('application_gateway_name', default: nil)
-control 'azurerm_application_gateway' do
+control 'azure_application_gateway' do
- describe azurerm_application_gateway(resource_group: resource_group, application_gateway_name: application_gateway_name) do
+ describe azure_application_gateway(resource_group: resource_group, application_gateway_name: application_gateway_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq application_gateway_name }
diff --git a/test/integration/verify/controls/azurerm_application_gateways.rb b/test/integration/verify/controls/azure_application_gateways.rb
similarity index 68%
rename from test/integration/verify/controls/azurerm_application_gateways.rb
rename to test/integration/verify/controls/azure_application_gateways.rb
index 3b22fee60..79d0583bd 100644
--- a/test/integration/verify/controls/azurerm_application_gateways.rb
+++ b/test/integration/verify/controls/azure_application_gateways.rb
@@ -1,14 +1,14 @@
resource_group = attribute('resource_group', default: nil)
application_gateway_name = attribute('application_gateway_name', default: nil)
-control 'azurerm_application_gateways' do
+control 'azure_application_gateways' do
- describe azurerm_application_gateways(resource_group: resource_group) do
+ describe azure_application_gateways(resource_group: resource_group) do
it { should exist }
its('names') { should include application_gateway_name }
end
- describe azurerm_application_gateways do
+ describe azure_application_gateways do
it { should exist }
its('names') { should include application_gateway_name }
end
diff --git a/test/integration/verify/controls/azurerm_cosmosdb_database_account.rb b/test/integration/verify/controls/azure_cosmosdb_database_account.rb
similarity index 54%
rename from test/integration/verify/controls/azurerm_cosmosdb_database_account.rb
rename to test/integration/verify/controls/azure_cosmosdb_database_account.rb
index 12599cfac..f7841ce80 100644
--- a/test/integration/verify/controls/azurerm_cosmosdb_database_account.rb
+++ b/test/integration/verify/controls/azure_cosmosdb_database_account.rb
@@ -1,15 +1,15 @@
resource_group = attribute('resource_group', default: nil)
cosmosdb_database_account = attribute('cosmosdb_database_account', default: nil)
-control 'azurerm_cosmosdb_database_account' do
+control 'azure_cosmosdb_database_account' do
only_if { !cosmosdb_database_account.nil? }
- describe azurerm_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: cosmosdb_database_account) do
+ describe azure_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: cosmosdb_database_account) do
its('name') { should eq cosmosdb_database_account }
its('type') { should eq 'Microsoft.DocumentDB/databaseAccounts' }
end
- describe azurerm_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: 'fake') do
+ describe azure_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb b/test/integration/verify/controls/azure_event_hub_authorization_rule.rb
similarity index 53%
rename from test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb
rename to test/integration/verify/controls/azure_event_hub_authorization_rule.rb
index 69f55f24a..d401db1b1 100644
--- a/test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb
+++ b/test/integration/verify/controls/azure_event_hub_authorization_rule.rb
@@ -3,15 +3,15 @@
event_hub_endpoint = attribute('event_hub_endpoint', default: nil)
event_hub_authorization_rule = attribute('event_hub_authorization_rule', default: nil)
-control 'azurerm_event_hub_authorization_rule' do
+control 'azure_event_hub_authorization_rule' do
- describe azurerm_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: event_hub_authorization_rule) do
+ describe azure_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: event_hub_authorization_rule) do
it { should exist }
its('name') { should eq event_hub_authorization_rule }
its('type') { should eq 'Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules' }
end
- describe azurerm_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: 'fake') do
+ describe azure_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_event_hub_event_hub.rb b/test/integration/verify/controls/azure_event_hub_event_hub.rb
similarity index 53%
rename from test/integration/verify/controls/azurerm_event_hub_event_hub.rb
rename to test/integration/verify/controls/azure_event_hub_event_hub.rb
index 4212dd721..ad1e43221 100644
--- a/test/integration/verify/controls/azurerm_event_hub_event_hub.rb
+++ b/test/integration/verify/controls/azure_event_hub_event_hub.rb
@@ -2,15 +2,15 @@
event_hub_namespace_name = attribute('event_hub_namespace_name', default: nil)
event_hub_name = attribute('event_hub_name', default: nil)
-control 'azurerm_event_hub_event_hub' do
+control 'azure_event_hub_event_hub' do
- describe azurerm_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: event_hub_name) do
+ describe azure_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: event_hub_name) do
it { should exist }
its('name') { should eq event_hub_name }
its('type') { should eq 'Microsoft.EventHub/Namespaces/EventHubs' }
end
- describe azurerm_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: 'fake-event-hub') do
+ describe azure_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: 'fake-event-hub') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_event_hub_namespace.rb b/test/integration/verify/controls/azure_event_hub_namespace.rb
similarity index 56%
rename from test/integration/verify/controls/azurerm_event_hub_namespace.rb
rename to test/integration/verify/controls/azure_event_hub_namespace.rb
index d102faf22..c0d38d63d 100644
--- a/test/integration/verify/controls/azurerm_event_hub_namespace.rb
+++ b/test/integration/verify/controls/azure_event_hub_namespace.rb
@@ -1,15 +1,15 @@
resource_group = attribute('resource_group', default: nil)
event_hub_namespace_name = attribute('event_hub_namespace_name', default: nil)
-control 'azurerm_event_hub_namespace' do
+control 'azure_event_hub_namespace' do
- describe azurerm_event_hub_namespace(resource_group: resource_group, namespace_name: event_hub_namespace_name) do
+ describe azure_event_hub_namespace(resource_group: resource_group, namespace_name: event_hub_namespace_name) do
it { should exist }
its('name') { should eq event_hub_namespace_name }
its('type') { should eq 'Microsoft.EventHub/Namespaces' }
end
- describe azurerm_event_hub_namespace(resource_group: resource_group, namespace_name: 'fake') do
+ describe azure_event_hub_namespace(resource_group: resource_group, namespace_name: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_ad_user.rb b/test/integration/verify/controls/azure_graph_user.rb
similarity index 66%
rename from test/integration/verify/controls/azurerm_ad_user.rb
rename to test/integration/verify/controls/azure_graph_user.rb
index 041c51a50..6ebde0b33 100644
--- a/test/integration/verify/controls/azurerm_ad_user.rb
+++ b/test/integration/verify/controls/azure_graph_user.rb
@@ -1,7 +1,7 @@
-control 'azurerm_ad_user' do
+control 'azure_graph_user' do
- user_id = azurerm_ad_users.object_ids.first
- describe azurerm_ad_user(user_id: user_id) do
+ user_id = azure_graph_users.object_ids.first
+ describe azure_graph_user(user_id: user_id) do
it { should exist }
its('objectId') { should eq user_id }
its('displayName') { should_not be_nil }
diff --git a/test/integration/verify/controls/azurerm_ad_users.rb b/test/integration/verify/controls/azure_graph_users.rb
similarity index 73%
rename from test/integration/verify/controls/azurerm_ad_users.rb
rename to test/integration/verify/controls/azure_graph_users.rb
index 6d7b9830d..62e6b9351 100644
--- a/test/integration/verify/controls/azurerm_ad_users.rb
+++ b/test/integration/verify/controls/azure_graph_users.rb
@@ -1,6 +1,6 @@
-control 'azurerm_ad_users' do
+control 'azure_graph_users' do
- describe azurerm_ad_users do
+ describe azure_graph_users do
its('display_names') { should_not be_empty }
its('user_types') { should_not be_empty }
its('mails') { should_not be_empty }
diff --git a/test/integration/verify/controls/azurerm_hdinsight_cluster.rb b/test/integration/verify/controls/azure_hdinsight_cluster.rb
similarity index 71%
rename from test/integration/verify/controls/azurerm_hdinsight_cluster.rb
rename to test/integration/verify/controls/azure_hdinsight_cluster.rb
index ffc7e8649..621289359 100644
--- a/test/integration/verify/controls/azurerm_hdinsight_cluster.rb
+++ b/test/integration/verify/controls/azure_hdinsight_cluster.rb
@@ -1,9 +1,9 @@
resource_group = input('resource_group', value: nil)
cluster_name = input('hdinsight_cluster_name', value: '')
-control 'azurerm_hdinsight_cluster' do
+control 'azure_hdinsight_cluster' do
only_if { !cluster_name.empty? }
- describe azurerm_hdinsight_cluster(resource_group: resource_group, name: cluster_name) do
+ describe azure_hdinsight_cluster(resource_group: resource_group, name: cluster_name) do
it { should exist }
its('name') { should cmp cluster_name }
its('type') { should cmp 'Microsoft.HDInsight/clusters' }
@@ -12,11 +12,11 @@
its('properties.clusterDefinition.kind') { should eq 'INTERACTIVEHIVE' }
end
- describe azurerm_hdinsight_cluster(resource_group: resource_group, name: 'fake') do
+ describe azure_hdinsight_cluster(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_hdinsight_cluster(resource_group: 'does-not-exist', name: 'fake') do
+ describe azure_hdinsight_cluster(resource_group: 'does-not-exist', name: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_iothub.rb b/test/integration/verify/controls/azure_iothub.rb
similarity index 60%
rename from test/integration/verify/controls/azurerm_iothub.rb
rename to test/integration/verify/controls/azure_iothub.rb
index 13f1d7eee..5e9a4f52b 100644
--- a/test/integration/verify/controls/azurerm_iothub.rb
+++ b/test/integration/verify/controls/azure_iothub.rb
@@ -1,15 +1,15 @@
resource_group = attribute('resource_group', default: nil)
iothub_resource_name = attribute('iothub_resource_name', default: nil)
-control 'azurerm_iothub' do
+control 'azure_iothub' do
- describe azurerm_iothub(resource_group: resource_group, resource_name: iothub_resource_name) do
+ describe azure_iothub(resource_group: resource_group, resource_name: iothub_resource_name) do
it { should exist }
its('name') { should eq iothub_resource_name }
its('type') { should eq 'Microsoft.Devices/IotHubs' }
end
- describe azurerm_iothub(resource_group: resource_group, resource_name: 'fake') do
+ describe azure_iothub(resource_group: resource_group, resource_name: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb b/test/integration/verify/controls/azure_iothub_event_hub_consumer_group.rb
similarity index 50%
rename from test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb
rename to test/integration/verify/controls/azure_iothub_event_hub_consumer_group.rb
index f2e602167..935bcf680 100644
--- a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb
+++ b/test/integration/verify/controls/azure_iothub_event_hub_consumer_group.rb
@@ -3,15 +3,15 @@
iothub_event_hub_endpoint = attribute('iothub_event_hub_endpoint', default: nil)
consumer_group = attribute('consumer_group', default: nil)
-control 'azurerm_iothub_event_hub_consumer_group' do
+control 'azure_iothub_event_hub_consumer_group' do
- describe azurerm_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: consumer_group) do
+ describe azure_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: consumer_group) do
it { should exist }
its('name') { should eq consumer_group }
its('type') { should eq 'Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups' }
end
- describe azurerm_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: 'invalid-consumer-group') do
+ describe azure_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: 'invalid-consumer-group') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb b/test/integration/verify/controls/azure_iothub_event_hub_consumer_groups.rb
similarity index 83%
rename from test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb
rename to test/integration/verify/controls/azure_iothub_event_hub_consumer_groups.rb
index 65859f9b0..394692c1b 100644
--- a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb
+++ b/test/integration/verify/controls/azure_iothub_event_hub_consumer_groups.rb
@@ -3,9 +3,9 @@
iothub_event_hub_endpoint = attribute('iothub_event_hub_endpoint', default: nil)
consumer_groups = attribute('consumer_groups', default: nil)
-control 'azurerm_iothub_event_hub_consumer_groups' do
+control 'azure_iothub_event_hub_consumer_groups' do
- azurerm_iothub_event_hub_consumer_groups(resource_group: resource_group,
+ azure_iothub_event_hub_consumer_groups(resource_group: resource_group,
resource_name: iothub_resource_name,
event_hub_endpoint: iothub_event_hub_endpoint).entries.each do |consumer_group|
describe consumer_group do
@@ -14,7 +14,7 @@
end
end
- azurerm_iothub_event_hub_consumer_groups(resource_group: resource_group,
+ azure_iothub_event_hub_consumer_groups(resource_group: resource_group,
resource_name: iothub_resource_name,
event_hub_endpoint: iothub_event_hub_endpoint) do
its { should exist }
diff --git a/test/integration/verify/controls/azurerm_key_vault_key.rb b/test/integration/verify/controls/azure_key_vault_key.rb
similarity index 70%
rename from test/integration/verify/controls/azurerm_key_vault_key.rb
rename to test/integration/verify/controls/azure_key_vault_key.rb
index ded67426d..5cce57eb1 100644
--- a/test/integration/verify/controls/azurerm_key_vault_key.rb
+++ b/test/integration/verify/controls/azure_key_vault_key.rb
@@ -1,8 +1,8 @@
vault_name = input('key_vault_name', value: nil)
key_name = input('key_vault_key_name', value: nil)
-control 'azurerm_key_vault_key' do
- describe azurerm_key_vault_key(vault_name, key_name) do
+control 'azure_key_vault_key' do
+ describe azure_key_vault_key(vault_name, key_name) do
its('key.kid') { should_not be_nil }
its('attributes') { should have_attributes(enabled: true) }
end
diff --git a/test/integration/verify/controls/azurerm_key_vault_keys.rb b/test/integration/verify/controls/azure_key_vault_keys.rb
similarity index 80%
rename from test/integration/verify/controls/azurerm_key_vault_keys.rb
rename to test/integration/verify/controls/azure_key_vault_keys.rb
index e3eec3ec1..5bf1facd6 100644
--- a/test/integration/verify/controls/azurerm_key_vault_keys.rb
+++ b/test/integration/verify/controls/azure_key_vault_keys.rb
@@ -1,8 +1,8 @@
vault_name = input('key_vault_name', value: nil)
-control 'azurerm_key_vault_keys' do
+control 'azure_key_vault_keys' do
- azurerm_key_vault_keys(vault_name).entries.each do |key|
+ azure_key_vault_keys(vault_name).entries.each do |key|
describe key do
its('kid') { should_not be nil }
its('attributes') { should have_attributes(enabled: true) }
diff --git a/test/integration/verify/controls/azurerm_key_vault_secret.rb b/test/integration/verify/controls/azure_key_vault_secret.rb
similarity index 65%
rename from test/integration/verify/controls/azurerm_key_vault_secret.rb
rename to test/integration/verify/controls/azure_key_vault_secret.rb
index 42a0d6670..c47d6a2b6 100644
--- a/test/integration/verify/controls/azurerm_key_vault_secret.rb
+++ b/test/integration/verify/controls/azure_key_vault_secret.rb
@@ -1,8 +1,8 @@
vault_name = input('key_vault_name', value: nil)
secret_name = input('key_vault_secret_name', value: nil)
-control 'azurerm_key_vault_secret' do
- describe azurerm_key_vault_secret(vault_name, secret_name) do
+control 'azure_key_vault_secret' do
+ describe azure_key_vault_secret(vault_name, secret_name) do
it { should exist }
its('value') { should_not be_nil }
end
diff --git a/test/integration/verify/controls/azurerm_key_vault_secrets.rb b/test/integration/verify/controls/azure_key_vault_secrets.rb
similarity index 75%
rename from test/integration/verify/controls/azurerm_key_vault_secrets.rb
rename to test/integration/verify/controls/azure_key_vault_secrets.rb
index 3bfe473c6..921fed972 100644
--- a/test/integration/verify/controls/azurerm_key_vault_secrets.rb
+++ b/test/integration/verify/controls/azure_key_vault_secrets.rb
@@ -1,8 +1,8 @@
vault_name = input('key_vault_name', value: nil)
-control 'azurerm_key_vault_secrets' do
+control 'azure_key_vault_secrets' do
- describe azurerm_key_vault_secrets(vault_name) do
+ describe azure_key_vault_secrets(vault_name) do
it { should exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_key_vaults.rb b/test/integration/verify/controls/azure_key_vaults.rb
similarity index 83%
rename from test/integration/verify/controls/azurerm_key_vaults.rb
rename to test/integration/verify/controls/azure_key_vaults.rb
index 4849e5099..b5a0c31e2 100644
--- a/test/integration/verify/controls/azurerm_key_vaults.rb
+++ b/test/integration/verify/controls/azure_key_vaults.rb
@@ -1,9 +1,9 @@
resource_group = input('resource_group', value: nil)
vault_name = input('key_vault_name', value: nil)
-control 'azurerm_key_vaults' do
+control 'azure_key_vaults' do
- describe azurerm_key_vaults(resource_group: resource_group) do
+ describe azure_key_vaults(resource_group: resource_group) do
it { should exist }
its('names') { should include vault_name }
end
diff --git a/test/integration/verify/controls/azurerm_load_balancer.rb b/test/integration/verify/controls/azure_load_balancer.rb
similarity index 74%
rename from test/integration/verify/controls/azurerm_load_balancer.rb
rename to test/integration/verify/controls/azure_load_balancer.rb
index 083303a48..910ac3835 100644
--- a/test/integration/verify/controls/azurerm_load_balancer.rb
+++ b/test/integration/verify/controls/azure_load_balancer.rb
@@ -1,9 +1,9 @@
resource_group = attribute('resource_group', default: nil)
loadbalancer_name = attribute('lb_name', default: nil)
-control 'azurerm_load_balancer' do
+control 'azure_load_balancer' do
- describe azurerm_load_balancer(resource_group: resource_group, loadbalancer_name: loadbalancer_name) do
+ describe azure_load_balancer(resource_group: resource_group, loadbalancer_name: loadbalancer_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq loadbalancer_name }
diff --git a/test/integration/verify/controls/azurerm_load_balancers.rb b/test/integration/verify/controls/azure_load_balancers.rb
similarity index 68%
rename from test/integration/verify/controls/azurerm_load_balancers.rb
rename to test/integration/verify/controls/azure_load_balancers.rb
index 3174012fe..de2395c99 100644
--- a/test/integration/verify/controls/azurerm_load_balancers.rb
+++ b/test/integration/verify/controls/azure_load_balancers.rb
@@ -1,14 +1,14 @@
resource_group = attribute('resource_group', default: nil)
loadbalancer_name = attribute('lb_name', default: nil)
-control 'azurerm_load_balancers' do
+control 'azure_load_balancers' do
- describe azurerm_load_balancers(resource_group: resource_group) do
+ describe azure_load_balancers(resource_group: resource_group) do
it { should exist }
its('names') { should include loadbalancer_name }
end
- describe azurerm_load_balancers do
+ describe azure_load_balancers do
it { should exist }
its('names') { should include loadbalancer_name }
end
diff --git a/test/integration/verify/controls/azurerm_locks.rb b/test/integration/verify/controls/azure_locks.rb
similarity index 74%
rename from test/integration/verify/controls/azurerm_locks.rb
rename to test/integration/verify/controls/azure_locks.rb
index bf49f2533..4dc383722 100644
--- a/test/integration/verify/controls/azurerm_locks.rb
+++ b/test/integration/verify/controls/azure_locks.rb
@@ -3,8 +3,8 @@
resource_name = input('windows_vm_name', value: nil)
resource_type = 'Microsoft.Compute/virtualMachines'
-control 'azurerm_locks' do
- describe azurerm_locks(resource_group: resource_group, resource_name: resource_name, resource_type: resource_type) do
+control 'azure_locks' do
+ describe azure_locks(resource_group: resource_group, resource_name: resource_name, resource_type: resource_type) do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_management_group.rb b/test/integration/verify/controls/azure_management_group.rb
similarity index 88%
rename from test/integration/verify/controls/azurerm_management_group.rb
rename to test/integration/verify/controls/azure_management_group.rb
index 818c7f4e6..28bc147ad 100644
--- a/test/integration/verify/controls/azurerm_management_group.rb
+++ b/test/integration/verify/controls/azure_management_group.rb
@@ -5,9 +5,9 @@
parent_dn = input('parent_dn', value: nil)
mg_type = 'Microsoft.Management/managementGroups'
-control 'azurerm_management_group' do
+control 'azure_management_group' do
only_if { !parent_mg.nil? }
- describe azurerm_management_group(group_id: parent_mg, expand: 'children', recurse: true) do
+ describe azure_management_group(group_id: parent_mg, expand: 'children', recurse: true) do
it { should exist }
its('id') { should eq "/providers/#{mg_type}/#{parent_mg}" }
its('name') { should eq parent_mg }
@@ -21,7 +21,7 @@
its('children_display_names') { should include 'Management Group Child 2' }
end
- describe azurerm_management_group(group_id: child1_mg, expand: 'children', recurse: true) do
+ describe azure_management_group(group_id: child1_mg, expand: 'children', recurse: true) do
it { should exist }
its('id') { should eq "/providers/#{mg_type}/#{child1_mg}" }
its('name') { should eq child1_mg }
@@ -36,7 +36,7 @@
its('children_types') { should eq [] }
end
- describe azurerm_management_group(group_id: child2_mg, expand: 'children', recurse: true) do
+ describe azure_management_group(group_id: child2_mg, expand: 'children', recurse: true) do
it { should exist }
its('id') { should eq "/providers/#{mg_type}/#{child2_mg}" }
its('name') { should eq child2_mg }
diff --git a/test/integration/verify/controls/azurerm_management_groups.rb b/test/integration/verify/controls/azure_management_groups.rb
similarity index 84%
rename from test/integration/verify/controls/azurerm_management_groups.rb
rename to test/integration/verify/controls/azure_management_groups.rb
index 6b0f48bc2..15268af38 100644
--- a/test/integration/verify/controls/azurerm_management_groups.rb
+++ b/test/integration/verify/controls/azure_management_groups.rb
@@ -4,9 +4,9 @@
child2_mg = input('child2_mg', value: nil)
parent_dn = input('parent_dn', value: nil)
-control 'azurerm_management_groups' do
+control 'azure_management_groups' do
only_if { !parent_mg.nil? }
- describe azurerm_management_groups do
+ describe azure_management_groups do
its('ids') { should include "/providers/Microsoft.Management/managementGroups/#{parent_mg}" }
its('ids') { should include "/providers/Microsoft.Management/managementGroups/#{child1_mg}" }
its('ids') { should include "/providers/Microsoft.Management/managementGroups/#{child2_mg}" }
@@ -15,7 +15,7 @@
its('names') { should include child2_mg }
end
- describe azurerm_management_groups.where(name: 'mg_parent').entries.first do
+ describe azure_management_groups.where(name: 'mg_parent').entries.first do
its('properties') { should have_attributes(tenantId: tenant_id, displayName: parent_dn) }
end
end
diff --git a/test/integration/verify/controls/azurerm_mariadb_server.rb b/test/integration/verify/controls/azure_mariadb_server.rb
similarity index 79%
rename from test/integration/verify/controls/azurerm_mariadb_server.rb
rename to test/integration/verify/controls/azure_mariadb_server.rb
index 485d6892e..4cc28687c 100644
--- a/test/integration/verify/controls/azurerm_mariadb_server.rb
+++ b/test/integration/verify/controls/azure_mariadb_server.rb
@@ -1,10 +1,10 @@
resource_group = input('resource_group', value: nil)
mariadb_server_name = input('mariadb_server_name', value: nil)
-control 'azurerm_mariadb_server' do
+control 'azure_mariadb_server' do
only_if { !mariadb_server_name.nil? }
- describe azurerm_mariadb_server(resource_group: resource_group, server_name: mariadb_server_name) do
+ describe azure_mariadb_server(resource_group: resource_group, server_name: mariadb_server_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq mariadb_server_name }
diff --git a/test/integration/verify/controls/azurerm_mariadb_servers.rb b/test/integration/verify/controls/azure_mariadb_servers.rb
similarity index 71%
rename from test/integration/verify/controls/azurerm_mariadb_servers.rb
rename to test/integration/verify/controls/azure_mariadb_servers.rb
index e7a8a27bd..53890469b 100644
--- a/test/integration/verify/controls/azurerm_mariadb_servers.rb
+++ b/test/integration/verify/controls/azure_mariadb_servers.rb
@@ -1,15 +1,15 @@
resource_group = input('resource_group', value: nil)
mariadb_server_name = input('mariadb_server_name', value: nil)
-control 'azurerm_mariadb_servers' do
+control 'azure_mariadb_servers' do
only_if { !mariadb_server_name.nil? }
- describe azurerm_mariadb_servers(resource_group: resource_group) do
+ describe azure_mariadb_servers(resource_group: resource_group) do
it { should exist }
its('names') { should include mariadb_server_name }
end
- describe azurerm_mariadb_servers do
+ describe azure_mariadb_servers do
it { should exist }
its('names') { should include mariadb_server_name }
end
diff --git a/test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb b/test/integration/verify/controls/azure_monitor_activity_log_alert.rb
similarity index 79%
rename from test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb
rename to test/integration/verify/controls/azure_monitor_activity_log_alert.rb
index 38ee406f0..8d31911e1 100644
--- a/test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb
+++ b/test/integration/verify/controls/azure_monitor_activity_log_alert.rb
@@ -14,16 +14,16 @@
'5_12' => 'Microsoft.Security/policies/write',
}
-control 'azurerm_monitor_activity_log_alert' do
+control 'azure_monitor_activity_log_alert' do
alerts_and_operations.each do |alert, operation|
- describe azurerm_monitor_activity_log_alert(resource_group: resource_group, name: "#{log_alert_name}_#{alert}") do
+ describe azure_monitor_activity_log_alert(resource_group: resource_group, name: "#{log_alert_name}_#{alert}") do
it { should exist }
its('operations') { should include operation }
its('conditions') { should_not be_nil }
end
end
- describe azurerm_monitor_activity_log_alert(resource_group: resource_group, name: 'fake') do
+ describe azure_monitor_activity_log_alert(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azure_monitor_activity_log_alerts.rb b/test/integration/verify/controls/azure_monitor_activity_log_alerts.rb
new file mode 100644
index 000000000..486d1f7fb
--- /dev/null
+++ b/test/integration/verify/controls/azure_monitor_activity_log_alerts.rb
@@ -0,0 +1,5 @@
+control 'azure_monitor_activity_log_alerts' do
+ describe azure_monitor_activity_log_alerts do
+ its('names') { should include('defaultLogAlert_5_3') }
+ end
+end
diff --git a/test/integration/verify/controls/azurerm_monitor_log_profile.rb b/test/integration/verify/controls/azure_monitor_log_profile.rb
similarity index 64%
rename from test/integration/verify/controls/azurerm_monitor_log_profile.rb
rename to test/integration/verify/controls/azure_monitor_log_profile.rb
index 3955d19c2..ff4908381 100644
--- a/test/integration/verify/controls/azurerm_monitor_log_profile.rb
+++ b/test/integration/verify/controls/azure_monitor_log_profile.rb
@@ -1,7 +1,7 @@
log_profile = input('log_profile_name', value: nil)
-control 'azurerm_monitor_log_profile' do
- describe azurerm_monitor_log_profile(name: log_profile) do
+control 'azure_monitor_log_profile' do
+ describe azure_monitor_log_profile(name: log_profile) do
it { should exist }
its('retention_enabled') { should be true }
its('retention_days') { should eq(365) }
diff --git a/test/integration/verify/controls/azurerm_monitor_log_profiles.rb b/test/integration/verify/controls/azure_monitor_log_profiles.rb
similarity index 78%
rename from test/integration/verify/controls/azurerm_monitor_log_profiles.rb
rename to test/integration/verify/controls/azure_monitor_log_profiles.rb
index 61ba78521..39a9a56b8 100644
--- a/test/integration/verify/controls/azurerm_monitor_log_profiles.rb
+++ b/test/integration/verify/controls/azure_monitor_log_profiles.rb
@@ -1,7 +1,7 @@
log_profile = input('log_profile_name', value: nil)
-control 'azurerm_monitor_log_profiles' do
- describe azurerm_monitor_log_profiles do
+control 'azure_monitor_log_profiles' do
+ describe azure_monitor_log_profiles do
its('names') { should include(log_profile) }
end
end
diff --git a/test/integration/verify/controls/azurerm_mysql_database.rb b/test/integration/verify/controls/azure_mysql_database.rb
similarity index 84%
rename from test/integration/verify/controls/azurerm_mysql_database.rb
rename to test/integration/verify/controls/azure_mysql_database.rb
index 48d184d99..2e26a3b2c 100644
--- a/test/integration/verify/controls/azurerm_mysql_database.rb
+++ b/test/integration/verify/controls/azure_mysql_database.rb
@@ -2,10 +2,10 @@
mysql_server_name = input('mysql_server_name', value: nil)
mysql_db_name = input('mysql_database_name', value: nil)
-control 'azurerm_mysql_database' do
+control 'azure_mysql_database' do
only_if { !mysql_db_name.nil? }
- describe azurerm_mysql_database(resource_group: resource_group,
+ describe azure_mysql_database(resource_group: resource_group,
server_name: mysql_server_name,
database_name: mysql_db_name) do
it { should exist }
diff --git a/test/integration/verify/controls/azurerm_mysql_databases.rb b/test/integration/verify/controls/azure_mysql_databases.rb
similarity index 69%
rename from test/integration/verify/controls/azurerm_mysql_databases.rb
rename to test/integration/verify/controls/azure_mysql_databases.rb
index f123712fb..3c7b0a7fa 100644
--- a/test/integration/verify/controls/azurerm_mysql_databases.rb
+++ b/test/integration/verify/controls/azure_mysql_databases.rb
@@ -2,10 +2,10 @@
mysql_server_name = input('mysql_server_name', value: nil)
mysql_server_database = input('mysql_database_name', value: nil)
-control 'azurerm_mysql_databases' do
+control 'azure_mysql_databases' do
only_if { !mysql_server_database.nil? }
- describe azurerm_mysql_databases(resource_group: resource_group, server_name: mysql_server_name) do
+ describe azure_mysql_databases(resource_group: resource_group, server_name: mysql_server_name) do
it { should exist }
its('names') { should include mysql_server_database }
end
diff --git a/test/integration/verify/controls/azurerm_mysql_server.rb b/test/integration/verify/controls/azure_mysql_server.rb
similarity index 86%
rename from test/integration/verify/controls/azurerm_mysql_server.rb
rename to test/integration/verify/controls/azure_mysql_server.rb
index 839b508a3..60fd0aae2 100644
--- a/test/integration/verify/controls/azurerm_mysql_server.rb
+++ b/test/integration/verify/controls/azure_mysql_server.rb
@@ -1,10 +1,10 @@
resource_group = input('resource_group', value: nil)
mysql_server_name = input('mysql_server_name', value: nil)
-control 'azurerm_mysql_server' do
+control 'azure_mysql_server' do
only_if { !mysql_server_name.nil? }
- describe azurerm_mysql_server(resource_group: resource_group, server_name: mysql_server_name) do
+ describe azure_mysql_server(resource_group: resource_group, server_name: mysql_server_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq mysql_server_name }
diff --git a/test/integration/verify/controls/azurerm_mysql_servers.rb b/test/integration/verify/controls/azure_mysql_servers.rb
similarity index 71%
rename from test/integration/verify/controls/azurerm_mysql_servers.rb
rename to test/integration/verify/controls/azure_mysql_servers.rb
index f8f669760..6442c1d19 100644
--- a/test/integration/verify/controls/azurerm_mysql_servers.rb
+++ b/test/integration/verify/controls/azure_mysql_servers.rb
@@ -1,15 +1,15 @@
resource_group = input('resource_group', value: nil)
mysql_server_name = input('mysql_server_name', value: nil)
-control 'azurerm_mysql_servers' do
+control 'azure_mysql_servers' do
only_if { !mysql_server_name.nil? }
- describe azurerm_mysql_servers(resource_group: resource_group) do
+ describe azure_mysql_servers(resource_group: resource_group) do
it { should exist }
its('names') { should include mysql_server_name }
end
- describe azurerm_mysql_servers do
+ describe azure_mysql_servers do
it { should exist }
its('names') { should include mysql_server_name }
end
diff --git a/test/integration/verify/controls/azurerm_network_interface.rb b/test/integration/verify/controls/azure_network_interface.rb
similarity index 76%
rename from test/integration/verify/controls/azurerm_network_interface.rb
rename to test/integration/verify/controls/azure_network_interface.rb
index 37ea0b67d..9fb775e72 100644
--- a/test/integration/verify/controls/azurerm_network_interface.rb
+++ b/test/integration/verify/controls/azure_network_interface.rb
@@ -1,9 +1,9 @@
resource_group = attribute('resource_group', default: nil)
nic_name = attribute('windows_vm_nic_name', default: nil)
-control 'azurerm_network_interface' do
+control 'azure_network_interface' do
- describe azurerm_network_interface(resource_group: resource_group, name: nic_name) do
+ describe azure_network_interface(resource_group: resource_group, name: nic_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq nic_name }
diff --git a/test/integration/verify/controls/azurerm_network_interfaces.rb b/test/integration/verify/controls/azure_network_interfaces.rb
similarity index 64%
rename from test/integration/verify/controls/azurerm_network_interfaces.rb
rename to test/integration/verify/controls/azure_network_interfaces.rb
index d160ead84..78d1a0bc0 100644
--- a/test/integration/verify/controls/azurerm_network_interfaces.rb
+++ b/test/integration/verify/controls/azure_network_interfaces.rb
@@ -1,9 +1,9 @@
resource_group = attribute('resource_group', default: nil)
nic_name = attribute('windows_vm_nic_name', default: nil)
-control 'azurerm_network_interfaces' do
+control 'azure_network_interfaces' do
- describe azurerm_network_interfaces(resource_group: resource_group) do
+ describe azure_network_interfaces(resource_group: resource_group) do
it { should exist }
its('names') { should include nic_name }
end
diff --git a/test/integration/verify/controls/azurerm_network_security_group.rb b/test/integration/verify/controls/azure_network_security_group.rb
similarity index 87%
rename from test/integration/verify/controls/azurerm_network_security_group.rb
rename to test/integration/verify/controls/azure_network_security_group.rb
index d1b871eb8..18e95e7e8 100644
--- a/test/integration/verify/controls/azurerm_network_security_group.rb
+++ b/test/integration/verify/controls/azure_network_security_group.rb
@@ -4,8 +4,8 @@
nsg_insecure = input('network_security_group_insecure', value: nil)
nsg_open = input('network_security_group_open', value: nil)
-control 'azurerm_network_security_group' do
- describe azurerm_network_security_group(resource_group: resource_group, name: nsg) do
+control 'azure_network_security_group' do
+ describe azure_network_security_group(resource_group: resource_group, name: nsg) do
it { should exist }
its('id') { should eq nsg_id }
its('name') { should eq nsg }
@@ -26,7 +26,7 @@
it { should_not allow_port_from_internet('69') }
end
- describe azurerm_network_security_group(resource_group: resource_group, name: nsg_insecure) do
+ describe azure_network_security_group(resource_group: resource_group, name: nsg_insecure) do
it { should exist }
it { should allow_rdp_from_internet }
it { should allow_ssh_from_internet }
@@ -42,17 +42,17 @@
it { should allow_port_from_internet('69') }
end
- describe azurerm_network_security_group(resource_group: resource_group, name: nsg_open) do
+ describe azure_network_security_group(resource_group: resource_group, name: nsg_open) do
it { should exist }
it { should allow_rdp_from_internet }
it { should allow_ssh_from_internet }
end
- describe azurerm_network_security_group(resource_group: resource_group, name: 'fake') do
+ describe azure_network_security_group(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_network_security_group(resource_group: 'does-not-exist', name: nsg) do
+ describe azure_network_security_group(resource_group: 'does-not-exist', name: nsg) do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_network_security_groups.rb b/test/integration/verify/controls/azure_network_security_groups.rb
similarity index 74%
rename from test/integration/verify/controls/azurerm_network_security_groups.rb
rename to test/integration/verify/controls/azure_network_security_groups.rb
index 8876be9ee..2fe2beca0 100644
--- a/test/integration/verify/controls/azurerm_network_security_groups.rb
+++ b/test/integration/verify/controls/azure_network_security_groups.rb
@@ -1,7 +1,7 @@
resource_group = input('resource_group', value: nil)
-control 'azurerm_network_security_groups' do
- describe azurerm_network_security_groups(resource_group: resource_group) do
+control 'azure_network_security_groups' do
+ describe azure_network_security_groups(resource_group: resource_group) do
it { should exist }
its('names') { should be_an(Array) }
end
diff --git a/test/integration/verify/controls/azurerm_network_watcher.rb b/test/integration/verify/controls/azure_network_watcher.rb
similarity index 66%
rename from test/integration/verify/controls/azurerm_network_watcher.rb
rename to test/integration/verify/controls/azure_network_watcher.rb
index 675e02731..d294e4be4 100644
--- a/test/integration/verify/controls/azurerm_network_watcher.rb
+++ b/test/integration/verify/controls/azure_network_watcher.rb
@@ -2,10 +2,10 @@
nw = input('network_watcher_name', value: []).first
nw_id = input('network_watcher_id', value: []).first
-control 'azurerm_network_watcher' do
+control 'azure_network_watcher' do
only_if { !nw.nil? }
- describe azurerm_network_watcher(resource_group: resource_group, name: nw) do
+ describe azure_network_watcher(resource_group: resource_group, name: nw) do
it { should exist }
its('id') { should eq nw_id }
its('name') { should eq nw }
@@ -13,11 +13,11 @@
its('provisioning_state') { should eq 'Succeeded' }
end
- describe azurerm_network_watcher(resource_group: resource_group, name: 'fake') do
+ describe azure_network_watcher(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_network_watcher(resource_group: 'does-not-exist', name: nw) do
+ describe azure_network_watcher(resource_group: 'does-not-exist', name: nw) do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_network_watchers.rb b/test/integration/verify/controls/azure_network_watchers.rb
similarity index 71%
rename from test/integration/verify/controls/azurerm_network_watchers.rb
rename to test/integration/verify/controls/azure_network_watchers.rb
index c64be9308..9be9331f1 100644
--- a/test/integration/verify/controls/azurerm_network_watchers.rb
+++ b/test/integration/verify/controls/azure_network_watchers.rb
@@ -1,10 +1,10 @@
resource_group = input('resource_group', value: nil)
nw = input('network_watcher_name', value: []).first
-control 'azurerm_network_watchers' do
+control 'azure_network_watchers' do
only_if { !nw.nil? }
- describe azurerm_network_watchers(resource_group: resource_group) do
+ describe azure_network_watchers(resource_group: resource_group) do
it { should exist }
its('names') { should be_an(Array) }
end
@@ -13,7 +13,7 @@
control 'azure_network_watchers' do
only_if { !nw.nil? }
- azurerm_network_watchers.ids.each do |id|
+ azure_network_watchers.ids.each do |id|
describe azure_network_watcher(resource_id: id) do
it { should exist }
end
diff --git a/test/integration/verify/controls/azurerm_postgresql_database.rb b/test/integration/verify/controls/azure_postgresql_database.rb
similarity index 84%
rename from test/integration/verify/controls/azurerm_postgresql_database.rb
rename to test/integration/verify/controls/azure_postgresql_database.rb
index 9f9b62a28..9b4baff98 100644
--- a/test/integration/verify/controls/azurerm_postgresql_database.rb
+++ b/test/integration/verify/controls/azure_postgresql_database.rb
@@ -2,10 +2,10 @@
postgresql_server_name = input('postgresql_server_name', value: nil)
postgresql_database_name = input('postgresql_database_name', value: nil)
-control 'azurerm_postgresql_database' do
+control 'azure_postgresql_database' do
only_if { !postgresql_database_name.nil? }
- describe azurerm_postgresql_database(resource_group: resource_group,
+ describe azure_postgresql_database(resource_group: resource_group,
server_name: postgresql_server_name,
database_name: postgresql_database_name) do
it { should exist }
diff --git a/test/integration/verify/controls/azurerm_postgresql_databases.rb b/test/integration/verify/controls/azure_postgresql_databases.rb
similarity index 69%
rename from test/integration/verify/controls/azurerm_postgresql_databases.rb
rename to test/integration/verify/controls/azure_postgresql_databases.rb
index eac289026..08d75c8e6 100644
--- a/test/integration/verify/controls/azurerm_postgresql_databases.rb
+++ b/test/integration/verify/controls/azure_postgresql_databases.rb
@@ -2,10 +2,10 @@
postgresql_server_name = input('postgresql_server_name', value: nil)
postgresql_database_name = input('postgresql_database_name', value: nil)
-control 'azurerm_postgresql_databases' do
+control 'azure_postgresql_databases' do
only_if { !postgresql_database_name.nil? }
- describe azurerm_postgresql_databases(resource_group: resource_group, server_name: postgresql_server_name) do
+ describe azure_postgresql_databases(resource_group: resource_group, server_name: postgresql_server_name) do
it { should exist }
its('names') { should include postgresql_database_name }
end
diff --git a/test/integration/verify/controls/azurerm_postgresql_server.rb b/test/integration/verify/controls/azure_postgresql_server.rb
similarity index 78%
rename from test/integration/verify/controls/azurerm_postgresql_server.rb
rename to test/integration/verify/controls/azure_postgresql_server.rb
index 483b16878..99973d2bb 100644
--- a/test/integration/verify/controls/azurerm_postgresql_server.rb
+++ b/test/integration/verify/controls/azure_postgresql_server.rb
@@ -1,10 +1,10 @@
resource_group = input('resource_group', value: nil)
postgresql_server_name = input('postgresql_server_name', value: nil)
-control 'azurerm_postgresql_server' do
+control 'azure_postgresql_server' do
only_if { !postgresql_server_name.nil? }
- describe azurerm_postgresql_server(resource_group: resource_group, server_name: postgresql_server_name) do
+ describe azure_postgresql_server(resource_group: resource_group, server_name: postgresql_server_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq postgresql_server_name }
diff --git a/test/integration/verify/controls/azurerm_postgresql_servers.rb b/test/integration/verify/controls/azure_postgresql_servers.rb
similarity index 76%
rename from test/integration/verify/controls/azurerm_postgresql_servers.rb
rename to test/integration/verify/controls/azure_postgresql_servers.rb
index 8da303c38..2eacbe64b 100644
--- a/test/integration/verify/controls/azurerm_postgresql_servers.rb
+++ b/test/integration/verify/controls/azure_postgresql_servers.rb
@@ -1,15 +1,15 @@
resource_group = input('resource_group', value: nil)
postgresql_server_name = input('postgresql_server_name', value: nil)
-control 'azurerm_postgresql_servers' do
+control 'azure_postgresql_servers' do
only_if { !postgresql_server_name.nil? }
- describe azurerm_postgresql_servers(resource_group: resource_group) do
+ describe azure_postgresql_servers(resource_group: resource_group) do
it { should exist }
its('names') { should include postgresql_server_name }
end
- describe azurerm_postgresql_servers do
+ describe azure_postgresql_servers do
it { should exist }
its('names') { should include postgresql_server_name }
end
diff --git a/test/integration/verify/controls/azurerm_public_ip.rb b/test/integration/verify/controls/azure_public_ip.rb
similarity index 72%
rename from test/integration/verify/controls/azurerm_public_ip.rb
rename to test/integration/verify/controls/azure_public_ip.rb
index 4e811cf25..dbaed4892 100644
--- a/test/integration/verify/controls/azurerm_public_ip.rb
+++ b/test/integration/verify/controls/azure_public_ip.rb
@@ -1,9 +1,9 @@
resource_group = input('resource_group', value: nil)
address_name = input('ip_address_name', value: '')
-control 'azurerm_public_ip' do
+control 'azure_public_ip' do
only_if { !address_name.empty? }
- describe azurerm_public_ip(resource_group: resource_group, name: address_name) do
+ describe azure_public_ip(resource_group: resource_group, name: address_name) do
it { should exist }
its('name') { should cmp address_name }
its('type') { should cmp 'Microsoft.Network/publicIPAddresses' }
@@ -11,11 +11,11 @@
its('properties.publicIPAddressVersion') { should eq 'IPv4' }
end
- describe azurerm_public_ip(resource_group: resource_group, name: 'fake') do
+ describe azure_public_ip(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_public_ip(resource_group: 'does-not-exist', name: 'fake') do
+ describe azure_public_ip(resource_group: 'does-not-exist', name: 'fake') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_resource_groups.rb b/test/integration/verify/controls/azure_resource_groups.rb
similarity index 82%
rename from test/integration/verify/controls/azurerm_resource_groups.rb
rename to test/integration/verify/controls/azure_resource_groups.rb
index 04addb174..a4b58380a 100644
--- a/test/integration/verify/controls/azurerm_resource_groups.rb
+++ b/test/integration/verify/controls/azure_resource_groups.rb
@@ -3,14 +3,14 @@
# Added to test `inspec check` command
resource_group_names = azure_resource_groups.names
-control 'azurerm_resource_groups' do
- describe azurerm_resource_groups do
+control 'azure_resource_groups' do
+ describe azure_resource_groups do
it { should exist }
its('names') { should include(resource_group) }
its('names.size') { should eq resource_group_names.size }
end
- describe azurerm_resource_groups.where(name: resource_group) do
+ describe azure_resource_groups.where(name: resource_group) do
its('tags.first') { should include('ExampleTag'=>'example') }
end
end
diff --git a/test/integration/verify/controls/azurerm_role_definition.rb b/test/integration/verify/controls/azure_role_definition.rb
similarity index 79%
rename from test/integration/verify/controls/azurerm_role_definition.rb
rename to test/integration/verify/controls/azure_role_definition.rb
index 15de78249..d2b4e3e76 100644
--- a/test/integration/verify/controls/azurerm_role_definition.rb
+++ b/test/integration/verify/controls/azure_role_definition.rb
@@ -1,7 +1,7 @@
contributor_name = input('contributor_role_name', value: nil)
-control 'azurerm_role_definition' do
- describe azurerm_role_definition(name: contributor_name) do
+control 'azure_role_definition' do
+ describe azure_role_definition(name: contributor_name) do
it { should exist }
its('permissions_allowed') { should include '*' }
its('role_name') { should cmp 'Contributor' }
diff --git a/test/integration/verify/controls/azurerm_role_definitions.rb b/test/integration/verify/controls/azure_role_definitions.rb
similarity index 73%
rename from test/integration/verify/controls/azurerm_role_definitions.rb
rename to test/integration/verify/controls/azure_role_definitions.rb
index b012766f3..ee089bde2 100644
--- a/test/integration/verify/controls/azurerm_role_definitions.rb
+++ b/test/integration/verify/controls/azure_role_definitions.rb
@@ -1,7 +1,7 @@
contributor_name = input('contributor_role_name', value: nil)
-control 'azurerm_role_definitions' do
- describe azurerm_role_definitions.where(name: contributor_name) do
+control 'azure_role_definitions' do
+ describe azure_role_definitions.where(name: contributor_name) do
its('names') { should include contributor_name }
its('properties.first') { should have_attributes(roleName: 'Contributor') }
its('properties.first.permissions.first') { should have_attributes(actions: ['*']) }
diff --git a/test/integration/verify/controls/azurerm_security_center_policies.rb b/test/integration/verify/controls/azure_security_center_policies.rb
similarity index 53%
rename from test/integration/verify/controls/azurerm_security_center_policies.rb
rename to test/integration/verify/controls/azure_security_center_policies.rb
index 2a745fd58..cb22fe13d 100644
--- a/test/integration/verify/controls/azurerm_security_center_policies.rb
+++ b/test/integration/verify/controls/azure_security_center_policies.rb
@@ -1,5 +1,5 @@
-control 'azurerm_security_center_policies' do
- describe azurerm_security_center_policies do
+control 'azure_security_center_policies' do
+ describe azure_security_center_policies do
it { should exist }
its('policy_names') { should include('default') }
end
diff --git a/test/integration/verify/controls/azurerm_security_center_policy.rb b/test/integration/verify/controls/azure_security_center_policy.rb
similarity index 95%
rename from test/integration/verify/controls/azurerm_security_center_policy.rb
rename to test/integration/verify/controls/azure_security_center_policy.rb
index c7aaca92e..c85d96d2d 100644
--- a/test/integration/verify/controls/azurerm_security_center_policy.rb
+++ b/test/integration/verify/controls/azure_security_center_policy.rb
@@ -1,4 +1,4 @@
-control 'azurerm_security_center_policy' do
+control 'azure_security_center_policy' do
desc <<-DESC
This control is asserting state on global settings outside the control of
Terraform. I will only be asserting on the expectation that things will be
@@ -10,7 +10,7 @@
Security Policy names match resource group names.
DESC
- describe azurerm_security_center_policy(name: 'default') do
+ describe azure_security_center_policy(name: 'default') do
it { should exist }
# if this fails run 'az security auto-provisioning-setting update -n "default" --auto-provision "On"'
it { should have_auto_provisioning_enabled }
diff --git a/test/integration/verify/controls/azurerm_sql_database.rb b/test/integration/verify/controls/azure_sql_database.rb
similarity index 90%
rename from test/integration/verify/controls/azurerm_sql_database.rb
rename to test/integration/verify/controls/azure_sql_database.rb
index a8524e2f9..22a36dc4f 100644
--- a/test/integration/verify/controls/azurerm_sql_database.rb
+++ b/test/integration/verify/controls/azure_sql_database.rb
@@ -2,10 +2,10 @@
sql_server_name = input('sql_server_name', value: nil)
sql_db_name = input('sql_database_name', value: nil)
-control 'azurerm_sql_database' do
+control 'azure_sql_database' do
only_if { !sql_db_name.nil? }
- describe azurerm_sql_database(resource_group: resource_group,
+ describe azure_sql_database(resource_group: resource_group,
server_name: sql_server_name,
database_name: sql_db_name) do
it { should exist }
diff --git a/test/integration/verify/controls/azurerm_sql_databases.rb b/test/integration/verify/controls/azure_sql_databases.rb
similarity index 70%
rename from test/integration/verify/controls/azurerm_sql_databases.rb
rename to test/integration/verify/controls/azure_sql_databases.rb
index 03afc834b..6cd066c93 100644
--- a/test/integration/verify/controls/azurerm_sql_databases.rb
+++ b/test/integration/verify/controls/azure_sql_databases.rb
@@ -2,10 +2,10 @@
sql_server_name = input('sql_server_name', value: nil)
sql_server_database = input('sql_database_name', value: nil)
-control 'azurerm_sql_databases' do
+control 'azure_sql_databases' do
only_if { !sql_server_database.nil? }
- describe azurerm_sql_databases(resource_group: resource_group, server_name: sql_server_name) do
+ describe azure_sql_databases(resource_group: resource_group, server_name: sql_server_name) do
it { should exist }
its('names') { should include sql_server_database }
end
diff --git a/test/integration/verify/controls/azurerm_sql_server.rb b/test/integration/verify/controls/azure_sql_server.rb
similarity index 79%
rename from test/integration/verify/controls/azurerm_sql_server.rb
rename to test/integration/verify/controls/azure_sql_server.rb
index f95387994..543ed5cdc 100644
--- a/test/integration/verify/controls/azurerm_sql_server.rb
+++ b/test/integration/verify/controls/azure_sql_server.rb
@@ -1,10 +1,10 @@
resource_group = input('resource_group', value: nil)
sql_server_name = input('sql_server_name', value: nil)
-control 'azurerm_sql_server' do
+control 'azure_sql_server' do
only_if { !sql_server_name.nil? }
- describe azurerm_sql_server(resource_group: resource_group, server_name: sql_server_name) do
+ describe azure_sql_server(resource_group: resource_group, server_name: sql_server_name) do
it { should exist }
its('id') { should_not be_nil }
its('name') { should eq sql_server_name }
diff --git a/test/integration/verify/controls/azurerm_sql_servers.rb b/test/integration/verify/controls/azure_sql_servers.rb
similarity index 78%
rename from test/integration/verify/controls/azurerm_sql_servers.rb
rename to test/integration/verify/controls/azure_sql_servers.rb
index bdb4f94ae..b541e140d 100644
--- a/test/integration/verify/controls/azurerm_sql_servers.rb
+++ b/test/integration/verify/controls/azure_sql_servers.rb
@@ -1,10 +1,10 @@
resource_group = input('resource_group', value: nil)
sql_server_name = input('sql_server_name', value: nil)
-control 'azurerm_sql_servers' do
+control 'azure_sql_servers' do
only_if { !sql_server_name.nil? }
- describe azurerm_sql_servers(resource_group: resource_group) do
+ describe azure_sql_servers(resource_group: resource_group) do
it { should exist }
its('names') { should include sql_server_name }
end
diff --git a/test/integration/verify/controls/azurerm_storage_account_blob_container.rb b/test/integration/verify/controls/azure_storage_account_blob_container.rb
similarity index 76%
rename from test/integration/verify/controls/azurerm_storage_account_blob_container.rb
rename to test/integration/verify/controls/azure_storage_account_blob_container.rb
index cddfb6fa6..f0b2283af 100644
--- a/test/integration/verify/controls/azurerm_storage_account_blob_container.rb
+++ b/test/integration/verify/controls/azure_storage_account_blob_container.rb
@@ -2,8 +2,8 @@
storage_account = input('storage_account', value: nil)
blob_container = input('storage_account_blob_container', value: nil)
-control 'azurerm_storage_account_blob_container' do
- describe azurerm_storage_account_blob_container(resource_group: resource_group,
+control 'azure_storage_account_blob_container' do
+ describe azure_storage_account_blob_container(resource_group: resource_group,
storage_account_name: storage_account,
blob_container_name: blob_container) do
it { should exist }
diff --git a/test/integration/verify/controls/azurerm_storage_account_blob_containers.rb b/test/integration/verify/controls/azure_storage_account_blob_containers.rb
similarity index 71%
rename from test/integration/verify/controls/azurerm_storage_account_blob_containers.rb
rename to test/integration/verify/controls/azure_storage_account_blob_containers.rb
index 124cde2c2..5b21a181f 100644
--- a/test/integration/verify/controls/azurerm_storage_account_blob_containers.rb
+++ b/test/integration/verify/controls/azure_storage_account_blob_containers.rb
@@ -2,8 +2,8 @@
storage_account = input('storage_account', value: nil)
blob_container = input('storage_account_blob_container', value: nil)
-control 'azurerm_storage_account_blob_containers' do
- describe azurerm_storage_account_blob_containers(resource_group: resource_group,
+control 'azure_storage_account_blob_containers' do
+ describe azure_storage_account_blob_containers(resource_group: resource_group,
storage_account_name: storage_account) do
its('names') { should include(blob_container) }
end
diff --git a/test/integration/verify/controls/azurerm_subnet.rb b/test/integration/verify/controls/azure_subnet.rb
similarity index 78%
rename from test/integration/verify/controls/azurerm_subnet.rb
rename to test/integration/verify/controls/azure_subnet.rb
index db5d905ce..c194586ba 100644
--- a/test/integration/verify/controls/azurerm_subnet.rb
+++ b/test/integration/verify/controls/azure_subnet.rb
@@ -5,8 +5,8 @@
address_prefix = input('subnet_address_prefix', value: nil)
nsg = input('subnet_nsg', value: nil)
-control 'azurerm_subnet' do
- describe azurerm_subnet(resource_group: resource_group, vnet: vnet, name: name) do
+control 'azure_subnet' do
+ describe azure_subnet(resource_group: resource_group, vnet: vnet, name: name) do
it { should exist }
its('id') { should eq id }
its('name') { should eq name }
@@ -15,11 +15,11 @@
its('nsg') { should eq nsg }
end
- describe azurerm_subnet(resource_group: resource_group, vnet: vnet, name: 'fake') do
+ describe azure_subnet(resource_group: resource_group, vnet: vnet, name: 'fake') do
it { should_not exist }
end
- describe azurerm_subnet(resource_group: 'does-not-exist', vnet: vnet, name: name) do
+ describe azure_subnet(resource_group: 'does-not-exist', vnet: vnet, name: name) do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_subnets.rb b/test/integration/verify/controls/azure_subnets.rb
similarity index 63%
rename from test/integration/verify/controls/azurerm_subnets.rb
rename to test/integration/verify/controls/azure_subnets.rb
index 7fbee71ae..895e5db9e 100644
--- a/test/integration/verify/controls/azurerm_subnets.rb
+++ b/test/integration/verify/controls/azure_subnets.rb
@@ -2,24 +2,24 @@
vnet = input('vnet_name', value: nil)
subnet = input('subnet_name', value: nil)
-control 'azurerm_subnets' do
- describe azurerm_subnets(resource_group: resource_group, vnet: vnet) do
+control 'azure_subnets' do
+ describe azure_subnets(resource_group: resource_group, vnet: vnet) do
it { should exist }
its('names') { should be_an(Array) }
its('names') { should include(subnet) }
end
- describe azurerm_subnets(resource_group: 'fake-group', vnet: vnet) do
+ describe azure_subnets(resource_group: 'fake-group', vnet: vnet) do
it { should_not exist }
its('names') { should_not include('fake') }
end
- describe azurerm_subnets(resource_group: resource_group, vnet: 'fake') do
+ describe azure_subnets(resource_group: resource_group, vnet: 'fake') do
it { should_not exist }
its('names') { should_not include('fake') }
end
- describe azurerm_subnets(resource_group: resource_group, vnet: vnet)
+ describe azure_subnets(resource_group: resource_group, vnet: vnet)
.where(name: subnet) do
it { should exist }
end
diff --git a/test/integration/verify/controls/azurerm_subscription.rb b/test/integration/verify/controls/azure_subscription.rb
similarity index 87%
rename from test/integration/verify/controls/azurerm_subscription.rb
rename to test/integration/verify/controls/azure_subscription.rb
index 55a2ee8a5..baca35c83 100644
--- a/test/integration/verify/controls/azurerm_subscription.rb
+++ b/test/integration/verify/controls/azure_subscription.rb
@@ -1,6 +1,6 @@
-control 'azurerm_subscription' do
+control 'azure_subscription' do
- describe azurerm_subscription do
+ describe azure_subscription do
its('name') { should_not be_nil }
its('locations') { should include 'eastus' }
end
diff --git a/test/integration/verify/controls/azurerm_virtual_machine.rb b/test/integration/verify/controls/azure_virtual_machine.rb
similarity index 84%
rename from test/integration/verify/controls/azurerm_virtual_machine.rb
rename to test/integration/verify/controls/azure_virtual_machine.rb
index e678e5065..b43c86a92 100644
--- a/test/integration/verify/controls/azurerm_virtual_machine.rb
+++ b/test/integration/verify/controls/azure_virtual_machine.rb
@@ -7,8 +7,8 @@
win_data_disk_names = input('windows_vm_data_disks', value: nil)
win_monitoring_agent_name = input('monitoring_agent_name', value: nil)
-control 'azurerm_virtual_machine' do
- describe azurerm_virtual_machine(resource_group: resource_group, name: win_name) do
+control 'azure_virtual_machine' do
+ describe azure_virtual_machine(resource_group: resource_group, name: win_name) do
it { should exist }
it { should have_monitoring_agent_installed }
it { should_not have_endpoint_protection_installed([]) }
@@ -25,15 +25,15 @@
its('installed_extensions_names') { should include(win_monitoring_agent_name) }
end
- describe azurerm_virtual_machine(resource_group: resource_group, name: 'fake') do
+ describe azure_virtual_machine(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_virtual_machine(resource_group: 'does-not-exist', name: win_name) do
+ describe azure_virtual_machine(resource_group: 'does-not-exist', name: win_name) do
it { should_not exist }
end
- describe azurerm_virtual_machine(resource_group: resource_group, name: win_name) do
+ describe azure_virtual_machine(resource_group: resource_group, name: win_name) do
its('properties.osProfile.linuxConfiguration.ssh') { should be_nil }
end
end
diff --git a/test/integration/verify/controls/azurerm_virtual_machine_disk.rb b/test/integration/verify/controls/azure_virtual_machine_disk.rb
similarity index 77%
rename from test/integration/verify/controls/azurerm_virtual_machine_disk.rb
rename to test/integration/verify/controls/azure_virtual_machine_disk.rb
index 888f1356d..31a9b3d18 100644
--- a/test/integration/verify/controls/azurerm_virtual_machine_disk.rb
+++ b/test/integration/verify/controls/azure_virtual_machine_disk.rb
@@ -4,8 +4,8 @@
encrypted_disk_name = input('encrypted_disk_name', value: nil)
unmanaged_disk_name = input('unamaged_disk_name', value: nil)
-control 'azurerm_virtual_machine_disk' do
- describe azurerm_virtual_machine_disk(resource_group: resource_group, name: encrypted_disk_name) do
+control 'azure_virtual_machine_disk' do
+ describe azure_virtual_machine_disk(resource_group: resource_group, name: encrypted_disk_name) do
it { should exist }
its('id') { should eq "/subscriptions/#{ENV['AZURE_SUBSCRIPTION_ID']}/resourceGroups/#{resource_group}/providers/Microsoft.Compute/disks/#{encrypted_disk_name}" }
its('name') { should eq(encrypted_disk_name) }
@@ -18,11 +18,11 @@
its('properties') { should_not be_nil }
end
- describe azurerm_virtual_machine_disk(resource_group: resource_group, name: attached_disk_name) do
+ describe azure_virtual_machine_disk(resource_group: resource_group, name: attached_disk_name) do
it { should be_attached }
end
- describe azurerm_virtual_machine_disk(resource_group: resource_group, name: unmanaged_disk_name) do
+ describe azure_virtual_machine_disk(resource_group: resource_group, name: unmanaged_disk_name) do
it { should_not exist }
its('encryption_enabled') { should be_nil }
end
diff --git a/test/integration/verify/controls/azurerm_virtual_machine_disks.rb b/test/integration/verify/controls/azure_virtual_machine_disks.rb
similarity index 65%
rename from test/integration/verify/controls/azurerm_virtual_machine_disks.rb
rename to test/integration/verify/controls/azure_virtual_machine_disks.rb
index 8fc5b09b0..7252c2f37 100644
--- a/test/integration/verify/controls/azurerm_virtual_machine_disks.rb
+++ b/test/integration/verify/controls/azure_virtual_machine_disks.rb
@@ -1,18 +1,18 @@
rg = input('resource_group', value: nil)
windows_vm_os_disk = input('windows_vm_os_disk', value: nil)
-control 'azurerm_virtual_machine_disks' do
- describe azurerm_virtual_machine_disks do
+control 'azure_virtual_machine_disks' do
+ describe azure_virtual_machine_disks do
it { should exist }
its('names') { should include windows_vm_os_disk }
end
# rubocop:disable Lint/AmbiguousBlockAssociation
- describe azurerm_virtual_machine_disks.where { attached == true } do
+ describe azure_virtual_machine_disks.where { attached == true } do
its('names') { should include windows_vm_os_disk }
end
- describe azurerm_virtual_machine_disks.where { resource_group.casecmp(rg) } do
+ describe azure_virtual_machine_disks.where { resource_group.casecmp(rg) } do
its('names') { should include windows_vm_os_disk }
end
# rubocop:enable Lint/AmbiguousBlockAssociation
diff --git a/test/integration/verify/controls/azurerm_virtual_machines.rb b/test/integration/verify/controls/azure_virtual_machines.rb
similarity index 86%
rename from test/integration/verify/controls/azurerm_virtual_machines.rb
rename to test/integration/verify/controls/azure_virtual_machines.rb
index cc95d5a71..746995b42 100644
--- a/test/integration/verify/controls/azurerm_virtual_machines.rb
+++ b/test/integration/verify/controls/azure_virtual_machines.rb
@@ -12,15 +12,15 @@
windows_data_disks = data_disks.select { |disk| disk.match(/windows/i) }
linux_data_disks = data_disks.select { |disk| disk.match(/linux/i) }
-control 'azurerm_virtual_machines' do
- describe azurerm_virtual_machines(resource_group: resource_group) do
+control 'azure_virtual_machines' do
+ describe azure_virtual_machines(resource_group: resource_group) do
it { should exist }
its('vm_names.sort') { should eq vm_names.sort }
its('os_disks.sort') { should eq os_disks.sort }
its('data_disks.flatten.sort') { should include(data_disks.first) }
end
- describe azurerm_virtual_machines(resource_group: resource_group)
+ describe azure_virtual_machines(resource_group: resource_group)
.where(platform: 'windows') do
it { should exist }
its('vm_names.sort') { should eq windows_vm_names.sort }
@@ -28,7 +28,7 @@
its('data_disks.flatten.sort') { should eq windows_data_disks.sort }
end
- describe azurerm_virtual_machines(resource_group: resource_group)
+ describe azure_virtual_machines(resource_group: resource_group)
.where(platform: 'linux') do
it { should exist }
its('vm_names.sort') { should eq linux_vm_names.sort }
@@ -36,7 +36,7 @@
its('data_disks.flatten.sort') { should eq linux_data_disks.sort }
end
- describe azurerm_virtual_machines(resource_group: 'fake-group') do
+ describe azure_virtual_machines(resource_group: 'fake-group') do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_virtual_network.rb b/test/integration/verify/controls/azure_virtual_network.rb
similarity index 86%
rename from test/integration/verify/controls/azurerm_virtual_network.rb
rename to test/integration/verify/controls/azure_virtual_network.rb
index e4bf9b320..c6274ceef 100644
--- a/test/integration/verify/controls/azurerm_virtual_network.rb
+++ b/test/integration/verify/controls/azure_virtual_network.rb
@@ -10,8 +10,8 @@
enable_ddos = input('vnet_enable_ddos_protection', value: false)
enable_vm_protection = input('vnet_enable_vm_protection', value: false)
-control 'azurerm_virtual_network' do
- describe azurerm_virtual_network(resource_group: resource_group, name: vnet) do
+control 'azure_virtual_network' do
+ describe azure_virtual_network(resource_group: resource_group, name: vnet) do
it { should exist }
its('id') { should eq vnet_id }
its('name') { should eq vnet }
@@ -26,11 +26,11 @@
its('enable_vm_protection') { should eq enable_vm_protection }
end
- describe azurerm_virtual_network(resource_group: resource_group, name: 'fake') do
+ describe azure_virtual_network(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
- describe azurerm_virtual_network(resource_group: 'does-not-exist', name: vnet) do
+ describe azure_virtual_network(resource_group: 'does-not-exist', name: vnet) do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_virtual_network_peering.rb b/test/integration/verify/controls/azure_virtual_network_peering.rb
similarity index 61%
rename from test/integration/verify/controls/azurerm_virtual_network_peering.rb
rename to test/integration/verify/controls/azure_virtual_network_peering.rb
index 0f67dd4da..f62b2261f 100644
--- a/test/integration/verify/controls/azurerm_virtual_network_peering.rb
+++ b/test/integration/verify/controls/azure_virtual_network_peering.rb
@@ -3,19 +3,19 @@
id = input('virtual_network_peering_id', value: nil)
vnet = input('vnet_name', value: nil)
-control 'azurerm_virtual_network_peering' do
- describe azurerm_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: name) do
+control 'azure_virtual_network_peering' do
+ describe azure_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: name) do
it { should exist }
its('id') { should eq id }
its('name') { should eq name }
its('peering_state') { should eq 'Connected' }
end
- describe azurerm_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: 'fake') do
+ describe azure_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: 'fake') do
it { should_not exist }
end
- describe azurerm_virtual_network_peering(resource_group: 'does-not-exist', vnet: vnet, name: name) do
+ describe azure_virtual_network_peering(resource_group: 'does-not-exist', vnet: vnet, name: name) do
it { should_not exist }
end
end
diff --git a/test/integration/verify/controls/azurerm_virtual_network_peerings.rb b/test/integration/verify/controls/azure_virtual_network_peerings.rb
similarity index 59%
rename from test/integration/verify/controls/azurerm_virtual_network_peerings.rb
rename to test/integration/verify/controls/azure_virtual_network_peerings.rb
index 570686502..a47230ed9 100644
--- a/test/integration/verify/controls/azurerm_virtual_network_peerings.rb
+++ b/test/integration/verify/controls/azure_virtual_network_peerings.rb
@@ -2,18 +2,18 @@
name = input('virtual_network_peering_name', value: nil)
vnet = input('vnet_name', value: nil)
-control 'azurerm_virtual_network_peerings' do
- describe azurerm_virtual_network_peerings(resource_group: resource_group, vnet: vnet) do
+control 'azure_virtual_network_peerings' do
+ describe azure_virtual_network_peerings(resource_group: resource_group, vnet: vnet) do
it { should exist }
its('names') { should include(name) }
end
- describe azurerm_virtual_network_peerings(resource_group: 'fake-group', vnet: vnet) do
+ describe azure_virtual_network_peerings(resource_group: 'fake-group', vnet: vnet) do
it { should_not exist }
its('names') { should_not include('fake') }
end
- describe azurerm_virtual_network_peerings(resource_group: resource_group, vnet: vnet)
+ describe azure_virtual_network_peerings(resource_group: resource_group, vnet: vnet)
.where(name: name) do
it { should exist }
end
diff --git a/test/integration/verify/controls/azurerm_virtual_networks.rb b/test/integration/verify/controls/azure_virtual_networks.rb
similarity index 73%
rename from test/integration/verify/controls/azurerm_virtual_networks.rb
rename to test/integration/verify/controls/azure_virtual_networks.rb
index 581fde817..b22000af8 100644
--- a/test/integration/verify/controls/azurerm_virtual_networks.rb
+++ b/test/integration/verify/controls/azure_virtual_networks.rb
@@ -1,19 +1,19 @@
resource_group = input('resource_group', value: nil)
vnet = input('vnet_name', value: nil)
-control 'azurerm_virtual_networks' do
- describe azurerm_virtual_networks(resource_group: resource_group) do
+control 'azure_virtual_networks' do
+ describe azure_virtual_networks(resource_group: resource_group) do
it { should exist }
its('names') { should be_an(Array) }
its('names') { should include(vnet) }
end
- describe azurerm_virtual_networks(resource_group: 'fake-group') do
+ describe azure_virtual_networks(resource_group: 'fake-group') do
it { should_not exist }
its('names') { should_not include('fake') }
end
- describe azurerm_virtual_networks(resource_group: resource_group)
+ describe azure_virtual_networks(resource_group: resource_group)
.where(name: vnet) do
it { should exist }
end
diff --git a/test/integration/verify/controls/azurerm_webapp.rb b/test/integration/verify/controls/azure_webapp.rb
similarity index 72%
rename from test/integration/verify/controls/azurerm_webapp.rb
rename to test/integration/verify/controls/azure_webapp.rb
index edd056052..86aba7868 100644
--- a/test/integration/verify/controls/azurerm_webapp.rb
+++ b/test/integration/verify/controls/azure_webapp.rb
@@ -1,8 +1,8 @@
resource_group = input('resource_group', value: nil)
webapp_name = input('webapp_name', value: nil)
-control 'azurerm_webapp' do
- describe azurerm_webapp(resource_group: resource_group, name: webapp_name) do
+control 'azure_webapp' do
+ describe azure_webapp(resource_group: resource_group, name: webapp_name) do
it { should have_identity }
it { should be_using_latest('aspnet') }
its('properties') { should have_attributes(httpsOnly: true) }
diff --git a/test/integration/verify/controls/azurerm_webapps.rb b/test/integration/verify/controls/azure_webapps.rb
similarity index 66%
rename from test/integration/verify/controls/azurerm_webapps.rb
rename to test/integration/verify/controls/azure_webapps.rb
index d2863f5d8..602df5de6 100644
--- a/test/integration/verify/controls/azurerm_webapps.rb
+++ b/test/integration/verify/controls/azure_webapps.rb
@@ -1,8 +1,8 @@
resource_group = input('resource_group', value: nil)
webapp_name = input('webapp_name', value: nil)
-control 'azurerm_webapps' do
- describe azurerm_webapps(resource_group: resource_group) do
+control 'azure_webapps' do
+ describe azure_webapps(resource_group: resource_group) do
it { should exist }
its('names') { should include webapp_name }
end
diff --git a/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb b/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb
deleted file mode 100644
index a214e1e5b..000000000
--- a/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-control 'azurerm_monitor_activity_log_alerts' do
- describe azurerm_monitor_activity_log_alerts do
- its('names') { should include('defaultLogAlert_5_3') }
- end
-end