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_spring_cloud_service. Closes #312 #347

Merged
merged 4 commits into from
Sep 30, 2021
Merged

Conversation

c0d3r-arnab
Copy link
Contributor

@c0d3r-arnab c0d3r-arnab commented Sep 28, 2021

Integration test logs

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

PRETEST: tests/azure_spring_cloud_service

TEST: tests/azure_spring_cloud_service
Running terraform

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_application_insights.named_test_resource will be created
  + resource "azurerm_application_insights" "named_test_resource" {
      + app_id                                = (known after apply)
      + application_type                      = "web"
      + connection_string                     = (sensitive value)
      + daily_data_cap_in_gb                  = (known after apply)
      + daily_data_cap_notifications_disabled = (known after apply)
      + disable_ip_masking                    = false
      + id                                    = (known after apply)
      + instrumentation_key                   = (sensitive value)
      + local_authentication_disabled         = false
      + location                              = "westeurope"
      + name                                  = "turbottest73625"
      + resource_group_name                   = "turbottest73625"
      + retention_in_days                     = 90
      + sampling_percentage                   = 100
    }

  # azurerm_resource_group.named_test_resource will be created
  + resource "azurerm_resource_group" "named_test_resource" {
      + id       = (known after apply)
      + location = "westeurope"
      + name     = "turbottest73625"
    }

  # azurerm_spring_cloud_service.named_test_resource will be created
  + resource "azurerm_spring_cloud_service" "named_test_resource" {
      + id                             = (known after apply)
      + location                       = "westeurope"
      + name                           = "turbottest73625"
      + outbound_public_ip_addresses   = (known after apply)
      + required_network_traffic_rules = (known after apply)
      + resource_group_name            = "turbottest73625"
      + sku_name                       = "S0"
      + tags                           = {
          + "name" = "turbottest73625"
        }

      + config_server_git_setting {
          + label        = "config"
          + search_paths = [
              + "dir1",
              + "dir2",
            ]
          + uri          = "https://github.com/Azure-Samples/piggymetrics"
        }

      + trace {
          + connection_string = (sensitive)
          + sample_rate       = 10
        }
    }

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

Changes to Outputs:
  + region             = "westeurope"
  + resource_aka       = (known after apply)
  + resource_aka_lower = (known after apply)
  + resource_id        = (known after apply)
  + resource_name      = "turbottest73625"
  + subscription_id    = "d46d7416-f95f-4771-bbb5-529d4c76659c"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 3s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625]
azurerm_application_insights.named_test_resource: Creating...
azurerm_application_insights.named_test_resource: Still creating... [10s elapsed]
azurerm_application_insights.named_test_resource: Still creating... [20s elapsed]
azurerm_application_insights.named_test_resource: Still creating... [30s elapsed]
azurerm_application_insights.named_test_resource: Still creating... [40s elapsed]
azurerm_application_insights.named_test_resource: Creation complete after 48s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625/providers/microsoft.insights/components/turbottest73625]
azurerm_spring_cloud_service.named_test_resource: Creating...
azurerm_spring_cloud_service.named_test_resource: Still creating... [10s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [20s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [30s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [40s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [50s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [1m0s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [1m10s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [1m20s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [1m30s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [1m40s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [1m50s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [2m0s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [2m10s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [2m20s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [2m30s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [2m40s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [2m50s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [3m0s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [3m10s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [3m20s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [3m30s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [3m40s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [3m50s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [4m0s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [4m10s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [4m20s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [4m30s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [4m40s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [4m50s elapsed]
azurerm_spring_cloud_service.named_test_resource: Still creating... [5m0s elapsed]
azurerm_spring_cloud_service.named_test_resource: Creation complete after 5m6s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625/providers/Microsoft.AppPlatform/Spring/turbottest73625]

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

Outputs:

region = "westeurope"
resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625/providers/Microsoft.AppPlatform/Spring/turbottest73625"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest73625/providers/microsoft.appplatform/spring/turbottest73625"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625/providers/Microsoft.AppPlatform/Spring/turbottest73625"
resource_name = "turbottest73625"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625/providers/Microsoft.AppPlatform/Spring/turbottest73625",
    "name": "turbottest73625",
    "region": "westeurope",
    "resource_group": "turbottest73625",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "tags": {
      "name": "turbottest73625"
    },
    "type": "Microsoft.AppPlatform/Spring"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73625/providers/Microsoft.AppPlatform/Spring/turbottest73625",
    "name": "turbottest73625",
    "region": "westeurope",
    "resource_group": "turbottest73625",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "tags": {
      "name": "turbottest73625"
    },
    "type": "Microsoft.AppPlatform/Spring"
  }
]
✔ 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/turbottest73625/providers/Microsoft.AppPlatform/Spring/turbottest73625",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest73625/providers/microsoft.appplatform/spring/turbottest73625"
    ],
    "name": "turbottest73625",
    "tags": {
      "name": "turbottest73625"
    },
    "title": "turbottest73625"
  }
]
✔ PASSED

POSTTEST: tests/azure_spring_cloud_service

TEARDOWN: tests/azure_spring_cloud_service

SUMMARY:

1/1 passed.

Example query results

Results
> select
  id,
  name,
  type,
  provisioning_state,
  sku_name,
  sku_tier,
  version
from
  azure_spring_cloud_service;
+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+------------------------------+--------------------+----------+----------+---------+
| id                                                                                                                                                      | name                | type                         | provisioning_state | sku_name | sku_tier | version |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+------------------------------+--------------------+----------+----------+---------+
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppPlatform/Spring/test-spring-cloud-1 | test-spring-cloud-1 | Microsoft.AppPlatform/Spring | Succeeded          | S0       | Standard | 3       |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+------------------------------+--------------------+----------+----------+---------+
>select
  id,
  name,
  network_profile ->> 'AppNetworkResourceGroup' as network_profile_app_network_resource_group,
  network_profile ->> 'AppSubnetID' as network_profile_app_subnet_id,
  jsonb_pretty(network_profile -> 'OutboundPublicIPs') as network_profile_outbound_public_ips,
  network_profile ->> 'ServiceCidr' as network_profile_service_cidr,
  network_profile ->> 'ServiceRuntimeNetworkResourceGroup' as network_profile_service_runtime_network_resource_group,
  network_profile ->> 'ServiceRuntimeSubnetID' as network_profile_service_runtime_subnet_id
from
  azure_spring_cloud_service;
+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------------------------------+--------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id                                                                                                                                                      | name                | network_profile_app_network_resource_group | network_profile_app_subnet_id                                                                                                                                          | network_profile_outbound_public_ips | network_profile_service_cidr        | network_profile_service_runtime_network_resource_group | network_profile_service_runtime_subnet_id                                                                                                                            |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------------------------------+--------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppPlatform/Spring/test-spring-cloud-1 | test-spring-cloud-1 | ap-app_test-spring-cloud-1_eastus          | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.Network/virtualNetworks/test-vn/subnets/test-subnet-2 | [                                   | 10.0.0.0/16,10.2.0.0/16,10.3.0.1/16 | ap-svc-rt_test-spring-cloud-1_eastus                   | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.Network/virtualNetworks/test-vn/subnets/test-subnet |
|                                                                                                                                                         |                     |                                            |                                                                                                                                                                        |     "20.62.222.93"                  |                                     |                                                        |                                                                                                                                                                      |
|                                                                                                                                                         |                     |                                            |                                                                                                                                                                        | ]                                   |                                     |                                                        |                                                                                                                                                                      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------------------------------+--------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
>

@c0d3r-arnab c0d3r-arnab self-assigned this Sep 28, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Sep 28, 2021 that may be closed by this pull request
ShouldIgnoreError: isNotFoundError([]string{"ResourceNotFound", "ResourceGroupNotFound", "404"}),
},
List: &plugin.ListConfig{
KeyColumns: plugin.SingleColumn("resource_group"),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use parentHydrate -azure_resource_group

}

// If we return the API response directly, the output does not provide
// the contents of DiagnosticSettings
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
// the contents of DiagnosticSettings
// all the contents of DiagnosticSettings


//// TRANSFORM FUNCTION

// If we return the API response directly, the output will not provide the properties of NetworkProfile
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
// If we return the API response directly, the output will not provide the properties of NetworkProfile
// If we return the API response directly, the output does not provide all the properties of NetworkProfile

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 b1e8d10 into main Sep 30, 2021
@bigdatasourav bigdatasourav deleted the issue-312 branch September 30, 2021 11:09
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_spring_cloud_service
2 participants