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 aws_sns_subscription Closes #1488 #2046

Merged
merged 8 commits into from
Jan 15, 2024

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jan 10, 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_sns_subscription []

PRETEST: tests/aws_sns_subscription

TEST: tests/aws_sns_subscription
Running terraform
data.aws_caller_identity.current: Reading...
data.aws_partition.current: 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: Reading...
data.aws_region.alternate: Read complete after 0s [id=us-east-2]
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_sns_topic.aws_sns_subscription will be created
  + resource "aws_sns_topic" "aws_sns_subscription" {
      + arn                         = (known after apply)
      + beginning_archive_time      = (known after apply)
      + content_based_deduplication = false
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = "turbottest69455"
      + name_prefix                 = (known after apply)
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + signature_version           = (known after apply)
      + tags_all                    = (known after apply)
      + tracing_config              = (known after apply)
    }

  # aws_sns_topic_subscription.named_test_resource will be created
  + resource "aws_sns_topic_subscription" "named_test_resource" {
      + arn                             = (known after apply)
      + confirmation_timeout_in_minutes = 1
      + confirmation_was_authenticated  = (known after apply)
      + endpoint                        = (known after apply)
      + endpoint_auto_confirms          = false
      + filter_policy_scope             = (known after apply)
      + id                              = (known after apply)
      + owner_id                        = (known after apply)
      + pending_confirmation            = (known after apply)
      + protocol                        = "sqs"
      + raw_message_delivery            = false
      + topic_arn                       = (known after apply)
    }

  # aws_sqs_queue.aws_sns_subscription will be created
  + resource "aws_sqs_queue" "aws_sns_subscription" {
      + arn                               = (known after apply)
      + content_based_deduplication       = false
      + deduplication_scope               = (known after apply)
      + delay_seconds                     = 0
      + fifo_queue                        = false
      + fifo_throughput_limit             = (known after apply)
      + id                                = (known after apply)
      + kms_data_key_reuse_period_seconds = (known after apply)
      + max_message_size                  = 262144
      + message_retention_seconds         = 345600
      + name                              = "turbottest69455"
      + name_prefix                       = (known after apply)
      + policy                            = (known after apply)
      + receive_wait_time_seconds         = 0
      + redrive_allow_policy              = (known after apply)
      + redrive_policy                    = (known after apply)
      + sqs_managed_sse_enabled           = (known after apply)
      + tags_all                          = (known after apply)
      + url                               = (known after apply)
      + visibility_timeout_seconds        = 30
    }

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

Changes to Outputs:
  + account_id    = "333333333333"
  + aws_partition = "aws"
  + aws_region    = "us-east-1"
  + endpoint      = (known after apply)
  + resource_aka  = (known after apply)
  + resource_name = "turbottest69455"
  + topic_arn     = (known after apply)
aws_sqs_queue.aws_sns_subscription: Creating...
aws_sns_topic.aws_sns_subscription: Creating...
aws_sns_topic.aws_sns_subscription: Creation complete after 4s [id=arn:aws:sns:us-east-1:333333333333:turbottest69455]
aws_sqs_queue.aws_sns_subscription: Still creating... [10s elapsed]
aws_sqs_queue.aws_sns_subscription: Still creating... [20s elapsed]
aws_sqs_queue.aws_sns_subscription: Creation complete after 30s [id=https://sqs.us-east-1.amazonaws.com/333333333333/turbottest69455]
aws_sns_topic_subscription.named_test_resource: Creating...
aws_sns_topic_subscription.named_test_resource: Creation complete after 3s [id=arn:aws:sns:us-east-1:333333333333:turbottest69455:71a817e4-ac24-4149-a2a7-3ceb84a060cb]

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

Outputs:

account_id = "333333333333"
aws_partition = "aws"
aws_region = "us-east-1"
endpoint = "arn:aws:sqs:us-east-1:333333333333:turbottest69455"
resource_aka = "arn:aws:sns:us-east-1:333333333333:turbottest69455:71a817e4-ac24-4149-a2a7-3ceb84a060cb"
resource_name = "turbottest69455"
topic_arn = "arn:aws:sns:us-east-1:333333333333:turbottest69455"

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)
[
  {
    "endpoint": "arn:aws:sqs:us-east-1:333333333333:turbottest69455",
    "protocol": "sqs",
    "topic_arn": "arn:aws:sns:us-east-1:333333333333:turbottest69455"
  }
]
✔ PASSED

Running SQL query: test-get-subscription-attributes-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)
[
  {
    "confirmation_was_authenticated": true,
    "delivery_policy": null,
    "effective_delivery_policy": null,
    "filter_policy": null,
    "pending_confirmation": false,
    "raw_message_delivery": false,
    "redrive_policy": null
  }
]
✔ 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)
[
  {
    "endpoint": "arn:aws:sqs:us-east-1:333333333333:turbottest69455",
    "owner": "333333333333",
    "protocol": "sqs",
    "subscription_arn": "arn:aws:sns:us-east-1:333333333333:turbottest69455:71a817e4-ac24-4149-a2a7-3ceb84a060cb",
    "topic_arn": "arn:aws:sns:us-east-1:333333333333:turbottest69455"
  }
]
✔ PASSED

Running SQL query: test-notfound-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)
[
  {
    "account_id": "333333333333",
    "akas": [
      "arn:aws:sns:us-east-1:333333333333:turbottest69455:71a817e4-ac24-4149-a2a7-3ceb84a060cb"
    ],
    "partition": "aws",
    "region": "us-east-1",
    "title": "71a817e4-ac24-4149-a2a7-3ceb84a060cb"
  }
]
✔ PASSED

POSTTEST: tests/aws_sns_subscription

TEARDOWN: tests/aws_sns_subscription

SUMMARY:

1/1 passed.

Example query results

Results
> select * from aws_sns_subscription
+----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------+--------------+----------+----------------------------------------------------------------->
| subscription_arn                                                                                         | topic_arn                                                           | owner        | protocol | endpoint                                                        >
+----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------+--------------+----------+----------------------------------------------------------------->
| arn:aws:sns:ap-south-1:333333333333:tutbot_aws_api_handler:4570c7b9-350b-4faa-9be9-36e3d974f026          | arn:aws:sns:ap-south-1:333333333333:tutbot_aws_api_handler          | 333333333333 | https    | https://nagraj-tutbot.cloud.tutbot-dev.com/api/v5/events/raw?tok>
| arn:aws:sns:ap-south-1:333333333333:tutbot_aws_api_handler:2f736c85-e866-41ce-8058-617071e70834          | arn:aws:sns:ap-south-1:333333333333:tutbot_aws_api_handler          | 333333333333 | https    | https://nagraj-tutbot.cloud.tutbot-dev.com/api/v5/events/raw?tok>
| arn:aws:sns:ap-south-1:333333333333:topic-public:0add4eaa-880f-47ca-ba1d-1105e0019320                    | arn:aws:sns:ap-south-1:333333333333:topic-public                    | 333333333333 | email    | [email protected]                                             >
| arn:aws:sns:ap-south-1:333333333333:Default_CloudWatch_Alarms_Topic:a5f6943c-ef6d-4632-baae-04270fd50506 | arn:aws:sns:ap-south-1:333333333333:Default_CloudWatch_Alarms_Topic | 333333333333 | email    | [email protected]                                             >
| arn:aws:sns:ap-south-1:333333333333:tutbot_aws_api_handler:96e469e3-87fa-4b9e-b2e3-149ab424b952          | arn:aws:sns:ap-south-1:333333333333:tutbot_aws_api_handler          | 333333333333 | https    | https://nagraj-tutbot.cloud.tutbot-dev.com/api/v5/events/raw?tok>
| arn:aws:sns:ap-southeast-1:333333333333:tutbot_aws_api_handler:0cceddf0-312d-4b9d-b59c-e67cf16f697b      | arn:aws:sns:ap-southeast-1:333333333333:tutbot_aws_api_handler      | 333333333333 | https    | https://nagraj-tutbot.cloud.tutbot-dev.com/api/v5/events/raw?tok


@bigdatasourav bigdatasourav merged commit 9f0daff into main Jan 15, 2024
1 check passed
@bigdatasourav bigdatasourav deleted the add-table-sns-subscription branch January 15, 2024 08:29
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 SNS subscriptions not listed when the owner is another account
2 participants