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_mssql_elasticpool. Closes #272 #276

Merged
merged 6 commits into from
Aug 24, 2021
Merged

Conversation

bigdatasourav
Copy link
Contributor

@bigdatasourav bigdatasourav commented Aug 23, 2021

Integration test logs

Logs
SETUP: tests/azure_mssql_elasticpool []

PRETEST: tests/azure_mssql_elasticpool

TEST: tests/azure_mssql_elasticpool
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_mssql_elasticpool.named_test_resource will be created
  + resource "azurerm_mssql_elasticpool" "named_test_resource" {
      + elastic_pool_properties = (known after apply)
      + id                      = (known after apply)
      + location                = "eastus"
      + max_size_bytes          = (known after apply)
      + max_size_gb             = 4.8828125
      + name                    = "turbottest73591"
      + resource_group_name     = "turbottest73591"
      + server_name             = "turbottest73591"
      + tags                    = (known after apply)

      + per_database_settings {
          + max_capacity = 5
          + min_capacity = 0
        }

      + sku {
          + capacity = 50
          + name     = "BasicPool"
          + tier     = "Basic"
        }
    }

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

  # azurerm_sql_server.named_test_resource will be created
  + resource "azurerm_sql_server" "named_test_resource" {
      + administrator_login          = "4dm1n157r470r"
      + administrator_login_password = (sensitive value)
      + fully_qualified_domain_name  = (known after apply)
      + id                           = (known after apply)
      + location                     = "eastus"
      + name                         = "turbottest73591"
      + resource_group_name          = "turbottest73591"
      + tags                         = (known after apply)
      + version                      = "12.0"
    }

Plan: 3 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      = "turbottest73591"
  + subscription_id    = "d46d7416-f95f-4771-bbb5-529d4c76659c"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 4s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591]
azurerm_sql_server.named_test_resource: Creating...
azurerm_sql_server.named_test_resource: Still creating... [10s elapsed]
azurerm_sql_server.named_test_resource: Still creating... [20s elapsed]
azurerm_sql_server.named_test_resource: Still creating... [30s elapsed]
azurerm_sql_server.named_test_resource: Still creating... [40s elapsed]
azurerm_sql_server.named_test_resource: Still creating... [50s elapsed]
azurerm_sql_server.named_test_resource: Still creating... [1m0s elapsed]
azurerm_sql_server.named_test_resource: Still creating... [1m10s elapsed]
azurerm_sql_server.named_test_resource: Creation complete after 1m14s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591]
azurerm_mssql_elasticpool.named_test_resource: Creating...
azurerm_mssql_elasticpool.named_test_resource: Still creating... [10s elapsed]
azurerm_mssql_elasticpool.named_test_resource: Still creating... [20s elapsed]
azurerm_mssql_elasticpool.named_test_resource: Still creating... [30s elapsed]
azurerm_mssql_elasticpool.named_test_resource: Still creating... [40s elapsed]
azurerm_mssql_elasticpool.named_test_resource: Still creating... [50s elapsed]
azurerm_mssql_elasticpool.named_test_resource: Still creating... [1m0s elapsed]
azurerm_mssql_elasticpool.named_test_resource: Creation complete after 1m10s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591/elasticPools/turbottest73591]

Warning: Version constraints inside provider configuration blocks are deprecated

  on variables.tf line 21, in provider "azurerm":
  21:   version         = "=1.36.0"

Terraform 0.13 and earlier allowed provider version constraints inside the
provider configuration block, but that is now deprecated and will be removed
in a future version of Terraform. To silence this warning, move the provider
version constraint into the required_providers block.

Warning: Deprecated Resource

  with data.null_data_source.resource,
  on variables.tf line 28, in data "null_data_source" "resource":
  28: data "null_data_source" "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

(and one more similar warning elsewhere)

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

Outputs:

resource_aka = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591/elasticPools/turbottest73591"
resource_aka_lower = "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest73591/providers/microsoft.sql/servers/turbottest73591/elasticpools/turbottest73591"
resource_id = "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591/elasticPools/turbottest73591"
resource_name = "turbottest73591"
subscription_id = "d46d7416-f95f-4771-bbb5-529d4c76659c"

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591/elasticPools/turbottest73591",
    "name": "turbottest73591",
    "resource_group": "turbottest73591",
    "subscription_id": "d46d7416-f95f-4771-bbb5-529d4c76659c",
    "type": "Microsoft.Sql/servers/elasticPools"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591/elasticPools/turbottest73591",
    "name": "turbottest73591",
    "type": "Microsoft.Sql/servers/elasticPools"
  }
]
✔ 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/turbottest73591/providers/Microsoft.Sql/servers/turbottest73591/elasticPools/turbottest73591",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest73591/providers/microsoft.sql/servers/turbottest73591/elasticpools/turbottest73591"
    ],
    "name": "turbottest73591",
    "title": "turbottest73591"
  }
]
✔ PASSED

POSTTEST: tests/azure_mssql_elasticpool

TEARDOWN: tests/azure_mssql_elasticpool

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  state,
  dtu,
  zone_redundant
from
  azure_mssql_elasticpool;
+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+-------+-----+----------------+
| name     | id                                                                                                                                               | state | dtu | zone_redundant |
+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+-------+-----+----------------+
| testPool | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/hipaa-hitrust/providers/Microsoft.Sql/servers/testdblog/elasticPools/testPool | Ready | 50  | false          |
+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+-------+-----+----------------+
> select
  name,
  id,
  state,
  dtu,
  zone_redundant
from
  azure_mssql_elasticpool
where
  zone_redundant;
+------+----+-------+-----+----------------+
| name | id | state | dtu | zone_redundant |
+------+----+-------+-----+----------------+
+------+----+-------+-----+----------------+
> select
  name,
  id,
  state,
  dtu,
  zone_redundant
from
  azure_mssql_elasticpool
where
  not zone_redundant;
+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+-------+-----+----------------+
| name     | id                                                                                                                                               | state | dtu | zone_redundant |
+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+-------+-----+----------------+
| testPool | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/hipaa-hitrust/providers/Microsoft.Sql/servers/testdblog/elasticPools/testPool | Ready | 50  | false          |
+----------+--------------------------------------------------------------------------------------------------------------------------------------------------+-------+-----+----------------+

@bigdatasourav bigdatasourav self-assigned this Aug 23, 2021
bigdatasourav added 2 commits August 23, 2021 13:14
@bigdatasourav bigdatasourav linked an issue Aug 23, 2021 that may be closed by this pull request
Copy link
Contributor

@rajlearner17 rajlearner17 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 1202ebc into main Aug 24, 2021
@bigdatasourav bigdatasourav deleted the issue-272 branch August 24, 2021 11:39
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_mssql_elasticpool
3 participants