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_app_configuration. Closes #308 #344

Merged
merged 4 commits into from
Sep 28, 2021
Merged

Conversation

c0d3r-arnab
Copy link
Contributor

Integration test logs

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

PRETEST: tests/azure_app_configuration

TEST: tests/azure_app_configuration
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_app_configuration.named_test_resource will be created
  + resource "azurerm_app_configuration" "named_test_resource" {
      + endpoint            = (known after apply)
      + id                  = (known after apply)
      + location            = "westeurope"
      + name                = "turbottest8335"
      + primary_read_key    = (known after apply)
      + primary_write_key   = (known after apply)
      + resource_group_name = "turbottest8335"
      + secondary_read_key  = (known after apply)
      + secondary_write_key = (known after apply)
      + sku                 = "free"
    }

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

Plan: 2 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      = "turbottest8335"
  + subscription_id    = "d46d7416-f95f-4771-bbb5-529d4c76659c"
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/turbottest8335]
azurerm_app_configuration.named_test_resource: Creating...
azurerm_app_configuration.named_test_resource: Still creating... [10s elapsed]
azurerm_app_configuration.named_test_resource: Creation complete after 19s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest8335/providers/Microsoft.AppConfiguration/configurationStores/turbottest8335]

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

Outputs:

region = "westeurope"
resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest8335/providers/Microsoft.AppConfiguration/configurationStores/turbottest8335"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest8335/providers/microsoft.appconfiguration/configurationstores/turbottest8335"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest8335/providers/Microsoft.AppConfiguration/configurationStores/turbottest8335"
resource_name = "turbottest8335"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"

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

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

POSTTEST: tests/azure_app_configuration

TEARDOWN: tests/azure_app_configuration

SUMMARY:

1/1 passed.

Example query results

Results
arnab@turbotindias-MacBook-Pro steampipe-plugin-azure % stampipe query
zsh: command not found: stampipe
arnab@turbotindias-MacBook-Pro steampipe-plugin-azure % steampipe query                                                                                                       
Welcome to Steampipe v0.7.3
For more information, type .help
> select
  id,
  name,
  type,
  provisioning_state,
  creation_date
from
  azure_app_configuration;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
| id                                                                                                                                                                                      | name            
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppConfiguration/configurationStores/testing-application-configuration | testing-applicat
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
> select
  id,
  name,
  type,
  provisioning_state,
  public_network_access
from
  azure_app_configuration
where
  public_network_access = 'Enabled';
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
| id                                                                                                                                                                                      | name            
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppConfiguration/configurationStores/testing-application-configuration | testing-applicat
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
> select
  id,
  name,
  identity -> 'type' as identity_type,
  jsonb_pretty(identity -> 'userAssignedIdentities') as identity_user_assigned_identities
from
  azure_app_configuration
where
    exists (
      select
      from
        unnest(regexp_split_to_array(identity ->> 'type', ',')) elem
      where
        trim(elem) = 'UserAssigned'
  );
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
| id                                                                                                                                                                                      | name            
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
| /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppConfiguration/configurationStores/testing-application-configuration | testing-applicat
|                                                                                                                                                                                         |                 
|                                                                                                                                                                                         |                 
|                                                                                                                                                                                         |                 
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------
> select
  name as app_config_name,
  id as app_config_id,
  connections ->> 'id' as connection_id,
  connections ->> 'privateEndpointPropertyId' as connection_private_endpoint_property_id,
  connections ->> 'privateLinkServiceConnectionStateActionsRequired' as connection_actions_required,
  connections ->> 'privateLinkServiceConnectionStateDescription' as connection_description,
  connections ->> 'privateLinkServiceConnectionStateStatus' as connection_status,
  connections ->> 'provisioningState' as connection_provisioning_state
from
  azure_app_configuration,
  jsonb_array_elements(private_endpoint_connections) as connections;
+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
| app_config_name                   | app_config_id                                                                                                                                                         
+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
| testing-application-configuration | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppConfiguration/configurationStores/testing-applicat
+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
> select
  name as app_config_name,
  id as app_config_id,
  encryption -> 'keyVaultProperties' ->> 'identityClientId' as key_vault_identity_client_id,
  encryption -> 'keyVaultProperties' ->> 'keyIdentifier' as key_vault_key_identifier
from
  azure_app_configuration;
+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
| app_config_name                   | app_config_id                                                                                                                                                         
+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
| testing-application-configuration | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/Microsoft.AppConfiguration/configurationStores/testing-applicat
+-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 

@c0d3r-arnab c0d3r-arnab self-assigned this Sep 27, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Sep 27, 2021 that may be closed by this pull request
@ParthaI
Copy link
Contributor

ParthaI commented Sep 27, 2021

@c0d3r-arnab please see the comments

Copy link
Contributor

@ParthaI ParthaI 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

@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 c0a55f6 into main Sep 28, 2021
@bigdatasourav bigdatasourav deleted the issue-308 branch September 28, 2021 13:21
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_app_configuration
3 participants