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_iothub_dps. Closes #322 #363

Merged
merged 4 commits into from
Oct 4, 2021
Merged

Add table azure_iothub_dps. Closes #322 #363

merged 4 commits into from
Oct 4, 2021

Conversation

bigdatasourav
Copy link
Contributor

Integration test logs

Logs
SETUP: tests/azure_iothub_dps []

PRETEST: tests/azure_iothub_dps

TEST: tests/azure_iothub_dps
Running terraform

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform will perform the following actions:

  # data.local_file.input will be read during apply
  # (config refers to values not yet known)
 <= data "local_file" "input"  {
      + content        = (known after apply)
      + content_base64 = (known after apply)
      + filename       = "/private/tmp/tests/azure_iothub_dps/terraform/test/info.json"
      + id             = (known after apply)
    }

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

  # null_resource.named_test_resource will be created
  + resource "null_resource" "named_test_resource" {
      + id = (known after apply)
    }

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

Changes to Outputs:
  + location           = "eastus"
  + resource_aka       = (known after apply)
  + resource_aka_lower = (known after apply)
  + resource_id        = (known after apply)
  + resource_name      = "turbottest92006"
  + subscription_id    = "d46d7416-f95f-4771-bbb5-529d4c76659c"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 1s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest92006]
null_resource.named_test_resource: Creating...
null_resource.named_test_resource: Provisioning with 'local-exec'...
null_resource.named_test_resource (local-exec): Executing: ["/bin/sh" "-c" "az iot dps create --name turbottest92006 --resource-group turbottest92006 --location eastus > /private/tmp/tests/azure_iothub_dps/terraform/test/info.json"]
null_resource.named_test_resource: Still creating... [10s elapsed]
null_resource.named_test_resource: Still creating... [20s elapsed]
null_resource.named_test_resource: Still creating... [30s elapsed]
null_resource.named_test_resource: Still creating... [41s elapsed]
null_resource.named_test_resource: Creation complete after 43s [id=1232977879877296796]
data.local_file.input: Reading...
data.local_file.input: Read complete after 0s [id=1b067d345c003e3b29065a14f8558c81bd8a4bc7]

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 = "eastus"
resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest92006/providers/Microsoft.Devices/provisioningServices/turbottest92006"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest92006/providers/microsoft.devices/provisioningservices/turbottest92006"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest92006/providers/Microsoft.Devices/provisioningServices/turbottest92006"
resource_name = "turbottest92006"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest92006/providers/Microsoft.Devices/provisioningServices/turbottest92006",
    "name": "turbottest92006",
    "region": "eastus",
    "resource_group": "turbottest92006",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "type": "Microsoft.Devices/provisioningServices"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest92006/providers/Microsoft.Devices/provisioningServices/turbottest92006",
    "name": "turbottest92006",
    "type": "Microsoft.Devices/provisioningServices"
  }
]
✔ 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/turbottest92006/providers/Microsoft.Devices/provisioningServices/turbottest92006",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest92006/providers/microsoft.devices/provisioningservices/turbottest92006"
    ],
    "name": "turbottest92006",
    "title": "turbottest92006"
  }
]
✔ PASSED

POSTTEST: tests/azure_iothub_dps
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:

  # null_resource.named_resource will be created
  + resource "null_resource" "named_resource" {
      + id = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.
null_resource.named_resource: Creating...
null_resource.named_resource: Provisioning with 'local-exec'...
null_resource.named_resource (local-exec): Executing: ["/bin/sh" "-c" "az iot dps delete --resource-group turbottest92006 --name turbottest92006"]
null_resource.named_resource: Still creating... [10s elapsed]
null_resource.named_resource: Still creating... [20s elapsed]
null_resource.named_resource: Creation complete after 21s [id=3126622355238831938]

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

TEARDOWN: tests/azure_iothub_dps


SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  region,
  type
from
  azure_iothub_dps
where
  state = 'Active';
+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------------------+
| name            | id                                                                                                                                                  | region | type                                   |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------------------+
| turbottest57618 | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest57618/providers/Microsoft.Devices/provisioningServices/turbottest57618 | eastus | Microsoft.Devices/provisioningServices |
| testwert        | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbot_rg/providers/Microsoft.Devices/provisioningServices/testwert              | eastus | Microsoft.Devices/provisioningServices |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------------------+
> select
  name,
  id,
  region,
  type
from
  azure_iothub_dps
where
  state <> 'Active';
+------+----+--------+------+
| name | id | region | type |
+------+----+--------+------+
+------+----+--------+------+
> select
  name,
  id,
  region,
  type
from
  azure_iothub_dps;
+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------------------+
| name            | id                                                                                                                                                  | region | type                                   |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------------------+
| turbottest57618 | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest57618/providers/Microsoft.Devices/provisioningServices/turbottest57618 | eastus | Microsoft.Devices/provisioningServices |
| testwert        | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbot_rg/providers/Microsoft.Devices/provisioningServices/testwert              | eastus | Microsoft.Devices/provisioningServices |
+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+--------+----------------------------------------+

@bigdatasourav bigdatasourav self-assigned this Sep 30, 2021
@bigdatasourav bigdatasourav linked an issue Sep 30, 2021 that may be closed by this pull request
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 986f095 into main Oct 4, 2021
@bigdatasourav bigdatasourav deleted the issue-322 branch October 4, 2021 10:57
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_iothub_dps
2 participants