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 column ip_configurations in the table azure_subnet closes #472 #483

Merged
merged 4 commits into from
May 4, 2022

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Apr 28, 2022

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_subnet []

PRETEST: tests/azure_subnet

TEST: tests/azure_subnet
Running terraform
data.azurerm_client_config.current: Refreshing state...
data.null_data_source.resource: Refreshing state...
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 4s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455]
azurerm_virtual_network.named_test_resource: Creating...
azurerm_virtual_network.named_test_resource: Still creating... [10s elapsed]
azurerm_virtual_network.named_test_resource: Creation complete after 15s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455]
azurerm_subnet.named_test_resource: Creating...
azurerm_subnet.named_test_resource: Creation complete after 7s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455]

Warning: Deprecated 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


Warning: "address_prefix": [DEPRECATED] Use the `address_prefixes` property instead.

  on variables.tf line 48, in resource "azurerm_subnet" "named_test_resource":
  48: resource "azurerm_subnet" "named_test_resource" {



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

Outputs:

resource_aka = azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455
resource_aka_lower = azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest74455/providers/microsoft.network/virtualnetworks/turbottest74455/subnets/turbottest74455
resource_id = /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455
resource_name = turbottest74455
subscription_id = d46d7416-f95f-4771-bbb5-529d4c76659c

Running SQL query: test-get-query.sql
[
  {
    "address_prefix": "10.0.1.0/24",
    "delegations": [
      {
        "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455/delegations/delegation",
        "name": "delegation",
        "properties": {
          "serviceName": "Microsoft.ContainerInstance/containerGroups"
        }
      }
    ],
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455",
    "name": "turbottest74455",
    "resource_group": "turbottest74455",
    "type": "Microsoft.Network/subnets",
    "virtual_network_name": "turbottest74455"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest74455/providers/microsoft.network/virtualnetworks/turbottest74455/subnets/turbottest74455"
    ],
    "name": "turbottest74455",
    "title": "turbottest74455"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455",
    "name": "turbottest74455"
  }
]
✔ 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/turbottest74455/providers/Microsoft.Network/virtualNetworks/turbottest74455/subnets/turbottest74455",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest74455/providers/microsoft.network/virtualnetworks/turbottest74455/subnets/turbottest74455"
    ],
    "name": "turbottest74455",
    "title": "turbottest74455"
  }
]
✔ PASSED

POSTTEST: tests/azure_subnet

TEARDOWN: tests/azure_subnet

SUMMARY:

1/1 passed.

Example query results

Results
> select name, jsonb_pretty(ip_configurations) from azure_subnet
+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name      | jsonb_pretty                                                                                                                                                                   |
+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| default   | {                                                                                                                                                                              |
|           | }                                                                                                                                                                              |
| test-vn-1 | {                                                                                                                                                                              |
|           | }                                                                                                                                                                              |
| default   | {                                                                                                                                                                              |
|           | }                                                                                                                                                                              |
| test-sub  | [                                                                                                                                                                              |
|           |     {                                                                                                                                                                          |
|           |         "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c234re4/resourceGroups/turbot_rg/providers/Microsoft.Network/networkInterfaces/test-ni/ipConfigurations/ipconfig1", |
|           |         "name": "ipconfig1",                                                                                                                                                   |
|           |         "properties": {                                                                                                                                                        |
|           |             "subnet": {                                                                                                                                                        |
|           |                 "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c234re4/resourceGroups/turbot_rg/providers/Microsoft.Network/virtualNetworks/test-vn/subnets/test-sub"      |
|           |             },                                                                                                                                                                 |
|           |             "primary": true,                                                                                                                                                   |
|           |             "privateIPAddress": "10.1.0.4",                                                                                                                                    |
|           |             "privateIPAddressVersion": "IPv4",                                                                                                                                 |
|           |             "privateIPAllocationMethod": "Dynamic"                                                                                                                             |
|           |         }                                                                                                                                                                      |
|           |     },                                                                                                                                                                         |
|           |     {                                                                                                                                                                          |
|           |         "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c234re4/resourceGroups/turbot_rg/providers/Microsoft.Network/networkInterfaces/test-ni/ipConfigurations/test2",     |
|           |         "name": "test2",                                                                                                                                                       |
|           |         "properties": {                                                                                                                                                        |
|           |             "subnet": {                                                                                                                                                        |
|           |                 "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c234re4/resourceGroups/turbot_rg/providers/Microsoft.Network/virtualNetworks/test-vn/subnets/test-sub"      |
|           |             },                                                                                                                                                                 |
|           |             "primary": false,                                                                                                                                                  |
|           |             "publicIPAddress": {                                                                                                                                               |
|           |                 "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c234re4/resourceGroups/turbot_rg/providers/Microsoft.Network/publicIPAddresses/test"                        |
|           |             },                                                                                                                                                                 |
|           |             "privateIPAddress": "10.1.0.65",                                                                                                                                   |
|           |             "privateIPAddressVersion": "IPv4",                                                                                                                                 |
|           |             "privateIPAllocationMethod": "Static"                                                                                                                              |
|           |         }                                                                                                                                                                      |
|           |     }                                                                                                                                                                          |
|           | ]                                                                                                                                                                              |
+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

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

@bigdatasourav bigdatasourav merged commit 50b8e62 into main May 4, 2022
@bigdatasourav bigdatasourav deleted the issue-472 branch May 4, 2022 07:31
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 column ip_configurations in the table azure_subnet
2 participants