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_eventgrid_domain closes #293 #314

Merged
merged 6 commits into from
Sep 23, 2021
Merged

Add table azure_eventgrid_domain closes #293 #314

merged 6 commits into from
Sep 23, 2021

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Sep 9, 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_eventgrid_domain []

PRETEST: tests/azure_eventgrid_domain

TEST: tests/azure_eventgrid_domain
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/turbottest52980]
azurerm_eventgrid_domain.named_test_resource: Creating...
azurerm_eventgrid_domain.named_test_resource: Still creating... [10s elapsed]
azurerm_eventgrid_domain.named_test_resource: Still creating... [20s elapsed]
azurerm_eventgrid_domain.named_test_resource: Creation complete after 27s [id=/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest52980/providers/Microsoft.EventGrid/domains/turbottest52980]

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: 2 added, 0 changed, 0 destroyed.

Outputs:

resource_aka = azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest52980/providers/Microsoft.EventGrid/domains/turbottest52980
resource_aka_lower = azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest52980/providers/microsoft.eventgrid/domains/turbottest52980
resource_id = /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest52980/providers/Microsoft.EventGrid/domains/turbottest52980
resource_name = turbottest52980
subscription_id = d46d7416-f95f-4771-bbb5-529d4c76659c

Running SQL query: test-get-query.sql
[
  {
    "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest52980/providers/Microsoft.EventGrid/domains/turbottest52980",
    "name": "turbottest52980",
    "type": "Microsoft.EventGrid/domains"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest52980/providers/Microsoft.EventGrid/domains/turbottest52980",
      "azure:///subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest52980/providers/microsoft.eventgrid/domains/turbottest52980"
    ],
    "name": "turbottest52980",
    "title": "turbottest52980"
  }
]
✔ PASSED

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

POSTTEST: tests/azure_eventgrid_domain

TEARDOWN: tests/azure_eventgrid_domain

SUMMARY:

1/1 passed.

Example query results

Results

Basic info

select
  name,
  id,
  type,
  provisioning_state
from
  azure_eventgrid_domain;
+-------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------+--------------------+
| name        | id                                                                                                                             | type                        | provisioning_state |
+-------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------+--------------------+
| test-domain | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbot_rg/providers/Microsoft.EventGrid/domains/test-domain | Microsoft.EventGrid/domains | Succeeded          |
+-------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------+--------------------+

List domains configured with private endpoint connections

select
  name,
  id,
  type,
  private_endpoint_connections
from
  azure_eventgrid_domain
where
  private_endpoint_connections is not null;
+-------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------------
| name        | id                                                                                                                             | type                        | private_endpoint_connections 
+-------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------+------------------------------
| test-domain | /subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbot_rg/providers/Microsoft.EventGrid/domains/test-domain | Microsoft.EventGrid/domains | [{"properties":{"groupIds":["
+-------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------+-----------------------------

@ParthaI ParthaI self-assigned this Sep 9, 2021
@ParthaI ParthaI linked an issue Sep 9, 2021 that may be closed by this pull request
},
{
Name: "provisioning_state",
Description: "Provisioning state of the Event Grid Domain Resource, Possible values include: 'DomainProvisioningStateCreating', 'DomainProvisioningStateUpdating', 'DomainProvisioningStateDeleting', 'DomainProvisioningStateSucceeded', 'DomainProvisioningStateCanceled', 'DomainProvisioningStateFailed'.",
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
Description: "Provisioning state of the Event Grid Domain Resource, Possible values include: 'DomainProvisioningStateCreating', 'DomainProvisioningStateUpdating', 'DomainProvisioningStateDeleting', 'DomainProvisioningStateSucceeded', 'DomainProvisioningStateCanceled', 'DomainProvisioningStateFailed'.",
Description: "Provisioning state of the event grid domain resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'.",

},
{
Name: "auto_create_topic_with_first_subscription",
Description: "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.",
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
Description: "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.",
Description: "This Boolean is used to specify the creation mechanism for 'all' the event grid domain topics associated with this event grid domain resource.",

Name: "created_by_type",
Description: "The type of identity that created the resource.",
Type: proto.ColumnType_STRING,
Transform: transform.FromField("SystemData.CreatedByType").Transform(convertDateToTime),
Copy link
Contributor

@bigdatasourav bigdatasourav Sep 15, 2021

Choose a reason for hiding this comment

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

is CreatedByType a dateTime field?

},
{
Name: "diagnostic_settings",
Description: "A list of active diagnostic settings for the eventhub namespace.",
Copy link
Contributor

Choose a reason for hiding this comment

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

description is not correct

Name: "input_schema_mapping",
Description: "Information about the InputSchemaMapping which specified the info about mapping event payload.",
Type: proto.ColumnType_JSON,
Transform: transform.FromField("InputSchemaMapping"),
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need transform function here?

Transform: transform.FromField("ID").Transform(idToAkas),
},

// Azure standard column
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
// Azure standard column
// Azure standard columns

client.Authorizer = session.Authorizer
top := int32(100)

result, err := client.ListBySubscription(ctx, "", &top)
Copy link
Contributor

Choose a reason for hiding this comment

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

check with client.ListBySubscription(ctx, "", nil)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will work if we specify top param as nil, it will fallback to default value that is 20 per page

},
{
Name: "identity_type",
Description: "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned', 'IdentityTypeSystemAssignedUserAssigned'.",
Copy link
Contributor

Choose a reason for hiding this comment

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

update possible values.

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 0f65df1 into main Sep 23, 2021
@bigdatasourav bigdatasourav deleted the issue-293 branch September 23, 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_eventgrid_domain
2 participants