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_bastion_host. Closes #576 #580

Merged
merged 8 commits into from
Mar 15, 2023

Conversation

karanpopat
Copy link
Contributor

@karanpopat karanpopat commented Mar 15, 2023

Integration test logs

Logs
> select
    name,
    dns_name,
    provisioning_state,
    region,
    resource_group
  from
    azure_bastion_host;
+-------------------+------------------------------------------------------------+--------------------+---------+----------------+
| name              | dns_name                                                   | provisioning_state | region  | resource_group |
+-------------------+------------------------------------------------------------+--------------------+---------+----------------+
| demo-vnet-bastion | bst-26953659-8877-453f-xxxx-b01e945537ba.bastion.azure.com | Succeeded          | westus2 | demo           |
+-------------------+------------------------------------------------------------+--------------------+---------+----------------+

> select
    h.name as bastion_host_name,
    s.id as subnet_id,
    s.name as subnet_name,
    address_prefix
  from
    azure_bastion_host h,
    jsonb_array_elements(ip_configurations) ip,
    azure_subnet s
  where
    s.id = ip -> 'properties' -> 'subnet' ->> 'id';
+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------------+
| bastion_host_name | subnet_id                                                                                                                                                | subnet_name        | address_prefix |
+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------------+
| demo-vnet-bastion | /subscriptions/ab6d7416-f95f-xxxx-bbb5-529d4c76659c/resourceGroups/demo/providers/Microsoft.Network/virtualNetworks/demo-vnet/subnets/AzureBastionSubnet | AzureBastionSubnet | 10.1.1.0/26    |
+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------------+

Example query results

Results
Outputs:

resource_aka = "azure:///subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest88237/providers/Microsoft.Network/bastionHosts/turbottest88237"
resource_aka_lower = "azure:///subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest88237/providers/microsoft.network/bastionhosts/turbottest88237"
resource_dns_name = "bst-336d5248-936e-4844-ab2d-a680a2598431.bastion.azure.com"
resource_id = "/subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest88237/providers/microsoft.network/bastionhosts/turbottest88237"
resource_name = "turbottest88237"
subscription_id = "ab6d7416-f95f-4771-bbb5-529d4c76659c"

Running SQL query: test-get-query.sql
[
  {
    "dns_name": "bst-336d5248-936e-4844-ab2d-a680a2598431.bastion.azure.com",
    "id": "/subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest88237/providers/microsoft.network/bastionhosts/turbottest88237",
    "name": "turbottest88237",
    "resource_group": "turbottest88237",
    "tags": {
      "name": "turbottest88237"
    }
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "dns_name": "bst-336d5248-936e-4844-ab2d-a680a2598431.bastion.azure.com",
    "id": "/subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest88237/providers/microsoft.network/bastionhosts/turbottest88237",
    "name": "turbottest88237",
    "resource_group": "turbottest88237",
    "tags": {
      "name": "turbottest88237"
    }
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest88237/providers/microsoft.network/bastionhosts/turbottest88237",
      "azure:///subscriptions/ab6d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest88237/providers/microsoft.network/bastionhosts/turbottest88237"
    ],
    "name": "turbottest88237",
    "title": "turbottest88237"
  }
]
✔ PASSED

POSTTEST: tests/azure_bastion_host

TEARDOWN: tests/azure_bastion_host

SUMMARY:

1/1 passed.

@karanpopat karanpopat self-assigned this Mar 15, 2023
@karanpopat karanpopat linked an issue Mar 15, 2023 that may be closed by this pull request
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.

@karanpopat Please take a look at the review comments. Thanks!!

azure-test/tests/azure_bastion_host/test-list-query.sql Outdated Show resolved Hide resolved
azure/table_azure_bastion_host.go Outdated Show resolved Hide resolved
docs/tables/azure_bastion_host.md Outdated Show resolved Hide resolved
docs/tables/azure_bastion_host.md Outdated Show resolved Hide resolved
@misraved misraved merged commit 85c767e into main Mar 15, 2023
@misraved misraved deleted the 576-add-table-azure_bastion_host branch March 15, 2023 13:45
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_bastion_host
4 participants