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_key_vault_key_version closes #548 #549

Merged
merged 4 commits into from
Nov 25, 2022
Merged

Add table azure_key_vault_key_version closes #548 #549

merged 4 commits into from
Nov 25, 2022

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Nov 23, 2022

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

PRETEST: tests/azure_key_vault_key_version

TEST: tests/azure_key_vault_key_version
Running terraform
data.azurerm_client_config.current: Reading...
data.azurerm_client_config.current: Read complete after 0s [id=Y2xpZW50Q29uZmlncy9jbGllbnRJZD0wNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDY7b2JqZWN0SWQ9MDZmZDQ2YjAtYTg2Ny00OWExLWE0ZjEtZjc3Njg0NjVjYWJhO3N1YnNjcmlwdGlvbklkPWQ0NmQ3NDE2LWY5NWYtNDc3MS1iYmI1LTUyOWQ0Yzc2NjU5Yzt0ZW5hbnRJZD1jZGZmZDcwOC03ZGEwLTRjZWEtYWJlYi0wYTRjMzM0ZDdmNjQ=]
data.null_data_source.resource: Reading...
data.null_data_source.resource: Read complete after 0s [id=static]

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_key_vault.named_test_resource will be created
  + resource "azurerm_key_vault" "named_test_resource" {
      + access_policy                 = [
          + {
              + application_id          = null
              + certificate_permissions = null
              + key_permissions         = [
                  + "Create",
                  + "Delete",
                  + "Get",
                  + "Purge",
                  + "Recover",
                ]
              + object_id               = "06fd46b0-a867-49a1-a4f1-f7768465caba"
              + secret_permissions      = [
                  + "Set",
                ]
              + storage_permissions     = null
              + tenant_id               = "cdffd708-7da0-4cea-abeb-0a4c334d7f64"
            },
        ]
      + id                            = (known after apply)
      + location                      = "westus"
      + name                          = "turbottest44684"
      + public_network_access_enabled = true
      + resource_group_name           = "turbottest44684"
      + sku_name                      = "standard"
      + soft_delete_retention_days    = 7
      + tags                          = {
          + "name" = "turbottest44684"
        }
      + tenant_id                     = "cdffd708-7da0-4cea-abeb-0a4c334d7f64"
      + vault_uri                     = (known after apply)

      + network_acls {
          + bypass                     = (known after apply)
          + default_action             = (known after apply)
          + ip_rules                   = (known after apply)
          + virtual_network_subnet_ids = (known after apply)
        }
    }

  # azurerm_key_vault_key.named_test_resource will be created
  + resource "azurerm_key_vault_key" "named_test_resource" {
      + curve                   = (known after apply)
      + e                       = (known after apply)
      + id                      = (known after apply)
      + key_opts                = [
          + "decrypt",
          + "encrypt",
          + "sign",
          + "unwrapKey",
          + "verify",
          + "wrapKey",
        ]
      + key_size                = 2048
      + key_type                = "RSA"
      + key_vault_id            = (known after apply)
      + n                       = (known after apply)
      + name                    = "turbottest44684"
      + public_key_openssh      = (known after apply)
      + public_key_pem          = (known after apply)
      + resource_id             = (known after apply)
      + resource_versionless_id = (known after apply)
      + tags                    = {
          + "name" = "turbottest44684"
        }
      + version                 = (known after apply)
      + versionless_id          = (known after apply)
      + x                       = (known after apply)
      + y                       = (known after apply)
    }

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

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

Changes to Outputs:
  + key_uri_without_version = (known after apply)
  + key_version             = (known after apply)
  + location                = "westus"
  + location_lower          = "westus"
  + resource_aka            = (known after apply)
  + resource_aka_lower      = (known after apply)
  + resource_id             = (known after apply)
  + resource_name           = "turbottest44684"
  + subscription_id         = "h475jfhy3-f95f-4771-bbb5-529d4c7673yr"
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 4s [id=/subscriptions/h475jfhy3-f95f-4771-bbb5-529d4c7673yr/resourceGroups/turbottest44684]
azurerm_key_vault.named_test_resource: Creating...
azurerm_key_vault.named_test_resource: Still creating... [10s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [20s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [30s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [40s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [50s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m0s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m10s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m20s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m30s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m40s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m50s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m0s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m10s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m20s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m30s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m40s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m50s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [3m0s elapsed]
azurerm_key_vault.named_test_resource: Creation complete after 3m1s [id=/subscriptions/h475jfhy3-f95f-4771-bbb5-529d4c7673yr/resourceGroups/turbottest44684/providers/Microsoft.KeyVault/vaults/turbottest44684]
azurerm_key_vault_key.named_test_resource: Creating...
azurerm_key_vault_key.named_test_resource: Creation complete after 3s [id=https://turbottest44684.vault.azure.net/keys/turbottest44684/fe906fb885f34d8789f94973bd915080]

Warning: Deprecated

  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:

key_uri_without_version = "https://turbottest44684.vault.azure.net/keys/turbottest44684"
key_version = "fe906fb885f34d8789f94973bd915080"
location = "westus"
location_lower = "westus"
resource_aka = "azure://https://turbottest44684.vault.azure.net/keys/turbottest44684/fe906fb885f34d8789f94973bd915080/fe906fb885f34d8789f94973bd915080"
resource_aka_lower = "azure://https://turbottest44684.vault.azure.net/keys/turbottest44684/fe906fb885f34d8789f94973bd915080/fe906fb885f34d8789f94973bd915080"
resource_id = "https://turbottest44684.vault.azure.net/keys/turbottest44684/fe906fb885f34d8789f94973bd915080/fe906fb885f34d8789f94973bd915080"
resource_name = "turbottest44684"
subscription_id = "h475jfhy3-f95f-4771-bbb5-529d4c7673yr"

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/h475jfhy3-f95f-4771-bbb5-529d4c7673yr/resourceGroups/turbottest44684/providers/Microsoft.KeyVault/vaults/turbottest44684/keys/turbottest44684/versions/fe906fb885f34d8789f94973bd915080",
    "name": "fe906fb885f34d8789f94973bd915080"
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/h475jfhy3-f95f-4771-bbb5-529d4c7673yr/resourceGroups/turbottest44684/providers/Microsoft.KeyVault/vaults/turbottest44684/keys/turbottest44684/versions/fe906fb885f34d8789f94973bd915080",
      "azure:///subscriptions/h475jfhy3-f95f-4771-bbb5-529d4c7673yr/resourcegroups/turbottest44684/providers/microsoft.keyvault/vaults/turbottest44684/keys/turbottest44684/versions/fe906fb885f34d8789f94973bd915080"
    ],
    "name": "fe906fb885f34d8789f94973bd915080",
    "tags": {
      "name": "turbottest44684"
    },
    "title": "fe906fb885f34d8789f94973bd915080"
  }
]
✔ PASSED

POSTTEST: tests/azure_key_vault_key_version

TEARDOWN: tests/azure_key_vault_key_version

SUMMARY:

1/1 passed.

Example query results

Results



> select
  name,
  vault_name,
  enabled,
  created_at,
  updated_at,
  key_type,
  location
from
  azure_key_vault_key_version;
+----------------------------------+------------+---------+---------------------------+---------------------------+----------+----------+
| name                             | vault_name | enabled | created_at                | updated_at                | key_type | location |
+----------------------------------+------------+---------+---------------------------+---------------------------+----------+----------+
| c197b0f6301c4befa2b056544bfc98a6 | ks-vault   | true    | 2022-11-04T17:17:32+05:30 | 2022-11-04T17:17:32+05:30 | RSA      | eastus   |
| f896984958394cf4baae9ab785f8e584 | ks-vault   | true    | 2022-11-22T16:22:17+05:30 | 2022-11-22T16:22:17+05:30 | RSA      | eastus   |
+----------------------------------+------------+---------+---------------------------+---------------------------+----------+----------+

> select
  name,
  key_name,
  vault_name,
  enabled
from
  azure_key_vault_key_version
where
  enabled;
+----------------------------------+----------+------------+---------+
| name                             | key_name | vault_name | enabled |
+----------------------------------+----------+------------+---------+
| c197b0f6301c4befa2b056544bfc98a6 | tets56   | ks-vault   | true    |
| f896984958394cf4baae9ab785f8e584 | tets56   | ks-vault   | true    |
+----------------------------------+----------+------------+---------+


@ParthaI ParthaI self-assigned this Nov 23, 2022
@ParthaI ParthaI linked an issue Nov 23, 2022 that may be closed by this pull request
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at the review comments. Thanks!!

azure/table_azure_key_vault_key_version.go Outdated Show resolved Hide resolved
docs/tables/azure_key_vault_key_version.md Outdated Show resolved Hide resolved
@misraved misraved merged commit 40abd39 into main Nov 25, 2022
@misraved misraved deleted the issue-548 branch November 25, 2022 12:30
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_key_vault_key_version
2 participants