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_service_fabric_cluster. Closes #282 #310

Merged
merged 4 commits into from
Sep 23, 2021
Merged

Conversation

c0d3r-arnab
Copy link
Contributor

Integration test logs

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

PRETEST: tests/azure_service_fabric_cluster

TEST: tests/azure_service_fabric_cluster
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_resource_group.named_test_resource will be created
  + resource "azurerm_resource_group" "named_test_resource" {
      + id       = (known after apply)
      + location = "eastus"
      + name     = "turbottest57118"
    }

  # azurerm_service_fabric_cluster.named_test_resource will be created
  + resource "azurerm_service_fabric_cluster" "named_test_resource" {
      + cluster_code_version = "7.2.413.9590"
      + cluster_endpoint     = (known after apply)
      + id                   = (known after apply)
      + location             = "eastus"
      + management_endpoint  = "https://example:80"
      + name                 = "turbottest57118"
      + reliability_level    = "Bronze"
      + resource_group_name  = "turbottest57118"
      + upgrade_mode         = "Manual"
      + vm_image             = "Windows"

      + node_type {
          + client_endpoint_port = 2020
          + durability_level     = "Bronze"
          + http_endpoint_port   = 80
          + instance_count       = 3
          + is_primary           = true
          + name                 = "first"

          + application_ports {
              + end_port   = (known after apply)
              + start_port = (known after apply)
            }

          + ephemeral_ports {
              + end_port   = (known after apply)
              + start_port = (known after apply)
            }
        }
    }

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

Changes to Outputs:
  + management_endpoint = "https://example:80"
  + region              = "eastus"
  + reliability_level   = "Bronze"
  + resource_aka        = (known after apply)
  + resource_aka_lower  = (known after apply)
  + resource_id         = (known after apply)
  + resource_name       = "turbottest57118"
  + subscription_id     = "d46d7416-f95f-4771-bbb5-529d4c76659c"
  + upgrade_mode        = "Manual"
  + vm_image            = "Windows"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 2s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest57118]
azurerm_service_fabric_cluster.named_test_resource: Creating...
azurerm_service_fabric_cluster.named_test_resource: Still creating... [10s elapsed]
azurerm_service_fabric_cluster.named_test_resource: Creation complete after 11s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/Microsoft.ServiceFabric/clusters/turbottest57118]

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

Outputs:

management_endpoint = "https://example:80"
region = "eastus"
reliability_level = "Bronze"
resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/Microsoft.ServiceFabric/clusters/turbottest57118"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/microsoft.servicefabric/clusters/turbottest57118"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/Microsoft.ServiceFabric/clusters/turbottest57118"
resource_name = "turbottest57118"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"
upgrade_mode = "Manual"
vm_image = "Windows"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/Microsoft.ServiceFabric/clusters/turbottest57118",
    "management_endpoint": "https://example:80",
    "name": "turbottest57118",
    "region": "eastus",
    "reliability_level": "Bronze",
    "resource_group": "turbottest57118",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "type": "Microsoft.ServiceFabric/clusters",
    "upgrade_mode": "Manual",
    "vm_image": "Windows"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/Microsoft.ServiceFabric/clusters/turbottest57118",
    "management_endpoint": "https://example:80",
    "name": "turbottest57118",
    "region": "eastus",
    "reliability_level": "Bronze",
    "resource_group": "turbottest57118",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "type": "Microsoft.ServiceFabric/clusters",
    "upgrade_mode": "Manual",
    "vm_image": "Windows"
  }
]
✔ 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/turbottest57118/providers/Microsoft.ServiceFabric/clusters/turbottest57118",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest57118/providers/microsoft.servicefabric/clusters/turbottest57118"
    ],
    "name": "turbottest57118",
    "title": "turbottest57118"
  }
]
✔ PASSED

POSTTEST: tests/azure_service_fabric_cluster

TEARDOWN: tests/azure_service_fabric_cluster

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  provisioning_state, 
  type,
  cluster_code_version,
  management_endpoint,
  upgrade_mode,
  vm_image
from
  azure_service_fabric_cluster;
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+--
| name                | id                                                                                                                                                          | provisioning_state | t
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+--
| test-fabric-cluster | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/arnab-test-resource-group/providers/Microsoft.ServiceFabric/clusters/test-fabric-cluster | Succeeded          | M
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+--
> select
  name,
  id,
  azure_active_directory ->> 'clientApplication' as client_application,
  azure_active_directory ->> 'clusterApplication' as cluster_application,
  azure_active_directory ->> 'tenantId' as tenant_id
from
  azure_service_fabric_cluster;
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
| name                | id                                                                                                                                                          | client_application    
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
| test-fabric-cluster | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/arnab-test-resource-group/providers/Microsoft.ServiceFabric/clusters/test-fabric-cluster | test-client-applicatio
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
> select
  name,
  id,
  certificate ->> 'thumbprint' as thumbprint,
  certificate ->> 'thumbprintSecondary' as thumbprint_secondary,
  certificate ->> 'x509StoreName' as x509_store_name
from
  azure_service_fabric_cluster;
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
| name                | id                                                                                                                                                          | thumbprint            
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
| test-fabric-cluster | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/arnab-test-resource-group/providers/Microsoft.ServiceFabric/clusters/test-fabric-cluster | 08960831263E0719DF7501
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
> select
  name,
  id,
  settings ->> 'name' as settings_name,
  jsonb_pretty(settings -> 'parameters') as settings_parameters
from
  azure_service_fabric_cluster,
  jsonb_array_elements(fabric_settings) as settings;
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+------
| name                | id                                                                                                                                                          | settings_name  | setti
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+------
| test-fabric-cluster | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/arnab-test-resource-group/providers/Microsoft.ServiceFabric/clusters/test-fabric-cluster | ClusterManager | [    
|                     |                                                                                                                                                             |                |     {
|                     |                                                                                                                                                             |                |      
|                     |                                                                                                                                                             |                |      
|                     |                                                                                                                                                             |                |     }
|                     |                                                                                                                                                             |                | ]    
| test-fabric-cluster | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/arnab-test-resource-group/providers/Microsoft.ServiceFabric/clusters/test-fabric-cluster | Security       | [    
|                     |                                                                                                                                                             |                |     {
|                     |                                                                                                                                                             |                |      
|                     |                                                                                                                                                             |                |      
|                     |                                                                                                                                                             |                |     }
|                     |                                                                                                                                                             |                | ]    
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+------
> select
  name,
  id,
  types ->> 'clientConnectionEndpointPort' as type_client_connection_endpoint_port,
  types ->> 'durabilityLevel' as type_durability_level,
  types -> 'httpGatewayEndpointPort' as type_http_gateway_endpoint_port,
  types -> 'isPrimary' as type_is_primary,
  types ->> 'name' as type_name,
  types -> 'vmInstanceCount' as type_vm_instance_count,
  jsonb_pretty(types -> 'applicationPorts') as settings_application_ports,
  jsonb_pretty(types -> 'ephemeralPorts') as settings_ephemeral_ports
from
  azure_service_fabric_cluster,
  jsonb_array_elements(node_types) as types;
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
| name                | id                                                                                                                                                          | type_client_connection
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
| test-fabric-cluster | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/arnab-test-resource-group/providers/Microsoft.ServiceFabric/clusters/test-fabric-cluster | 19000                 
|                     |                                                                                                                                                             |                       
|                     |                                                                                                                                                             |                       
|                     |                                                                                                                                                             |                       
+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------
>

@c0d3r-arnab c0d3r-arnab self-assigned this Sep 8, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Sep 8, 2021 that may be closed by this pull request
@rajlearner17 rajlearner17 removed the request for review from khushboo9024 September 14, 2021 05:43
VMImage *string
}

//// LIST FUNCTIONS
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
//// LIST FUNCTIONS
//// LIST FUNCTION

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 71c95e2 into main Sep 23, 2021
@bigdatasourav bigdatasourav deleted the issue-282 branch September 23, 2021 13:16
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_service_fabric_cluster
3 participants