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 server keys details in table azure_postgresql_server closes #287 #299

Merged
merged 5 commits into from
Sep 20, 2021

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Sep 7, 2021

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

PRETEST: tests/azure_postgresql_server

TEST: tests/azure_postgresql_server
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 5s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688]
azurerm_postgresql_server.named_test_resource: Creating...
azurerm_postgresql_server.named_test_resource: Still creating... [10s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [20s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [30s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [40s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [50s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [1m0s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [1m10s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [1m20s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [1m30s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [1m40s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [1m50s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [2m0s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [2m10s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [2m20s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [2m30s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [2m40s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [2m50s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [3m0s elapsed]
azurerm_postgresql_server.named_test_resource: Still creating... [3m10s elapsed]
azurerm_postgresql_server.named_test_resource: Creation complete after 3m12s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688]
azurerm_postgresql_active_directory_administrator.named_test_resource: Creating...
azurerm_postgresql_configuration.named_test_resource: Creating...
azurerm_postgresql_firewall_rule.named_test_resource: Creating...
azurerm_postgresql_firewall_rule.named_test_resource: Still creating... [10s elapsed]
azurerm_postgresql_configuration.named_test_resource: Still creating... [10s elapsed]
azurerm_postgresql_active_directory_administrator.named_test_resource: Still creating... [10s elapsed]
azurerm_postgresql_active_directory_administrator.named_test_resource: Creation complete after 18s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688/administrators/activeDirectory]
azurerm_postgresql_configuration.named_test_resource: Creation complete after 20s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688/configurations/log_checkpoints]
azurerm_postgresql_firewall_rule.named_test_resource: Still creating... [20s elapsed]
azurerm_postgresql_firewall_rule.named_test_resource: Creation complete after 21s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688/firewallRules/turbottest62688]

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


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

Outputs:

location = eastus
resource_aka = azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688
resource_aka_lower = azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest62688/providers/microsoft.dbforpostgresql/servers/turbottest62688
resource_id = /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688
resource_name = turbottest62688
server_fqdn = turbottest62688.postgres.database.azure.com
subscription_id = d46d7416-f95f-4771-bbb5-529d4c76659c

Running SQL query: test-get-query.sql
[
  {
    "administrator_login": "psqladminun",
    "backup_retention_days": 7,
    "fully_qualified_domain_name": "turbottest62688.postgres.database.azure.com",
    "geo_redundant_backup": "Disabled",
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688",
    "location": "eastus",
    "minimal_tls_version": "TLS1_2",
    "name": "turbottest62688",
    "public_network_access": "Enabled",
    "region": "eastus",
    "resource_group": "turbottest62688",
    "sku_family": "Gen5",
    "sku_name": "B_Gen5_1",
    "sku_size": null,
    "sku_tier": "Basic",
    "ssl_enforcement": "Enabled",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "type": "Microsoft.DBforPostgreSQL/servers",
    "version": "9.5"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "configuration_name": "log_checkpoints",
    "configuration_value": "on",
    "end_ip_address": "40.112.8.12",
    "name": "turbottest62688",
    "rule_name": "turbottest62688",
    "rule_type": "Microsoft.DBforPostgreSQL/servers/firewallRules",
    "server_admin_login_name": "ActiveDirectory",
    "start_ip_address": "40.112.8.12"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688",
    "location": "eastus",
    "name": "turbottest62688"
  }
]
✔ 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/turbottest62688/providers/Microsoft.DBforPostgreSQL/servers/turbottest62688",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest62688/providers/microsoft.dbforpostgresql/servers/turbottest62688"
    ],
    "name": "turbottest62688",
    "tags": {
      "name": "turbottest62688"
    },
    "title": "turbottest62688"
  }
]
✔ PASSED

POSTTEST: tests/azure_postgresql_server

TEARDOWN: tests/azure_postgresql_server

SUMMARY:

1/1 passed.

Example query results

Results
select name, jsonb_pretty(server_keys) as server_keys from azure_postgresql_server;
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| name          | server_keys                                                                                                                                                                               
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| my-service-23 | [                                                                                                                                                                                         
|               |     {                                                                                                                                                                                     
|               |         "Type": "Microsoft.DBforPostgreSQL/servers/keys",                                                                                                                                 
|               |         "ServerKeyId": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbot_rg/providers/Microsoft.DBforPostgreSQL/servers/my-service-23/keys/test-server-key_test_5
|               |         "ServerKeyUri": "https://test-server-key.vault.azure.net/keys/test/50fd2286c589466b87fec8d89866530d",                                                                             
|               |         "ServerKeyKind": "azurekeyvault",                                                                                                                                                 
|               |         "ServerKeyName": "test-server-key_test_50fd2286c589466b87fec8d89866530d",                                                                                                         
|               |         "ServerKeyType": "AzureKeyVault",                                                                                                                                                 
|               |         "ServerKeyCreationDate": "2021-09-17T09:55:45.8Z"                                                                                                                                 
|               |     }                                                                                                                                                                                     
|               | ]                                                                                                                                                                                         
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@ParthaI ParthaI self-assigned this Sep 7, 2021
@ParthaI ParthaI linked an issue Sep 7, 2021 that may be closed by this pull request
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 d769276 into main Sep 20, 2021
@bigdatasourav bigdatasourav deleted the issue-287 branch September 20, 2021 12:56
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 server keys details in table azure_postgresql_server
2 participants