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_lb_probe. Closes #189 #238

Merged
merged 16 commits into from
Aug 13, 2021
Merged

Add table azure_lb_probe. Closes #189 #238

merged 16 commits into from
Aug 13, 2021

Conversation

c0d3r-arnab
Copy link
Contributor

@c0d3r-arnab c0d3r-arnab commented Aug 6, 2021

Integration test logs

Logs
arnab@turbotindias-MacBook-Pro azure-test % ./tint.js azure_lb_probe
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_lb_probe []

PRETEST: tests/azure_lb_probe

TEST: tests/azure_lb_probe
Running terraform
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 3s [id=/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587]
azurerm_public_ip.named_test_resource: Creating...
azurerm_public_ip.named_test_resource: Still creating... [10s elapsed]
azurerm_public_ip.named_test_resource: Creation complete after 12s [id=/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/publicIPAddresses/turbottest91587]
azurerm_lb.named_test_resource: Creating...
azurerm_lb.named_test_resource: Creation complete after 8s [id=/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587]
azurerm_lb_probe.named_test_resource: Creating...
azurerm_lb_probe.named_test_resource: Creation complete after 7s [id=/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587/probes/turbottest91587]

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.


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

Outputs:

resource_aka = "azure:///subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587/probes/turbottest91587"
resource_aka_lower = "azure:///subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourcegroups/turbottest91587/providers/microsoft.network/loadbalancers/turbottest91587/probes/turbottest91587"
resource_id = "/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587/probes/turbottest91587"
resource_name = "turbottest91587"
subscription_id = "f2ecd657-84a7-4445-9b2a-280aa402eb9f"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587/probes/turbottest91587",
    "name": "turbottest91587",
    "resource_group": "turbottest91587",
    "subscription_id": "f2ecd657-84a7-4445-9b2a-280aa402eb9f",
    "type": "Microsoft.Network/loadBalancers/probes"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587/probes/turbottest91587",
    "name": "turbottest91587"
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourceGroups/turbottest91587/providers/Microsoft.Network/loadBalancers/turbottest91587/probes/turbottest91587",
      "azure:///subscriptions/f2ecd657-84a7-4445-9b2a-280aa402eb9f/resourcegroups/turbottest91587/providers/microsoft.network/loadbalancers/turbottest91587/probes/turbottest91587"
    ],
    "name": "turbottest91587",
    "title": "turbottest91587"
  }
]
✔ PASSED

POSTTEST: tests/azure_lb_probe

TEARDOWN: tests/azure_lb_probe

SUMMARY:

1/1 passed.

Example query results

Results
arnab@turbotindias-MacBook-Pro steampipe-plugin-azure % steampipe query
Welcome to Steampipe v0.7.1
For more information, type .help
> select
  id,
  name,
  type,
  provisioning_state,
  load_balancer_name,
  port
from
  azure_lb_probe;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
| id                                                                                                                                                               | name                  | type           
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/demo-asr/providers/Microsoft.Network/loadBalancers/arnab_test_lb/probes/arnab_lb_health_probe | arnab_lb_health_probe | Microsoft.Netwo
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
> select
  id,
  name,
  provisioning_state
from
  azure_lb_probe
where
  provisioning_state = 'Succeeded';
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
| id                                                                                                                                                               | name                  | provisioning_st
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/demo-asr/providers/Microsoft.Network/loadBalancers/arnab_test_lb/probes/arnab_lb_health_probe | arnab_lb_health_probe | Succeeded      
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
> select
  id,
  name,
  interval_in_seconds
from
  azure_lb_probe
order by 
  interval_in_seconds;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
| id                                                                                                                                                               | name                  | interval_in_sec
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/demo-asr/providers/Microsoft.Network/loadBalancers/arnab_test_lb/probes/arnab_lb_health_probe | arnab_lb_health_probe | 5              
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+----------------
>  

@c0d3r-arnab c0d3r-arnab self-assigned this Aug 6, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Aug 6, 2021 that may be closed by this pull request
@bigdatasourav bigdatasourav changed the title Add table azure__lb_probe. Closes #189 Add table azure_lb_probe. Closes #189 Aug 9, 2021

func extractLoadBalancerNameFromProbeID(ctx context.Context, d *transform.TransformData) (interface{}, error) {
data := d.HydrateItem.(network.Probe)
vaultName := strings.Split(*data.ID, "/")[8]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
vaultName := strings.Split(*data.ID, "/")[8]
load_balancer_name := strings.Split(*data.ID, "/")[8]

@@ -0,0 +1,47 @@
# Table: azure_lb_probe

A health probe is used to determine the health status of the instances in the backend pool. It will determine if an instance is healthy and can receive traffic.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
A health probe is used to determine the health status of the instances in the backend pool. It will determine if an instance is healthy and can receive traffic.
When using load-balancing rules with Azure Load Balancer, you need to specify health probes to allow Load Balancer to detect the backend endpoint status. The configuration of the health probe and probe responses determine which backend pool instances will receive new flows. You can use health probes to detect the failure of an application on a backend endpoint.

Copy link
Contributor

@bigdatasourav bigdatasourav left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rajlearner17 rajlearner17 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 7ddabc7 into main Aug 13, 2021
@bigdatasourav bigdatasourav deleted the issue-189 branch August 13, 2021 09: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_lb_probe
3 participants