turbot / steampipe-plugin-aws

Use SQL to instantly query AWS resources across regions and accounts. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/aws
Apache License 2.0
191 stars 103 forks source link

Add table aws_keyspaces_table Closes #2264 #2271

Open ParthaI opened 3 months ago

ParthaI commented 3 months ago

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/aws_keyspaces_table [] PRETEST: tests/aws_keyspaces_table TEST: tests/aws_keyspaces_table Running terraform data.aws_partition.current: Reading... data.aws_caller_identity.current: Reading... data.aws_region.alternate: Reading... data.aws_region.primary: Reading... data.aws_partition.current: Read complete after 0s [id=aws] data.aws_region.primary: Read complete after 0s [id=us-east-1] data.aws_region.alternate: Read complete after 0s [id=us-east-2] data.aws_caller_identity.current: Read complete after 0s [id=xxxxxxxxxxxx] 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: # aws_keyspaces_keyspace.named_test_resource will be created + resource "aws_keyspaces_keyspace" "named_test_resource" { + arn = (known after apply) + id = (known after apply) + name = "turbottest68990" + tags_all = (known after apply) } # aws_keyspaces_table.named_test_resource will be created + resource "aws_keyspaces_table" "named_test_resource" { + arn = (known after apply) + id = (known after apply) + keyspace_name = "turbottest68990" + table_name = "turbottest68990" + tags_all = (known after apply) + schema_definition { + column { + name = "test_id" + type = "ascii" } + partition_key { + name = "test_id" } } } Plan: 2 to add, 0 to change, 0 to destroy. Changes to Outputs: + resource_aka = (known after apply) + resource_name = "turbottest68990" aws_keyspaces_keyspace.named_test_resource: Creating... aws_keyspaces_keyspace.named_test_resource: Creation complete after 3s [id=turbottest68990] aws_keyspaces_table.named_test_resource: Creating... aws_keyspaces_table.named_test_resource: Still creating... [10s elapsed] aws_keyspaces_table.named_test_resource: Still creating... [20s elapsed] aws_keyspaces_table.named_test_resource: Creation complete after 28s [id=turbottest68990/turbottest68990] Warning: Deprecated with data.null_data_source.resource, on variables.tf line 44, in data "null_data_source" "resource": 44: 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) Apply complete! Resources: 2 added, 0 changed, 0 destroyed. Outputs: resource_aka = "arn:aws:cassandra:us-east-1:xxxxxxxxxxxx:/keyspace/turbottest68990/table/turbottest68990" resource_name = "turbottest68990" Running SQL query: test-get-call-query.sql Time: 10.9s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) aws_keyspaces_table.aws: Time: 10.1s. Fetched: 1. Hydrates: 0. Quals: table_name=turbottest68990, keyspace_name=turbottest68990. [ { "akas": [ "arn:aws:cassandra:us-east-1:xxxxxxxxxxxx:/keyspace/turbottest68990/table/turbottest68990" ], "table_name": "turbottest68990", "title": "turbottest68990" } ] βœ” PASSED Running SQL query: test-list-call-query.sql Time: 1.6s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) aws_keyspaces_table.aws: Time: 303ms. Fetched: 1. Hydrates: 0. Quals: keyspace_name=turbottest68990. [ { "akas": [ "arn:aws:cassandra:us-east-1:xxxxxxxxxxxx:/keyspace/turbottest68990/table/turbottest68990" ], "keyspace_name": "turbottest68990", "table_name": "turbottest68990", "title": "turbottest68990" } ] βœ” PASSED Running SQL query: test-turbot-query.sql Time: 0.7s. Rows returned: 1. Rows fetched: 1 (cached). Hydrate calls: 0. Scans: 1) aws_keyspaces_table.aws: Time: 203ms. Fetched: 1 (cached). Hydrates: 0. Quals: keyspace_name=turbottest68990. [ { "akas": [ "arn:aws:cassandra:us-east-1:xxxxxxxxxxxx:/keyspace/turbottest68990/table/turbottest68990" ], "title": "turbottest68990" } ] βœ” PASSED POSTTEST: tests/aws_keyspaces_table TEARDOWN: tests/aws_keyspaces_table SUMMARY: 1/1 passed. ```

Example query results

Results ``` > select * from aws_keyspaces_table where keyspace_name = 'turbottest53146' +-----------------+-----------------+------------------------------------------------------------------------------------------+--------+------------+-------------------------------+---------------------------+----------------------+--> | keyspace_name | table_name | arn | status | ttl_status | client_side_timestamps_status | creation_timestamp | default_time_to_live | c> +-----------------+-----------------+------------------------------------------------------------------------------------------+--------+------------+-------------------------------+---------------------------+----------------------+--> | turbottest53146 | turbottest53146 | arn:aws:cassandra:us-east-1:xxxxxxxxxxxx:/keyspace/turbottest53146/table/turbottest53146 | ACTIVE | | | 2024-08-19T09:45:25+05:30 | 0 | > +-----------------+-----------------+------------------------------------------------------------------------------------------+--------+------------+-------------------------------+---------------------------+----------------------+--> ```
misraved commented 3 months ago

@ParthaI I think @Priyanka-Chatterjee-2000 would need this table for the Compliance benchmark, wherein passing a keyspace_name might not be possible.

I would suggest adding the Parent table to eliminate the need of the required qual.

Thanks!!

ParthaI commented 3 months ago

I will add the parent table πŸ‘

github-actions[bot] commented 1 month ago

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.