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

Updated aws_ebs_snapshot should not set maxlimit by default Closes #2081 #2088

Merged
merged 5 commits into from Mar 29, 2024

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Feb 26, 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/aws_ebs_snapshot []

PRETEST: tests/aws_ebs_snapshot

TEST: tests/aws_ebs_snapshot
Running terraform
data.aws_caller_identity.current: Reading...
data.aws_region.primary: Reading...
data.aws_partition.current: Reading...
data.aws_region.alternate: Reading...
data.aws_region.alternate: Read complete after 0s [id=us-east-2]
data.aws_region.primary: Read complete after 0s [id=us-east-1]
data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_caller_identity.current: Read complete after 0s [id=333333333333]
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_ebs_snapshot.named_test_resource will be created
  + resource "aws_ebs_snapshot" "named_test_resource" {
      + arn                    = (known after apply)
      + data_encryption_key_id = (known after apply)
      + description            = "Test snapshot"
      + encrypted              = (known after apply)
      + id                     = (known after apply)
      + kms_key_id             = (known after apply)
      + owner_alias            = (known after apply)
      + owner_id               = (known after apply)
      + storage_tier           = (known after apply)
      + tags                   = {
          + "Name" = "turbottest43535"
        }
      + tags_all               = {
          + "Name" = "turbottest43535"
        }
      + volume_id              = (known after apply)
      + volume_size            = (known after apply)
    }

  # aws_ebs_volume.test_volume will be created
  + resource "aws_ebs_volume" "test_volume" {
      + arn               = (known after apply)
      + availability_zone = "us-east-1a"
      + encrypted         = (known after apply)
      + final_snapshot    = false
      + id                = (known after apply)
      + iops              = (known after apply)
      + kms_key_id        = (known after apply)
      + size              = 1
      + snapshot_id       = (known after apply)
      + tags_all          = (known after apply)
      + throughput        = (known after apply)
      + type              = (known after apply)
    }

  # aws_snapshot_create_volume_permission.example_perm will be created
  + resource "aws_snapshot_create_volume_permission" "example_perm" {
      + account_id  = "388460667113"
      + id          = (known after apply)
      + snapshot_id = (known after apply)
    }

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

Changes to Outputs:
  + account_id    = "333333333333"
  + aws_partition = "aws"
  + aws_region    = "us-east-1"
  + resource_aka  = (known after apply)
  + resource_name = "turbottest43535"
  + snapshot_id   = (known after apply)
  + volume_id     = (known after apply)
aws_ebs_volume.test_volume: Creating...
aws_ebs_volume.test_volume: Still creating... [10s elapsed]
aws_ebs_volume.test_volume: Creation complete after 14s [id=vol-0f102d289d9dbe7aa]
aws_ebs_snapshot.named_test_resource: Creating...
aws_ebs_snapshot.named_test_resource: Still creating... [10s elapsed]
aws_ebs_snapshot.named_test_resource: Creation complete after 18s [id=snap-016bcbd67da0306f9]
aws_snapshot_create_volume_permission.example_perm: Creating...
aws_snapshot_create_volume_permission.example_perm: Creation complete after 1s [id=snap-016bcbd67da0306f9-388460667113]

Warning: Deprecated

  with data.null_data_source.resource,
  on variables.tf line 43, in data "null_data_source" "resource":
  43: 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: 3 added, 0 changed, 0 destroyed.

Outputs:

account_id = "333333333333"
aws_partition = "aws"
aws_region = "us-east-1"
resource_aka = "arn:aws:ec2:us-east-1::snapshot/snap-016bcbd67da0306f9"
resource_name = "turbottest43535"
snapshot_id = "snap-016bcbd67da0306f9"
volume_id = "vol-0f102d289d9dbe7aa"

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)
[
  {
    "description": "Test snapshot",
    "encrypted": false,
    "owner_id": "333333333333",
    "snapshot_id": "snap-016bcbd67da0306f9",
    "tags_src": [
      {
        "Key": "Name",
        "Value": "turbottest43535"
      }
    ],
    "volume_id": "vol-0f102d289d9dbe7aa",
    "volume_size": 1
  }
]
✔ PASSED

Running SQL query: test-hydrate-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)
[
  {
    "akas": [
      "arn:aws:ec2:us-east-1:333333333333:snapshot/snap-016bcbd67da0306f9"
    ],
    "create_volume_permissions": [
      {
        "Group": "",
        "UserId": "388460667113"
      }
    ],
    "snapshot_id": "snap-016bcbd67da0306f9",
    "tags": {
      "Name": "turbottest43535"
    },
    "title": "snap-016bcbd67da0306f9"
  }
]
✔ 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)
[
  {
    "snapshot_id": "snap-016bcbd67da0306f9",
    "volume_id": "vol-0f102d289d9dbe7aa"
  }
]
✔ PASSED

POSTTEST: tests/aws_ebs_snapshot

TEARDOWN: tests/aws_ebs_snapshot

SUMMARY:

1/1 passed.

Example query results

Results
> select * from aws_ebs_snapshot limit 1001
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>
| snapshot_id            | arn                                                                | state     | volume_size | volume_id             | encrypted | start_time                | description      >
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>
| snap-0e4020f22ea51ce02 | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-0e4020f22ea51ce02 | completed | 8           | vol-0b74a7c71a8d290b5 | false     | 2024-02-16T12:37:01+05:30 | Created by Create>
| snap-0aa97f0d110df2170 | arn:aws:ec2:us-west-2:333333333333:snapshot/snap-0aa97f0d110df2170 | completed | 8           | vol-ffffffff          | true      | 2022-08-10T19:16:59+05:30 | Copied for Destin>
| snap-0347b5f7028f17c4d | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-0347b5f7028f17c4d | completed | 65          | vol-03dfbff108e201832 | true      | 2024-02-16T13:36:32+05:30 | Created by Create>
| snap-0218dafac05aa26df | arn:aws:ec2:us-west-2:333333333333:snapshot/snap-0218dafac05aa26df | completed | 8           | vol-0154f6cab9c391b5c | true      | 2022-08-05T16:34:29+05:30 |                  >
| snap-06ff60334c460fcd7 | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-06ff60334c460fcd7 | completed | 8           | vol-0510d750c3666945f | false     | 2023-07-12T18:06:34+05:30 | This snapshot is >
| snap-097deed7e68c51be7 | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-097deed7e68c51be7 | completed | 65          | vol-03dfbff108e201832 | true      | 2024-02-16T13:54:36+05:30 | Created by Create>
| snap-0cf8bb375c199cba6 | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-0cf8bb375c199cba6 | completed | 65          | vol-0d6296e7e555d1f08 | false     | 2024-02-16T12:53:52+05:30 | Created by Create>
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>

Time: 2.0s. Rows fetched: 7. Hydrate calls: 21.

> select * from aws_ebs_snapshot where snapshot_id = 'snap-0e4020f22ea51ce02' limit 1001
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>
| snapshot_id            | arn                                                                | state     | volume_size | volume_id             | encrypted | start_time                | description      >
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>
| snap-0e4020f22ea51ce02 | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-0e4020f22ea51ce02 | completed | 8           | vol-0b74a7c71a8d290b5 | false     | 2024-02-16T12:37:01+05:30 | Created by Create>
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>

Time: 0.9s. Rows fetched: 1. Hydrate calls: 3.

> select * from aws_ebs_snapshot where snapshot_id = 'snap-0e4020f22ea51ce02' limit 6
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>
| snapshot_id            | arn                                                                | state     | volume_size | volume_id             | encrypted | start_time                | description      >
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>
| snap-0e4020f22ea51ce02 | arn:aws:ec2:us-east-1:333333333333:snapshot/snap-0e4020f22ea51ce02 | completed | 8           | vol-0b74a7c71a8d290b5 | false     | 2024-02-16T12:37:01+05:30 | Created by Create>
+------------------------+--------------------------------------------------------------------+-----------+-------------+-----------------------+-----------+---------------------------+------------------>

Time: 5.2s. Rows fetched: 1. Hydrate calls: 3.

@ParthaI ParthaI self-assigned this Feb 26, 2024
@ParthaI ParthaI linked an issue Feb 26, 2024 that may be closed by this pull request
@bigdatasourav bigdatasourav merged commit c9eb7c1 into main Mar 29, 2024
1 check passed
@bigdatasourav bigdatasourav deleted the issue-2081 branch March 29, 2024 08:14
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.

aws_ebs_snapshot should not set maxlimit by default
2 participants