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_monitor_log_profile Closes #712 #717

Merged
merged 2 commits into from
Feb 2, 2024
Merged

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jan 15, 2024

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

PRETEST: tests/azure_monitor_log_profile

TEST: tests/azure_monitor_log_profile
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_eventhub_namespace.named_test_resource will be created
  + resource "azurerm_eventhub_namespace" "named_test_resource" {
      + auto_inflate_enabled                      = false
      + capacity                                  = 2
      + default_primary_connection_string         = (sensitive value)
      + default_primary_connection_string_alias   = (sensitive value)
      + default_primary_key                       = (sensitive value)
      + default_secondary_connection_string       = (sensitive value)
      + default_secondary_connection_string_alias = (sensitive value)
      + default_secondary_key                     = (sensitive value)
      + id                                        = (known after apply)
      + local_authentication_enabled              = true
      + location                                  = "eastus"
      + maximum_throughput_units                  = (known after apply)
      + minimum_tls_version                       = (known after apply)
      + name                                      = "turbottest758"
      + network_rulesets                          = (known after apply)
      + public_network_access_enabled             = true
      + resource_group_name                       = "turbottest758"
      + sku                                       = "Standard"
      + zone_redundant                            = false
    }

  # azurerm_monitor_log_profile.named_test_resource will be created
  + resource "azurerm_monitor_log_profile" "named_test_resource" {
      + categories         = [
          + "Action",
          + "Delete",
          + "Write",
        ]
      + id                 = (known after apply)
      + locations          = [
          + "eastus",
          + "global",
        ]
      + name               = "turbottest758"
      + servicebus_rule_id = (known after apply)
      + storage_account_id = (known after apply)

      + retention_policy {
          + days    = 7
          + enabled = true
        }
    }

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

  # azurerm_storage_account.named_test_resource will be created
  + resource "azurerm_storage_account" "named_test_resource" {
      + access_tier                        = (known after apply)
      + account_kind                       = "StorageV2"
      + account_replication_type           = "GRS"
      + account_tier                       = "Standard"
      + allow_nested_items_to_be_public    = true
      + cross_tenant_replication_enabled   = true
      + default_to_oauth_authentication    = false
      + enable_https_traffic_only          = true
      + id                                 = (known after apply)
      + infrastructure_encryption_enabled  = false
      + is_hns_enabled                     = false
      + large_file_share_enabled           = (known after apply)
      + location                           = "eastus"
      + min_tls_version                    = "TLS1_2"
      + name                               = "turbottest758"
      + nfsv3_enabled                      = false
      + primary_access_key                 = (sensitive value)
      + primary_blob_connection_string     = (sensitive value)
      + primary_blob_endpoint              = (known after apply)
      + primary_blob_host                  = (known after apply)
      + primary_blob_internet_endpoint     = (known after apply)
      + primary_blob_internet_host         = (known after apply)
      + primary_blob_microsoft_endpoint    = (known after apply)
      + primary_blob_microsoft_host        = (known after apply)
      + primary_connection_string          = (sensitive value)
      + primary_dfs_endpoint               = (known after apply)
      + primary_dfs_host                   = (known after apply)
      + primary_dfs_internet_endpoint      = (known after apply)
      + primary_dfs_internet_host          = (known after apply)
      + primary_dfs_microsoft_endpoint     = (known after apply)
      + primary_dfs_microsoft_host         = (known after apply)
      + primary_file_endpoint              = (known after apply)
      + primary_file_host                  = (known after apply)
      + primary_file_internet_endpoint     = (known after apply)
      + primary_file_internet_host         = (known after apply)
      + primary_file_microsoft_endpoint    = (known after apply)
      + primary_file_microsoft_host        = (known after apply)
      + primary_location                   = (known after apply)
      + primary_queue_endpoint             = (known after apply)
      + primary_queue_host                 = (known after apply)
      + primary_queue_microsoft_endpoint   = (known after apply)
      + primary_queue_microsoft_host       = (known after apply)
      + primary_table_endpoint             = (known after apply)
      + primary_table_host                 = (known after apply)
      + primary_table_microsoft_endpoint   = (known after apply)
      + primary_table_microsoft_host       = (known after apply)
      + primary_web_endpoint               = (known after apply)
      + primary_web_host                   = (known after apply)
      + primary_web_internet_endpoint      = (known after apply)
      + primary_web_internet_host          = (known after apply)
      + primary_web_microsoft_endpoint     = (known after apply)
      + primary_web_microsoft_host         = (known after apply)
      + public_network_access_enabled      = true
      + queue_encryption_key_type          = "Service"
      + resource_group_name                = "turbottest758"
      + secondary_access_key               = (sensitive value)
      + secondary_blob_connection_string   = (sensitive value)
      + secondary_blob_endpoint            = (known after apply)
      + secondary_blob_host                = (known after apply)
      + secondary_blob_internet_endpoint   = (known after apply)
      + secondary_blob_internet_host       = (known after apply)
      + secondary_blob_microsoft_endpoint  = (known after apply)
      + secondary_blob_microsoft_host      = (known after apply)
      + secondary_connection_string        = (sensitive value)
      + secondary_dfs_endpoint             = (known after apply)
      + secondary_dfs_host                 = (known after apply)
      + secondary_dfs_internet_endpoint    = (known after apply)
      + secondary_dfs_internet_host        = (known after apply)
      + secondary_dfs_microsoft_endpoint   = (known after apply)
      + secondary_dfs_microsoft_host       = (known after apply)
      + secondary_file_endpoint            = (known after apply)
      + secondary_file_host                = (known after apply)
      + secondary_file_internet_endpoint   = (known after apply)
      + secondary_file_internet_host       = (known after apply)
      + secondary_file_microsoft_endpoint  = (known after apply)
      + secondary_file_microsoft_host      = (known after apply)
      + secondary_location                 = (known after apply)
      + secondary_queue_endpoint           = (known after apply)
      + secondary_queue_host               = (known after apply)
      + secondary_queue_microsoft_endpoint = (known after apply)
      + secondary_queue_microsoft_host     = (known after apply)
      + secondary_table_endpoint           = (known after apply)
      + secondary_table_host               = (known after apply)
      + secondary_table_microsoft_endpoint = (known after apply)
      + secondary_table_microsoft_host     = (known after apply)
      + secondary_web_endpoint             = (known after apply)
      + secondary_web_host                 = (known after apply)
      + secondary_web_internet_endpoint    = (known after apply)
      + secondary_web_internet_host        = (known after apply)
      + secondary_web_microsoft_endpoint   = (known after apply)
      + secondary_web_microsoft_host       = (known after apply)
      + sftp_enabled                       = false
      + shared_access_key_enabled          = true
      + table_encryption_key_type          = "Service"
    }

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

Changes to Outputs:
  + location           = "eastus"
  + resource_aka       = (known after apply)
  + resource_aka_lower = (known after apply)
  + resource_id_lower  = (known after apply)
  + resource_name      = "turbottest758"
  + storage_account_id = (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 3s [id=/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest758]
azurerm_eventhub_namespace.named_test_resource: Creating...
azurerm_storage_account.named_test_resource: Creating...
azurerm_eventhub_namespace.named_test_resource: Still creating... [10s elapsed]
azurerm_storage_account.named_test_resource: Still creating... [10s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [20s elapsed]
azurerm_storage_account.named_test_resource: Still creating... [20s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [30s elapsed]
azurerm_storage_account.named_test_resource: Still creating... [30s elapsed]
azurerm_storage_account.named_test_resource: Creation complete after 33s [id=/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest758/providers/Microsoft.Storage/storageAccounts/turbottest758]
azurerm_eventhub_namespace.named_test_resource: Still creating... [40s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [50s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [1m0s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [1m10s elapsed]
azurerm_eventhub_namespace.named_test_resource: Still creating... [1m20s elapsed]
azurerm_eventhub_namespace.named_test_resource: Creation complete after 1m20s [id=/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest758/providers/Microsoft.EventHub/namespaces/turbottest758]
azurerm_monitor_log_profile.named_test_resource: Creating...
azurerm_monitor_log_profile.named_test_resource: Still creating... [10s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [20s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [30s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [40s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [50s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [1m0s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [1m10s elapsed]
azurerm_monitor_log_profile.named_test_resource: Still creating... [1m20s elapsed]
azurerm_monitor_log_profile.named_test_resource: Creation complete after 1m23s [id=/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Insights/logProfiles/turbottest758]

Warning: Deprecated

  with data.null_data_source.resource,
  on vatiables.tf line 29, in data "null_data_source" "resource":
  29: 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 or the terraform_data resource type in Terraform 1.4 and later.

(and one more similar warning elsewhere)

Warning: Deprecated Resource

  with azurerm_monitor_log_profile.named_test_resource,
  on vatiables.tf line 56, in resource "azurerm_monitor_log_profile" "named_test_resource":
  56: resource "azurerm_monitor_log_profile" "named_test_resource" {

Azure Log Profiles will be retired on 30th September 2026 and will be removed
in v4.0 of the AzureRM Provider. More information on the deprecation can be
found at
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods

(and 2 more similar warnings elsewhere)

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

Outputs:

location = "eastus"
resource_aka = "azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/Microsoft.Insights/logProfiles/turbottest758"
resource_aka_lower = "azure:///subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.insights/logprofiles/turbottest758"
resource_id_lower = "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.insights/logprofiles/turbottest758"
resource_name = "turbottest758"
storage_account_id = "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest758/providers/Microsoft.Storage/storageAccounts/turbottest758"
subscription_id = "3510ae4d-530b-497d-8f30-53b9616fc6c1"

Running SQL query: test-get-query.sql
Warning: terminal options has been deprecated and will be removed in a future version of Steampipe.
These can now be set in a steampipe workspace.
(/Users/parthas/.steampipe/config/default.spc:34,20-42,2)
[
  {
    "id": "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.insights/logprofiles/turbottest758",
    "name": "turbottest758",
    "storage_account_id": "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest758/providers/Microsoft.Storage/storageAccounts/turbottest758"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
Warning: terminal options has been deprecated and will be removed in a future version of Steampipe.
These can now be set in a steampipe workspace.
(/Users/parthas/.steampipe/config/default.spc:34,20-42,2)
[
  {
    "id": "/subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.insights/logprofiles/turbottest758",
    "name": "turbottest758"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
Warning: terminal options has been deprecated and will be removed in a future version of Steampipe.
These can now be set in a steampipe workspace.
(/Users/parthas/.steampipe/config/default.spc:34,20-42,2)
[]
✔ PASSED

Running SQL query: test-turbot-query.sql
Warning: terminal options has been deprecated and will be removed in a future version of Steampipe.
These can now be set in a steampipe workspace.
(/Users/parthas/.steampipe/config/default.spc:34,20-42,2)
[
  {
    "name": "turbottest758",
    "subscription_id": "3510ae4d-530b-497d-8f30-53b9616fc6c1",
    "title": "turbottest758"
  }
]
✔ PASSED

POSTTEST: tests/azure_monitor_log_profile

TEARDOWN: tests/azure_monitor_log_profile

SUMMARY:

1/1 passed.

Example query results

Results
> select * from azure_monitor_log_profile
+------------------------------------------------------------------------------------------------------+---------+--------+----------+--------------------------------------------------------------------------------------------------------------------------------------->
| id                                                                                                   | name    | type   | location | storage_account_id                                                                                                                    >
+------------------------------------------------------------------------------------------------------+---------+--------+----------+--------------------------------------------------------------------------------------------------------------------------------------->
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.insights/logprofiles/default | default | <null> | <null>   | /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest72977/providers/Microsoft.Storage/storageAccounts/turbott>
+------------------------------------------------------------------------------------------------------+---------+--------+----------+--------------------------------------------------------------------------------------------------------------------------------------->

Time: 3.1s. Rows fetched: 1. Hydrate calls: 2.


> select * from azure_monitor_log_profile where name = 'default'
+------------------------------------------------------------------------------------------------------+---------+--------+----------+--------------------------------------------------------------------------------------------------------------------------------------->
| id                                                                                                   | name    | type   | location | storage_account_id                                                                                                                    >
+------------------------------------------------------------------------------------------------------+---------+--------+----------+--------------------------------------------------------------------------------------------------------------------------------------->
| /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/providers/microsoft.insights/logprofiles/default | default | <null> | <null>   | /subscriptions/3510ae4d-530b-497d-8f30-53b9616fc6c1/resourceGroups/turbottest72977/providers/Microsoft.Storage/storageAccounts/turbott>
+------------------------------------------------------------------------------------------------------+---------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------



@ParthaI ParthaI self-assigned this Jan 15, 2024
@ParthaI ParthaI linked an issue Jan 15, 2024 that may be closed by this pull request
@bigdatasourav bigdatasourav merged commit c99c125 into main Feb 2, 2024
2 checks passed
@bigdatasourav bigdatasourav deleted the issue-712 branch February 2, 2024 06:08
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_monitor_log_profile
3 participants