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_eventhub_namespace. Closes #197 #201

Merged
merged 8 commits into from
Jul 28, 2021
Merged

Add table azure_eventhub_namespace. Closes #197 #201

merged 8 commits into from
Jul 28, 2021

Conversation

khushboo9024
Copy link
Contributor

@khushboo9024 khushboo9024 commented Jul 26, 2021

Integration test logs

Logs
No env file present for the current environment:  staging 
 Falling back to .env config
No env file present for the current environment:  staging
customEnv TURBOT_TEST_EXPECTED_TIMEOUT 300

SETUP: tests/azure_eventhub_namespace []

PRETEST: tests/azure_eventhub_namespace

TEST: tests/azure_eventhub_namespace
Running terraform
data.azurerm_client_config.current: Refreshing state...
data.null_data_source.resource: Refreshing state...
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 4s [id=/subscriptions/********-****-****-****-************/resourceGroups/turbottest81060]
azurerm_eventhub_namespace.named_test_resource: Creating...
azurerm_eventhub_namespace.named_test_resource: Still creating... [10s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [20s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [30s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [40s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [50s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [1m0s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [1m10s elapsed]
azurerm_eventhub_namespace.named_test_resource: Creation complete after 1m15s [id=/subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060]

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


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

Outputs:

location = westus
resource_aka = azure:///subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060
resource_aka_lower = azure:///subscriptions/********-****-****-****-************/resourcegroups/turbottest81060/providers/microsoft.eventhub/namespaces/turbottest81060
resource_id = /subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060
resource_name = turbottest81060
subscription_id = ********-****-****-****-************

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060",
    "is_auto_inflate_enabled": false,
    "kafka_enabled": true,
    "name": "turbottest81060",
    "region": "westus",
    "resource_group": "turbottest81060",
    "type": "Microsoft.EventHub/Namespaces"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060",
      "azure:///subscriptions/********-****-****-****-************/resourcegroups/turbottest81060/providers/microsoft.eventhub/namespaces/turbottest81060"
    ],
    "name": "turbottest81060",
    "tags": {
      "name": "turbottest81060"
    },
    "title": "turbottest81060"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060",
    "name": "turbottest81060"
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/********-****-****-****-************/resourceGroups/turbottest81060/providers/Microsoft.EventHub/namespaces/turbottest81060",
      "azure:///subscriptions/********-****-****-****-************/resourcegroups/turbottest81060/providers/microsoft.eventhub/namespaces/turbottest81060"
    ],
    "name": "turbottest81060",
    "tags": {
      "name": "turbottest81060"
    },
    "title": "turbottest81060"
  }
]
✔ PASSED

POSTTEST: tests/azure_eventhub_namespace

TEARDOWN: tests/azure_eventhub_namespace

SUMMARY:

1/1 passed.

Example query results

Results
## Examples

### Basic info

```sql
select
  name,
  id,
  type,
  provisioning_state,
  created_at
from
  azure_eventhub_namespace;
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+--------------------+--------------------------+
| name         | id                                                                                                                           | type                          | provisioning_state | created_at               |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+--------------------+--------------------------+
| ttest6777    | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/ttest6777    | Microsoft.EventHub/Namespaces | Succeeded          | 2021-07-24T15:48:29.77Z  |
| test-without | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/test-without | Microsoft.EventHub/Namespaces | Succeeded          | 2021-07-26T05:15:40.253Z |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+--------------------+--------------------------+

List Namespaces with no virtual network service endpoint configured

select
  name,
  id,
  type,
  network_rule_set -> 'properties' -> 'virtualNetworkRules' as virtual_network_rules
from
  azure_eventhub_namespace
where
  network_rule_set  -> 'properties' -> 'virtualNetworkRules' = '[]';
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+-----------------------+
| name         | id                                                                                                                           | type                          | virtual_network_rules |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+-----------------------+
| test-without | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/test-without | Microsoft.EventHub/Namespaces | []                    |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+-----------------------

List Namespaces with encryption disabled

select
  name,
  id,
  type,
  encryption
from
  azure_eventhub_namespace
where
  encryption is null;
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+------------+
| name         | id                                                                                                                           | type                          | encryption |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+------------+
| test-without | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/test-without | Microsoft.EventHub/Namespaces | <null>     |
| ttest6777    | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/ttest6777    | Microsoft.EventHub/Namespaces | <null>     |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------------+------------+

List Namespaces with auto_inflate disabled

select
  name,
  id,
  is_auto_inflate_enabled,
  type
from
  azure_eventhub_namespace
where
  not is_auto_inflate_enabled;
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------+-------------------------------+
| name         | id                                                                                                                           | is_auto_inflate_enabled | type                          |
+--------------+------------------------------------------------------------------------------------------------------------------------------+-------------------------+-------------------------------+
| test-without | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/test-without | false                   | Microsoft.EventHub/Namespaces |
| ttest6777    | /subscriptions/********-****-****-****-************/resourceGroups/demo/providers/Microsoft.EventHub/namespaces/ttest6777    | false                   | Microsoft.EventHub/Namespaces |

@khushboo9024 khushboo9024 self-assigned this Jul 26, 2021
@bigdatasourav bigdatasourav linked an issue Jul 26, 2021 that may be closed by this pull request
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

@Subhajit97 Subhajit97 merged commit d2c6d32 into main Jul 28, 2021
@Subhajit97 Subhajit97 deleted the issue-197 branch July 28, 2021 10:08
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_eventhub_namespace
3 participants