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 azure_dns_zone table closes #564 #575

Merged
merged 6 commits into from
Mar 15, 2023

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Mar 12, 2023

Resolves #564

TODO:

  • handle pagination (limited to 100 zones right now)
  • add documentation
  • run extensive tests
  • add integration tests

@pdecat pdecat marked this pull request as draft March 12, 2023 11:15
@pdecat pdecat mentioned this pull request Mar 12, 2023
@pdecat pdecat force-pushed the table_azure_dns_zone branch 2 times, most recently from ca81f18 to 86d846e Compare March 12, 2023 11:24
azure/table_azure_dns_zone.go Outdated Show resolved Hide resolved
@pdecat pdecat force-pushed the table_azure_dns_zone branch from 86d846e to 3c14704 Compare March 12, 2023 17:31
@pdecat pdecat marked this pull request as ready for review March 12, 2023 17:48
@pdecat pdecat force-pushed the table_azure_dns_zone branch 2 times, most recently from f6ca012 to 329764d Compare March 13, 2023 16:33
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

Thanks @pdecat for creating this new table. I have left minor review comments, please let me know if you have questions.

Also, please rebase this branch with the main, since we recently updated all the tables to use the Steampipe plugin SDK v5.

PR reference - #574

azure/table_azure_dns_zone.go Outdated Show resolved Hide resolved
azure/table_azure_dns_zone.go Show resolved Hide resolved
azure/table_azure_dns_zone.go Outdated Show resolved Hide resolved
azure-test/tests/azure_dns_zone/variables.tf Show resolved Hide resolved
@pdecat pdecat force-pushed the table_azure_dns_zone branch from b67c1f1 to 1e8ce6a Compare March 15, 2023 12:20
@pdecat pdecat requested a review from misraved March 15, 2023 12:22
@pdecat
Copy link
Contributor Author

pdecat commented Mar 15, 2023

Hi @misraved, I believe I've addressed all your comments. Could you give it another look? 🙏

@pdecat
Copy link
Contributor Author

pdecat commented Mar 15, 2023

New integration logs:

./tint.js azure_dns_zone
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_dns_zone []

PRETEST: tests/azure_dns_zone

TEST: tests/azure_dns_zone
Running terraform
data.azurerm_client_config.current: Reading...
data.azurerm_client_config.current: Read complete after 0s [id=******=]
data.null_data_source.resource: Reading...
data.null_data_source.resource: Read complete after 0s [id=static]

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_dns_zone.named_test_resource will be created
  + resource "azurerm_dns_zone" "named_test_resource" {
      + id                        = (known after apply)
      + max_number_of_record_sets = (known after apply)
      + name                      = "turbottest22547.xyz"
      + name_servers              = (known after apply)
      + number_of_record_sets     = (known after apply)
      + resource_group_name       = "turbottest22547"
      + tags                      = {
          + "name" = "turbottest22547.xyz"
        }

      + soa_record {
          + email         = (known after apply)
          + expire_time   = (known after apply)
          + fqdn          = (known after apply)
          + host_name     = (known after apply)
          + minimum_ttl   = (known after apply)
          + refresh_time  = (known after apply)
          + retry_time    = (known after apply)
          + serial_number = (known after apply)
          + tags          = (known after apply)
          + ttl           = (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     = "turbottest22547"
      + tags     = {
          + "name" = "turbottest22547"
        }
    }

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

Changes to Outputs:
  + resource_aka    = (known after apply)
  + resource_id     = (known after apply)
  + resource_name   = "turbottest22547"
  + subscription_id = "******"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 2s [id=/subscriptions/******/resourceGroups/turbottest22547]
azurerm_dns_zone.named_test_resource: Creating...
azurerm_dns_zone.named_test_resource: Creation complete after 8s [id=/subscriptions/******/resourceGroups/turbottest22547/providers/Microsoft.Network/dnsZones/turbottest22547.xyz]

Warning: Deprecated

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

resource_aka = "azure:///subscriptions/******/resourceGroups/turbottest22547/providers/Microsoft.Network/dnszones/turbottest22547.xyz"
resource_id = "/subscriptions/******/resourceGroups/turbottest22547/providers/Microsoft.Network/dnszones/turbottest22547.xyz"
resource_name = "turbottest22547"
subscription_id = "******"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/******/resourceGroups/turbottest22547/providers/Microsoft.Network/dnszones/turbottest22547.xyz",
    "name": "turbottest22547.xyz",
    "region": "global",
    "type": "Microsoft.Network/dnszones"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/******/resourceGroups/turbottest22547/providers/Microsoft.Network/dnszones/turbottest22547.xyz",
      "azure:///subscriptions/******/resourcegroups/turbottest22547/providers/microsoft.network/dnszones/turbottest22547.xyz"
    ],
    "name": "turbottest22547.xyz",
    "tags": {
      "name": "turbottest22547.xyz"
    },
    "title": "turbottest22547.xyz"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/******/resourceGroups/turbottest22547/providers/Microsoft.Network/dnszones/turbottest22547.xyz",
    "name": "turbottest22547.xyz"
  }
]
✔ PASSED

POSTTEST: tests/azure_dns_zone

TEARDOWN: tests/azure_dns_zone

SUMMARY:

1/1 passed.

@misraved misraved changed the title Add azure_dns_zone table Add azure_dns_zone table clsoes #564 Mar 15, 2023
@misraved misraved changed the title Add azure_dns_zone table clsoes #564 Add azure_dns_zone table closes #564 Mar 15, 2023
@misraved misraved merged commit 7f340ec into turbot:main Mar 15, 2023
@pdecat pdecat deleted the table_azure_dns_zone branch March 15, 2023 13:33
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_dns_zone
3 participants