turbot / steampipe-plugin-azure

Use SQL to instantly query Azure resources across regions and subscriptions. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/azure
Apache License 2.0
34 stars 15 forks source link

Add table Add table azure_private_endpoint Closes #771 #775

Closed ParthaI closed 3 weeks ago

ParthaI commented 3 weeks ago

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 undefined SETUP: tests/azure_private_endpoint [] PRETEST: tests/azure_private_endpoint TEST: tests/azure_private_endpoint Running terraform data.azurerm_client_config.current: Reading... data.azurerm_client_config.current: Read complete after 0s [id=Y2xpZW50Q29uZmlncy9jbGllbnRJZD0wNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDY7b2JqZWN0SWQ9MDZmZDQ2YjAtYTg2Ny00OWExLWE0ZjEtZjc3Njg0NjVjYWJhO3N1YnNjcmlwdGlvbklkPWQ0NmQ3NDE2LWY5NWYtNDc3MS1iYmI1LTUyOWQ0Yzc2NjU5Yzt0ZW5hbnRJZD1jZGZmZDcwOC03ZGEwLTRjZWEtYWJlYi0wYTRjMzM0ZDdmNjQ=] 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_lb.named_test_resource will be created + resource "azurerm_lb" "named_test_resource" { + id = (known after apply) + location = "westus" + name = "turbottest58317" + private_ip_address = (known after apply) + private_ip_addresses = (known after apply) + resource_group_name = "turbottest58317" + sku = "Standard" + sku_tier = "Regional" + frontend_ip_configuration { + gateway_load_balancer_frontend_ip_configuration_id = (known after apply) + id = (known after apply) + inbound_nat_rules = (known after apply) + load_balancer_rules = (known after apply) + name = "turbottest58317" + outbound_rules = (known after apply) + private_ip_address = (known after apply) + private_ip_address_allocation = (known after apply) + private_ip_address_version = (known after apply) + public_ip_address_id = (known after apply) + public_ip_prefix_id = (known after apply) + subnet_id = (known after apply) } } # azurerm_private_endpoint.named_test_resource will be created + resource "azurerm_private_endpoint" "named_test_resource" { + custom_dns_configs = (known after apply) + id = (known after apply) + location = "westus" + name = "turbottest58317" + network_interface = (known after apply) + private_dns_zone_configs = (known after apply) + resource_group_name = "turbottest58317" + subnet_id = (known after apply) + private_service_connection { + is_manual_connection = false + name = "public" + private_connection_resource_id = (known after apply) + private_ip_address = (known after apply) } } # azurerm_private_link_service.named_test_resource will be created + resource "azurerm_private_link_service" "named_test_resource" { + alias = (known after apply) + id = (known after apply) + load_balancer_frontend_ip_configuration_ids = (known after apply) + location = "westus" + name = "turbottest58317" + resource_group_name = "turbottest58317" + nat_ip_configuration { + name = "turbottest58317" + primary = true + private_ip_address_version = "IPv4" + subnet_id = (known after apply) } } # azurerm_public_ip.named_test_resource will be created + resource "azurerm_public_ip" "named_test_resource" { + allocation_method = "Static" + ddos_protection_mode = "VirtualNetworkInherited" + fqdn = (known after apply) + id = (known after apply) + idle_timeout_in_minutes = 4 + ip_address = (known after apply) + ip_version = "IPv4" + location = "westus" + name = "turbottest58317" + resource_group_name = "turbottest58317" + sku = "Standard" + sku_tier = "Regional" } # azurerm_resource_group.named_test_resource will be created + resource "azurerm_resource_group" "named_test_resource" { + id = (known after apply) + location = "westus" + name = "turbottest58317" } # azurerm_subnet.endpoint will be created + resource "azurerm_subnet" "endpoint" { + address_prefixes = [ + "10.0.2.0/24", ] + default_outbound_access_enabled = true + enforce_private_link_endpoint_network_policies = (known after apply) + enforce_private_link_service_network_policies = (known after apply) + id = (known after apply) + name = "endpoint" + private_endpoint_network_policies = (known after apply) + private_endpoint_network_policies_enabled = (known after apply) + private_link_service_network_policies_enabled = false + resource_group_name = "turbottest58317" + virtual_network_name = "example-network" } # azurerm_subnet.service will be created + resource "azurerm_subnet" "service" { + address_prefixes = [ + "10.0.1.0/24", ] + default_outbound_access_enabled = true + enforce_private_link_endpoint_network_policies = (known after apply) + enforce_private_link_service_network_policies = (known after apply) + id = (known after apply) + name = "turbottest58317" + private_endpoint_network_policies = (known after apply) + private_endpoint_network_policies_enabled = (known after apply) + private_link_service_network_policies_enabled = false + resource_group_name = "turbottest58317" + virtual_network_name = "example-network" } # azurerm_virtual_network.named_test_resource will be created + resource "azurerm_virtual_network" "named_test_resource" { + address_space = [ + "10.0.0.0/16", ] + dns_servers = (known after apply) + guid = (known after apply) + id = (known after apply) + location = "westus" + name = "example-network" + resource_group_name = "turbottest58317" + subnet = (known after apply) } Plan: 8 to add, 0 to change, 0 to destroy. Changes to Outputs: + resource_aka = (known after apply) + resource_aka_lower = (known after apply) + resource_id = (known after apply) + resource_name = "turbottest58317" + subscription_id = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" azurerm_resource_group.named_test_resource: Creating... azurerm_resource_group.named_test_resource: Still creating... [10s elapsed] azurerm_resource_group.named_test_resource: Creation complete after 13s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317] azurerm_virtual_network.named_test_resource: Creating... azurerm_public_ip.named_test_resource: Creating... azurerm_public_ip.named_test_resource: Creation complete after 6s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/publicIPAddresses/turbottest58317] azurerm_lb.named_test_resource: Creating... azurerm_virtual_network.named_test_resource: Creation complete after 10s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/virtualNetworks/example-network] azurerm_subnet.service: Creating... azurerm_subnet.endpoint: Creating... azurerm_lb.named_test_resource: Still creating... [10s elapsed] azurerm_subnet.service: Creation complete after 8s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/virtualNetworks/example-network/subnets/turbottest58317] azurerm_subnet.endpoint: Still creating... [10s elapsed] azurerm_lb.named_test_resource: Creation complete after 15s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/loadBalancers/turbottest58317] azurerm_private_link_service.named_test_resource: Creating... azurerm_subnet.endpoint: Creation complete after 14s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/virtualNetworks/example-network/subnets/endpoint] azurerm_private_link_service.named_test_resource: Still creating... [10s elapsed] azurerm_private_link_service.named_test_resource: Creation complete after 17s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateLinkServices/turbottest58317] azurerm_private_endpoint.named_test_resource: Creating... azurerm_private_endpoint.named_test_resource: Still creating... [10s elapsed] azurerm_private_endpoint.named_test_resource: Still creating... [20s elapsed] azurerm_private_endpoint.named_test_resource: Still creating... [30s elapsed] azurerm_private_endpoint.named_test_resource: Still creating... [40s elapsed] azurerm_private_endpoint.named_test_resource: Creation complete after 47s [id=/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateEndpoints/turbottest58317] Warning: Deprecated with data.null_data_source.resource, on variables.tf line 30, in data "null_data_source" "resource": 30: 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 or the terraform_data resource type in Terraform 1.4 and later. (and one more similar warning elsewhere) Apply complete! Resources: 8 added, 0 changed, 0 destroyed. Outputs: resource_aka = "azure:///subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateEndpoints/turbottest58317" resource_aka_lower = "azure:///subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/turbottest58317/providers/microsoft.network/privateendpoints/turbottest58317" resource_id = "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateEndpoints/turbottest58317" resource_name = "turbottest58317" subscription_id = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" Running SQL query: test-get-query.sql Time: 2.5s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) azure_private_endpoint.azure: Time: 2.3s. Fetched: 1. Hydrates: 0. Quals: name=turbottest58317, resource_group=turbottest58317. [ { "id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateEndpoints/turbottest58317", "name": "turbottest58317", "region": "westus" } ] ✔ PASSED Running SQL query: test-list-query.sql Time: 5.3s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) azure_private_endpoint.azure: Time: 1.2s. Fetched: 1. Hydrates: 0. Quals: name=turbottest58317. [ { "id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateEndpoints/turbottest58317", "name": "turbottest58317" } ] ✔ PASSED Running SQL query: test-not-found-query.sql Time: 74ms. Rows returned: 0. Rows fetched: 1 (cached). Hydrate calls: 0. Scans: 1) azure_private_endpoint.azure: Time: 8ms. Fetched: 1 (cached). Hydrates: 0. Quals: name=dummy-turbottest58317, resource_group=turbottest58317. [] ✔ PASSED Running SQL query: test-turbot-query.sql Time: 74ms. Rows returned: 1. Rows fetched: 1 (cached). Hydrate calls: 0. Scans: 1) azure_private_endpoint.azure: Time: 4ms. Fetched: 1 (cached). Hydrates: 0. Quals: name=turbottest58317, resource_group=turbottest58317. [ { "akas": [ "azure:///subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest58317/providers/Microsoft.Network/privateEndpoints/turbottest58317", "azure:///subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/turbottest58317/providers/microsoft.network/privateendpoints/turbottest58317" ], "name": "turbottest58317", "title": "turbottest58317" } ] ✔ PASSED TEARDOWN: tests/azure_private_endpoint SUMMARY: 1/1 passed. ```

Example query results

Results ``` select * from azure_private_endpoint { "rows": [], "metadata": { "duration_ms": 2030, "scans": [ { "connection": "azure", "table": "azure_private_endpoint", "cache_hit": false, "rows_fetched": 0, "hydrate_calls": 0, "start_time": "2024-06-12T18:51:48+05:30", "duration_ms": 1930, "columns": [ "application_security_groups", "subscription_id", "etag", "network_interfaces", "private_link_service_connections", "manual_private_link_service_connections", "region", "id", "custom_network_interface_name", "akas", "sp_connection_name", "extended_location", "_ctx", "cloud_environment", "subnet", "title", "tags", "custom_dns_configs", "resource_group", "sp_ctx", "name", "type", "provisioning_state", "location", "ip_configurations" ] } ], "scan_count": 1, "rows_returned": 0, "uncached_rows_fetched": 0, "cached_rows_fetched": 0, "hydrate_calls": 0, "connection_count": 1 } } Time: 2.0s. Rows returned: 0. > .cache off > .cache clear > select * from azure_private_endpoint { "rows": [ { "_ctx": { "connection_name": "azure", "steampipe": { "sdk_version": "5.10.1" } }, "akas": [ "azure:///subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest76663/providers/Microsoft.Network/privateEndpoints/turbottest76663", "azure:///subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/turbottest76663/providers/microsoft.network/privateendpoints/turbottest76663" ], "application_security_groups": null, "cloud_environment": "AzurePublicCloud", "custom_dns_configs": [], "custom_network_interface_name": "", "etag": "W/\"f6872f00-9341-4416-866f-652ce0b0013f\"", "extended_location": null, "id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest76663/providers/Microsoft.Network/privateEndpoints/turbottest76663", "ip_configurations": [], "location": "westus", "manual_private_link_service_connections": [], "name": "turbottest76663", "network_interfaces": [ { "id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest76663/providers/Microsoft.Network/networkInterfaces/turbottest76663.nic.2d2b1264-074d-44b5-a562-f2d14f1a7ade" } ], "private_link_service_connections": [ { "id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest76663/providers/Microsoft.Network/privateEndpoints/turbottest76663/privateLinkServiceConnections/public", "name": "public", "properties": { "groupIds": [], "privateLinkServiceConnectionState": { "actionsRequired": "None", "description": "Auto Approved", "status": "Approved" }, "privateLinkServiceId": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/turbottest76663/providers/Microsoft.Network/privateLinkServices/turbottest76663" } } ], "provisioning_state": "Succeeded", "region": "westus", "resource_group": "turbottest76663", "sp_connection_name": "azure", "sp_ctx": { "connection_name": "azure", "steampipe": { "sdk_version": "5.10.1" } }, "subnet": "{Response:{Response:} SubnetPropertiesFormat: Name: Etag: Type: ID:0x14015ef4590}", "subscription_id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "tags": {}, "title": "turbottest76663", "type": "Microsoft.Network/privateEndpoints" } ], "metadata": { "duration_ms": 1850, "scans": [ { "connection": "azure", "table": "azure_private_endpoint", "cache_hit": false, "rows_fetched": 1, "hydrate_calls": 2, "start_time": "2024-06-12T18:56:33+05:30", "duration_ms": 1843, "columns": [ "type", "network_interfaces", "extended_location", "private_link_service_connections", "manual_private_link_service_connections", "application_security_groups", "sp_connection_name", "sp_ctx", "id", "custom_network_interface_name", "cloud_environment", "provisioning_state", "resource_group", "_ctx", "name", "title", "etag", "location", "custom_dns_configs", "akas", "subscription_id", "subnet", "ip_configurations", "tags", "region" ] } ], "scan_count": 1, "rows_returned": 1, "uncached_rows_fetched": 1, "cached_rows_fetched": 0, "hydrate_calls": 2, "connection_count": 1 } } Time: 1.9s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 2. Scans: 1) azure_private_endpoint.azure: Time: 1.8s. Fetched: 1. Hydrates: 2. ```