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_storage_sync. Closes #307 #326

Merged
merged 3 commits into from
Sep 24, 2021
Merged

Add table azure_storage_sync. Closes #307 #326

merged 3 commits into from
Sep 24, 2021

Conversation

c0d3r-arnab
Copy link
Contributor

Integration test logs

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

PRETEST: tests/azure_storage_sync

TEST: tests/azure_storage_sync
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 = "westeurope"
      + name     = "turbottest76647"
    }

  # azurerm_storage_sync.named_test_resource will be created
  + resource "azurerm_storage_sync" "named_test_resource" {
      + id                      = (known after apply)
      + incoming_traffic_policy = "AllowAllTraffic"
      + location                = "westeurope"
      + name                    = "turbottest76647"
      + resource_group_name     = "turbottest76647"
      + tags                    = {
          + "name" = "turbottest76647"
        }
    }

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      = "turbottest76647"
  + 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/turbottest76647]
azurerm_storage_sync.named_test_resource: Creating...
azurerm_storage_sync.named_test_resource: Still creating... [10s elapsed]
azurerm_storage_sync.named_test_resource: Still creating... [20s elapsed]
azurerm_storage_sync.named_test_resource: Still creating... [30s elapsed]
azurerm_storage_sync.named_test_resource: Still creating... [40s elapsed]
azurerm_storage_sync.named_test_resource: Still creating... [50s elapsed]
azurerm_storage_sync.named_test_resource: Creation complete after 53s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest76647/providers/microsoft.storagesync/storageSyncServices/turbottest76647]

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

Outputs:

region = "westeurope"
resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest76647/providers/microsoft.storagesync/storageSyncServices/turbottest76647"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest76647/providers/microsoft.storagesync/storagesyncservices/turbottest76647"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest76647/providers/microsoft.storagesync/storageSyncServices/turbottest76647"
resource_name = "turbottest76647"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"

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

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

POSTTEST: tests/azure_storage_sync

TEARDOWN: tests/azure_storage_sync

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  type,
  provisioning_state
from
  azure_storage_sync;
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| name              | id                                                                                                                                                                 | type             
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-storage-sync | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/microsoft.storagesync/storageSyncServices/test-storage-sync | microsoft.storage
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> select
  name,
  id,
  type,
  provisioning_state,
  incoming_traffic_policy
from
  azure_storage_sync
where
  incoming_traffic_policy = 'AllowVirtualNetworksOnly';
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| name              | id                                                                                                                                                                 | type             
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-storage-sync | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/microsoft.storagesync/storageSyncServices/test-storage-sync | microsoft.storage
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> select
  name,
  id,
  connections ->> 'ID' as connection_id,
  connections ->> 'Name' as connection_name,
  connections ->> 'PrivateEndpointPropertyID' as property_private_endpoint_id,
  jsonb_pretty(connections -> 'PrivateLinkServiceConnectionState') as property_private_link_service_connection_state,
  connections ->> 'Type' as connection_type
from
  azure_storage_sync,
  jsonb_array_elements(private_endpoint_connections) as connections;
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| name              | id                                                                                                                                                                 | connection_id    
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
| test-storage-sync | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/arnab-test-resource-group/providers/microsoft.storagesync/storageSyncServices/test-storage-sync | /subscriptions/d4
|                   |                                                                                                                                                                    |                  
|                   |                                                                                                                                                                    |                  
|                   |                                                                                                                                                                    |                  
|                   |                                                                                                                                                                    |                  
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------
> 

@c0d3r-arnab c0d3r-arnab requested a review from ParthaI September 21, 2021 10:44
@c0d3r-arnab c0d3r-arnab self-assigned this Sep 21, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Sep 21, 2021 that may be closed by this pull request
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.

@c0d3r-arnab please see the comments

azure/table_azure_storage_sync.go Show resolved Hide resolved
azure_storage_sync;
```

### List storage sync which allows traffic only from private endpoints
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 storage sync which allows traffic only from private endpoints
### List storage sync which allows traffic through private endpoints only

}
}

type StoragePrivateEndpointConnections struct {
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
type StoragePrivateEndpointConnections struct {
type StorageSyncPrivateEndpointConnections struct {

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 2412517 into main Sep 24, 2021
@bigdatasourav bigdatasourav deleted the issue-307 branch September 24, 2021 06:41
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_storage_sync
3 participants