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_mysql_flexible_server. Closes #475 #476

Merged
merged 3 commits into from
Apr 25, 2022
Merged

Conversation

bigdatasourav
Copy link
Contributor

Integration test logs

Logs
SETUP: tests/azure_mysql_flexible_server []

PRETEST: tests/azure_mysql_flexible_server

TEST: tests/azure_mysql_flexible_server
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_mysql_flexible_server.named_test_resource will be created
  + resource "azurerm_mysql_flexible_server" "named_test_resource" {
      + administrator_login           = "mradministrator"
      + administrator_password        = (sensitive value)
      + backup_retention_days         = 7
      + fqdn                          = (known after apply)
      + geo_redundant_backup_enabled  = false
      + id                            = (known after apply)
      + location                      = "eastus"
      + name                          = "turbottest90870"
      + public_network_access_enabled = (known after apply)
      + replica_capacity              = (known after apply)
      + replication_role              = (known after apply)
      + resource_group_name           = "turbottest90870"
      + sku_name                      = "GP_Standard_D2ds_v4"
      + tags                          = {
          + "name" = "turbottest90870"
        }
      + version                       = "5.7"

      + storage {
          + auto_grow_enabled = (known after apply)
          + iops              = (known after apply)
          + size_gb           = (known after apply)
        }
    }

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

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

Changes to Outputs:
  + resource_aka       = (known after apply)
  + resource_aka_lower = (known after apply)
  + resource_id        = (known after apply)
  + resource_name      = "turbottest90870"
  + server_fqdn        = (known after apply)
  + subscription_id    = "3510ae4d-530b-497d-8f30-53b9616fc6c1"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 1s [id=/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest90870]
azurerm_mysql_flexible_server.named_test_resource: Creating...
azurerm_mysql_flexible_server.named_test_resource: Still creating... [10s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [20s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [30s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [40s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [50s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [1m0s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [1m10s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [1m20s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [1m30s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [1m40s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [1m50s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [2m0s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [2m10s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [2m20s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [2m30s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [2m40s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [2m50s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [3m0s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [3m10s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [3m20s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [3m30s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [3m40s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [3m50s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [4m0s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Still creating... [4m10s elapsed]
azurerm_mysql_flexible_server.named_test_resource: Creation complete after 4m12s [id=/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest90870/providers/Microsoft.DBforMySQL/flexibleServers/turbottest90870]

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

Outputs:

resource_aka = "azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest90870/providers/Microsoft.DBforMySQL/flexibleServers/turbottest90870"
resource_aka_lower = "azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourcegroups/turbottest90870/providers/microsoft.dbformysql/flexibleservers/turbottest90870"
resource_id = "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest90870/providers/Microsoft.DBforMySQL/flexibleServers/turbottest90870"
resource_name = "turbottest90870"
server_fqdn = "turbottest90870.mysql.database.azure.com"
subscription_id = "3510ae4d-530b-497d-8f30-53b9616fc6c1"

Running SQL query: test-get-query.sql
[
  {
    "administrator_login": "mradministrator",
    "fully_qualified_domain_name": "turbottest90870.mysql.database.azure.com",
    "name": "turbottest90870",
    "resource_group": "turbottest90870",
    "subscription_id": "3510ae4d-530b-497d-8f30-53b9616fc6c1",
    "version": "5.7"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest90870/providers/Microsoft.DBforMySQL/flexibleServers/turbottest90870",
    "name": "turbottest90870"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest90870/providers/Microsoft.DBforMySQL/flexibleServers/turbottest90870",
      "azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourcegroups/turbottest90870/providers/microsoft.dbformysql/flexibleservers/turbottest90870"
    ],
    "name": "turbottest90870",
    "tags": {
      "name": "turbottest90870"
    },
    "title": "turbottest90870"
  }
]
✔ PASSED

POSTTEST: tests/azure_mysql_flexible_server

TEARDOWN: tests/azure_mysql_flexible_server

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  location,
  backup_retention_days,
  storage_iops,
  public_network_access
from
  azure_mysql_flexible_server;
+------------+-----------------------------------------------------------------------------------------------------------------------------------+----------+-----------------------+--------------+--------
| name       | id                                                                                                                                | location | backup_retention_days | storage_iops | public_
+------------+-----------------------------------------------------------------------------------------------------------------------------------+----------+-----------------------+--------------+--------
| test-table | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/test/providers/Microsoft.DBforMySQL/flexibleServers/test-table | East US  | 7                     | 360          | Enabled
+------------+-----------------------------------------------------------------------------------------------------------------------------------+----------+-----------------------+--------------+--------
> select
  name,
  id,
  public_network_access
from
  azure_mysql_flexible_server
where
  public_network_access = 'Disabled';
+------+----+-----------------------+
| name | id | public_network_access |
+------+----+-----------------------+
+------+----+-----------------------+
> select
  name as server_name,
  id as server_id,
  configurations ->> 'Name' as configuration_name,
  configurations -> 'ConfigurationProperties' ->> 'value' as value
from
  azure_mysql_flexible_server,
  jsonb_array_elements(flexible_server_configurations) as configurations
where
   configurations ->> 'Name' = 'audit_log_enabled';
+-------------+-----------------------------------------------------------------------------------------------------------------------------------+--------------------+-------+
| server_name | server_id                                                                                                                         | configuration_name | value |
+-------------+-----------------------------------------------------------------------------------------------------------------------------------+--------------------+-------+
| test-table  | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/test/providers/Microsoft.DBforMySQL/flexibleServers/test-table | audit_log_enabled  | OFF   |
+-------------+-----------------------------------------------------------------------------------------------------------------------------------+--------------------+-------+

@bigdatasourav bigdatasourav self-assigned this Apr 22, 2022
@bigdatasourav bigdatasourav linked an issue Apr 22, 2022 that may be closed by this pull request
public_network_access = 'Disabled';
```

### List servers with 'storage_auto_grow' disabled
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 servers with 'storage_auto_grow' disabled
### List servers with storage auto grow disabled

storage_auto_grow = 'Disabled';
```

### List servers with 'backup_retention_days' greater than 90 days
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 servers with 'backup_retention_days' greater than 90 days
### List servers with backup retention days greater than 90 days

jsonb_array_elements(flexible_server_configurations) as configurations;
```

### Current state of audit_log_enabled parameter for the servers
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
### Current state of audit_log_enabled parameter for the servers
### List state of audit log enabled for the servers
Suggested change
### Current state of audit_log_enabled parameter for the servers
### Current state of audit_log_enabled parameter for the servers

jsonb_array_elements(flexible_server_configurations) as configurations;
```

### Current state of audit_log_enabled parameter for the servers
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
### Current state of audit_log_enabled parameter for the servers
### List state of audit log enabled for the servers
Suggested change
### Current state of audit_log_enabled parameter for the servers
### Current state of audit_log_enabled parameter for the servers

configurations ->> 'Name' = 'audit_log_enabled';
```

### List servers with slow_query_log parameter enabled
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 servers with slow_query_log parameter enabled
### List servers with slow query log enabled
Suggested change
### List servers with slow_query_log parameter enabled
### List servers with slow_query_log parameter enabled

configurations ->> 'Name' = 'audit_log_enabled';
```

### List servers with slow_query_log parameter enabled
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 servers with slow_query_log parameter enabled
### List servers with slow query log enabled
Suggested change
### List servers with slow_query_log parameter enabled
### List servers with slow_query_log parameter enabled

and configurations ->> 'Name' = 'slow_query_log';
```

### List servers with log_output parameter set to file
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 servers with log_output parameter set to file
### List servers with log output set to file
Suggested change
### List servers with log_output parameter set to file
### List servers with log_output parameter set to file

and configurations ->> 'Name' = 'slow_query_log';
```

### List servers with log_output parameter set to file
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 servers with log_output parameter set to file
### List servers with log output set to file
Suggested change
### List servers with log_output parameter set to file
### List servers with log_output parameter set to file

@bigdatasourav bigdatasourav merged commit d2765e3 into main Apr 25, 2022
@bigdatasourav bigdatasourav deleted the issue-475 branch April 25, 2022 06:25
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.

azure_mysql_server Does not show Flexible MySQL servers
3 participants