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 Private Endpoint Connection details in table azure_eventhub_namespace. Closes #303 #331

Merged
merged 5 commits into from
Sep 29, 2021

Conversation

c0d3r-arnab
Copy link
Contributor

Integration test logs

Logs
arnab@turbotindias-MacBook-Pro azure-test % ./tint.js azure_eventhub_namespace
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 undefined

SETUP: tests/azure_eventhub_namespace []

PRETEST: tests/azure_eventhub_namespace

TEST: tests/azure_eventhub_namespace
Running terraform

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # azurerm_eventhub_namespace.named_test_resource will be created
  + resource "azurerm_eventhub_namespace" "named_test_resource" {
      + auto_inflate_enabled                = false
      + capacity                            = 1
      + default_primary_connection_string   = (sensitive value)
      + default_primary_key                 = (sensitive value)
      + default_secondary_connection_string = (sensitive value)
      + default_secondary_key               = (sensitive value)
      + id                                  = (known after apply)
      + kafka_enabled                       = false
      + location                            = "westus"
      + maximum_throughput_units            = (known after apply)
      + name                                = "turbottest99342"
      + network_rulesets                    = (known after apply)
      + resource_group_name                 = "turbottest99342"
      + sku                                 = "Standard"
      + tags                                = {
          + "name" = "turbottest99342"
        }
    }

  # azurerm_resource_group.named_test_resource will be created
  + resource "azurerm_resource_group" "named_test_resource" {
      + id       = (known after apply)
      + location = "westus"
      + name     = "turbottest99342"
      + tags     = (known after apply)
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + location           = "westus"
  + resource_aka       = (known after apply)
  + resource_aka_lower = (known after apply)
  + resource_id        = (known after apply)
  + resource_name      = "turbottest99342"
  + subscription_id    = "d46d7416-f95f-4771-bbb5-529d4c76659c"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 4s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342]
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 1m19s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342]

Warning: Version constraints inside provider configuration blocks are deprecated

  on variables.tf line 21, in provider "azurerm":
  21:   version         = "=1.36.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.

Warning: Deprecated Resource

  with data.null_data_source.resource,
  on variables.tf line 28, in data "null_data_source" "resource":
  28: data "null_data_source" "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

(and one more similar warning elsewhere)

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

Outputs:

location = "westus"
resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest99342/providers/microsoft.eventhub/namespaces/turbottest99342"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342"
resource_name = "turbottest99342"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342",
    "is_auto_inflate_enabled": false,
    "kafka_enabled": true,
    "name": "turbottest99342",
    "region": "westus",
    "resource_group": "turbottest99342",
    "type": "Microsoft.EventHub/Namespaces"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest99342/providers/microsoft.eventhub/namespaces/turbottest99342"
    ],
    "name": "turbottest99342",
    "tags": {
      "name": "turbottest99342"
    },
    "title": "turbottest99342"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342",
    "name": "turbottest99342"
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest99342/providers/Microsoft.EventHub/namespaces/turbottest99342",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest99342/providers/microsoft.eventhub/namespaces/turbottest99342"
    ],
    "name": "turbottest99342",
    "tags": {
      "name": "turbottest99342"
    },
    "title": "turbottest99342"
  }
]
✔ PASSED

POSTTEST: tests/azure_eventhub_namespace

TEARDOWN: tests/azure_eventhub_namespace

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  type,
  provisioning_state,
  created_at
from
  azure_eventhub_namespace;
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| name                    | id                                                                                                                                                           | type             
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-standard-namespace | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.EventHub/namespaces/test-standard-namespace | Microsoft.EventHu
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> 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             
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-standard-namespace | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.EventHub/namespaces/test-standard-namespace | Microsoft.EventHu
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> select
  name,
  id,
  type,
  encryption
from
  azure_eventhub_namespace
where
  encryption is null;
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| name                    | id                                                                                                                                                           | type             
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-standard-namespace | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.EventHub/namespaces/test-standard-namespace | Microsoft.EventHu
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> select
  name,
  id,
  type,
  is_auto_inflate_enabled
from
  azure_eventhub_namespace
where
  not is_auto_inflate_enabled;
+------+----+------+-------------------------+
| name | id | type | is_auto_inflate_enabled |
+------+----+------+-------------------------+
+------+----+------+-------------------------+
> select
  name,
  id,
  connections ->> 'id' as connection_id,
  connections ->> 'name' as connection_name,
  connections ->> 'privateEndpointPropertyID' as property_private_endpoint_id,
  connections ->> 'provisioningState' as property_provisioning_state,
  jsonb_pretty(connections -> 'privateLinkServiceConnectionState') as property_private_link_service_connection_state,
  connections ->> 'type' as connection_type
from
  azure_eventhub_namespace,
  jsonb_array_elements(private_endpoint_connections) as connections;
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| name                    | id                                                                                                                                                           | connection_id    
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-standard-namespace | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.EventHub/namespaces/test-standard-namespace | /subscriptions/d4
|                         |                                                                                                                                                              |                  
|                         |                                                                                                                                                              |                  
|                         |                                                                                                                                                              |                  
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> 

Copy link
Contributor

@ParthaI ParthaI left a comment

Choose a reason for hiding this comment

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

LGTM

@bigdatasourav bigdatasourav merged commit 09087d1 into main Sep 29, 2021
@bigdatasourav bigdatasourav deleted the issue-303 branch September 29, 2021 06:28
@c0d3r-arnab c0d3r-arnab restored the issue-303 branch September 29, 2021 06:37
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 Private Endpoint Connection details in table azure_eventhub_namespace
3 participants