Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table azure_security_center_subscription_pricing. Closes #120 #135

Merged
merged 17 commits into from
May 19, 2021

Conversation

bigdatasourav
Copy link
Contributor

Integration test logs

Logs

SETUP: tests/azure_security_center_subscription_pricing []

PRETEST: tests/azure_security_center_subscription_pricing

TEST: tests/azure_security_center_subscription_pricing
Running terraform
azurerm_security_center_subscription_pricing.named_test_resource: Creating...
azurerm_security_center_subscription_pricing.named_test_resource: Creation complete after 7s [id=/subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/Microsoft.Security/pricings/VirtualMachines]

Warning: Deprecated Resource

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Warning: Version constraints inside provider configuration blocks are deprecated

  on variables.tf line 22, in provider "azurerm":
  22:   version = "=2.43.0"

Terraform 0.13 and earlier allowed provider version constraints inside the
provider configuration block, but that is now deprecated and will be removed
in a future version of Terraform. To silence this warning, move the provider
version constraint into the required_providers block.


Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Outputs:

resource_aka = "azure:///subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/Microsoft.Security/pricings/VirtualMachines"
resource_aka_lower = "azure:///subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/microsoft.security/pricings/virtualmachines"
resource_id = "/subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/Microsoft.Security/pricings/VirtualMachines"
resource_name = "VirtualMachines"
subscription_id = "d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/Microsoft.Security/pricings/VirtualMachines",
    "name": "VirtualMachines",
    "type": "Microsoft.Security/pricings"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/Microsoft.Security/pricings/VirtualMachines",
    "name": "VirtualMachines"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/Microsoft.Security/pricings/VirtualMachines",
      "azure:///subscriptions/d7245080-b4ae-4fe5-b6fa-2e71b3dae6c8/providers/microsoft.security/pricings/virtualmachines"
    ],
    "name": "VirtualMachines",
    "title": "VirtualMachines"
  }
]
✔ PASSED

POSTTEST: tests/azure_security_center_subscription_pricing

TEARDOWN: tests/azure_security_center_subscription_pricing

SUMMARY:

1/1 passed.

Example query results

Results
> select * from azure_security_center_subscription_pricing where name = 'VirtualMachines'
+-----------------------------------------------------------------------------------------------------------+-----------------+--------------+---------------------------+-----------------------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+
| id                                                                                                        | name            | pricing_tier | free_trial_remaining_time | type                        | title           | akas                                                                                                                                                                                                                                      | subscription_id                      |
+-----------------------------------------------------------------------------------------------------------+-----------------+--------------+---------------------------+-----------------------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/VirtualMachines | VirtualMachines | Free         | PT0S                      | Microsoft.Security/pricings | VirtualMachines | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/VirtualMachines","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/virtualmachines"] | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
+-----------------------------------------------------------------------------------------------------------+-----------------+--------------+---------------------------+-----------------------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+

Time: 1.119585ms
> select * from azure_security_center_subscription_pricing where name = 'VirtualMachines123'
+----+------+--------------+---------------------------+------+-------+------+-----------------+
| id | name | pricing_tier | free_trial_remaining_time | type | title | akas | subscription_id |
+----+------+--------------+---------------------------+------+-------+------+-----------------+
+----+------+--------------+---------------------------+------+-------+------+-----------------+

Time: 1.361083ms
> select * from azure_security_center_subscription_pricing
+-------------------------------------------------------------------------------------------------------------------------+-------------------------------+--------------+---------------------------+-----------------------------+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+
| id                                                                                                                      | name                          | pricing_tier | free_trial_remaining_time | type                        | title                         | akas                                                                                                                                                                                                                                                                  | subscription_id                      |
+-------------------------------------------------------------------------------------------------------------------------+-------------------------------+--------------+---------------------------+-----------------------------+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/VirtualMachines               | VirtualMachines               | Free         | PT0S                      | Microsoft.Security/pricings | VirtualMachines               | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/VirtualMachines","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/virtualmachines"]                             | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/ContainerRegistry             | ContainerRegistry             | Free         | PT0S                      | Microsoft.Security/pricings | ContainerRegistry             | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/ContainerRegistry","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/containerregistry"]                         | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/StorageAccounts               | StorageAccounts               | Free         | PT0S                      | Microsoft.Security/pricings | StorageAccounts               | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/StorageAccounts","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/storageaccounts"]                             | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/SqlServers                    | SqlServers                    | Free         | PT0S                      | Microsoft.Security/pricings | SqlServers                    | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/SqlServers","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/sqlservers"]                                       | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/KubernetesService             | KubernetesService             | Free         | PT0S                      | Microsoft.Security/pricings | KubernetesService             | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/KubernetesService","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/kubernetesservice"]                         | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/Arm                           | Arm                           | Free         | PT0S                      | Microsoft.Security/pricings | Arm                           | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/Arm","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/arm"]                                                     | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/Dns                           | Dns                           | Free         | PT0S                      | Microsoft.Security/pricings | Dns                           | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/Dns","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/dns"]                                                     | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/AppServices                   | AppServices                   | Free         | PT0S                      | Microsoft.Security/pricings | AppServices                   | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/AppServices","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/appservices"]                                     | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/OpenSourceRelationalDatabases | OpenSourceRelationalDatabases | Free         | PT0S                      | Microsoft.Security/pricings | OpenSourceRelationalDatabases | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/OpenSourceRelationalDatabases","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/opensourcerelationaldatabases"] | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/KeyVaults                     | KeyVaults                     | Free         | PT0S                      | Microsoft.Security/pricings | KeyVaults                     | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/KeyVaults","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/keyvaults"]                                         | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/SqlServerVirtualMachines      | SqlServerVirtualMachines      | Free         | PT0S                      | Microsoft.Security/pricings | SqlServerVirtualMachines      | ["azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Security/pricings/SqlServerVirtualMachines","azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.security/pricings/sqlservervirtualmachines"]           | 3510ae4d-530b-497d-8f30-53b9616fc6c1 |
+-------------------------------------------------------------------------------------------------------------------------+-------------------------------+--------------+---------------------------+-----------------------------+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+

Time: 1.524699ms

@bigdatasourav bigdatasourav requested a review from LalitLab May 19, 2021 13:15
@bigdatasourav bigdatasourav self-assigned this May 19, 2021
@bigdatasourav bigdatasourav linked an issue May 19, 2021 that may be closed by this pull request
Copy link
Contributor

@LalitLab LalitLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LalitLab LalitLab requested a review from rajlearner17 May 19, 2021 13:33
@bigdatasourav
Copy link
Contributor Author

CIS - 2.1 to 2.8 --
If the value of the pricing_tier is 'Standard' then defender is enabled.

Copy link
Contributor

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cbruno10 cbruno10 merged commit 41f8bdc into main May 19, 2021
@cbruno10 cbruno10 deleted the issue-120 branch May 19, 2021 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table azure_security_center_subscription_pricing
4 participants