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

fix(infra): fix the remaining terraform constant changes #331

Merged
merged 15 commits into from
Mar 22, 2024

Conversation

bassrock
Copy link
Member

@bassrock bassrock commented Mar 22, 2024

Goal

Cleanup some remaining infrastructure things.

@bassrock
Copy link
Member Author

bassrock commented Mar 22, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bassrock and the rest of your teammates on Graphite Graphite

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (account-delete-monitor-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (sendgrid-data-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@bassrock bassrock changed the title fix(shared-lists): making shared lists not recreate alarms fix(infra): fix the remaining terraform constant changes Mar 22, 2024
@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (account-data-deleter-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (transactional-emails-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (pocket-event-bridge-cdk)

CI link

⚠️ Resource Deletion will happen ⚠️

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 1 to add, 1 to change, 1 to destroy.
  • Create
    • aws_cloudwatch_metric_alarm.shareable-list-item-events_shareablelistitemevents-rule-dlq-alarm_0C71CDFB
  • Update
    • aws_cloudwatch_metric_alarm.shareable-list-events_shareablelistevents-rule-dlq-alarm_FBCFA70C
  • Delete
    • aws_cloudwatch_metric_alarm.shareable-list-item-events_shareablelistevents-rule-dlq-alarm_2CE4E6A3
Change Result (Click me)
  # aws_cloudwatch_metric_alarm.shareable-list-events_shareablelistevents-rule-dlq-alarm_FBCFA70C will be updated in-place
  ~ resource "aws_cloudwatch_metric_alarm" "shareable-list-events_shareablelistevents-rule-dlq-alarm_FBCFA70C" {
      ~ dimensions                = {
          ~ "QueueName" = "PocketEventBridge-Prod-SNS-ShareableListItemEvents-Topic-DLQ" -> "PocketEventBridge-Prod-SNS-ShareableListEvents-Topic-DLQ"
        }
        id                        = "PocketEventBridge-Prod-ShareableListEvents-Rule-dlq-alarm"
        tags                      = {}
        # (17 unchanged attributes hidden)
    }

  # aws_cloudwatch_metric_alarm.shareable-list-item-events_shareablelistevents-rule-dlq-alarm_2CE4E6A3 will be destroyed
  # (because aws_cloudwatch_metric_alarm.shareable-list-item-events_shareablelistevents-rule-dlq-alarm_2CE4E6A3 is not in configuration)
  - resource "aws_cloudwatch_metric_alarm" "shareable-list-item-events_shareablelistevents-rule-dlq-alarm_2CE4E6A3" {
      - actions_enabled           = true -> null
      - alarm_actions             = [
          - "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-Infrastructure-Alarm-Non-Critical",
        ] -> null
      - alarm_description         = "Number of messages >= 10" -> null
      - alarm_name                = "PocketEventBridge-Prod-ShareableListEvents-Rule-dlq-alarm" -> null
      - arn                       = "arn:aws:cloudwatch:us-east-1:996905175585:alarm:PocketEventBridge-Prod-ShareableListEvents-Rule-dlq-alarm" -> null
      - comparison_operator       = "GreaterThanOrEqualToThreshold" -> null
      - datapoints_to_alarm       = 0 -> null
      - dimensions                = {
          - "QueueName" = "PocketEventBridge-Prod-SNS-ShareableListItemEvents-Topic-DLQ"
        } -> null
      - evaluation_periods        = 4 -> null
      - id                        = "PocketEventBridge-Prod-ShareableListEvents-Rule-dlq-alarm" -> null
      - insufficient_data_actions = [] -> null
      - metric_name               = "ApproximateNumberOfMessagesVisible" -> null
      - namespace                 = "AWS/SQS" -> null
      - ok_actions                = [
          - "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-Infrastructure-Alarm-Non-Critical",
        ] -> null
      - period                    = 300 -> null
      - statistic                 = "Sum" -> null
      - tags                      = {} -> null
      - tags_all                  = {
          - "environment" = "Prod"
          - "service"     = "PocketEventBridge"
        } -> null
      - threshold                 = 10 -> null
      - treat_missing_data        = "missing" -> null
    }

  # aws_cloudwatch_metric_alarm.shareable-list-item-events_shareablelistitemevents-rule-dlq-alarm_0C71CDFB will be created
  + resource "aws_cloudwatch_metric_alarm" "shareable-list-item-events_shareablelistitemevents-rule-dlq-alarm_0C71CDFB" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-Infrastructure-Alarm-Non-Critical",
        ]
      + alarm_description                     = "Number of messages >= 10"
      + alarm_name                            = "PocketEventBridge-Prod-ShareableListItemEvents-Rule-dlq-alarm"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + dimensions                            = {
          + "QueueName" = "PocketEventBridge-Prod-SNS-ShareableListItemEvents-Topic-DLQ"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 4
      + id                                    = (known after apply)
      + metric_name                           = "ApproximateNumberOfMessagesVisible"
      + namespace                             = "AWS/SQS"
      + ok_actions                            = [
          + "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-Infrastructure-Alarm-Non-Critical",
        ]
      + period                                = 300
      + statistic                             = "Sum"
      + tags_all                              = {
          + "environment" = "Prod"
          + "service"     = "PocketEventBridge"
        }
      + threshold                             = 10
      + treat_missing_data                    = "missing"
    }

Plan: 1 to add, 1 to change, 1 to destroy.

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (shareable-lists-api-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (fxa-webhook-proxy-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@pocket-ci
Copy link

pocket-ci commented Mar 22, 2024

Plan Result (annotations-api-cdk)

CI link

No changes. Your infrastructure matches the configuration.

@bassrock bassrock force-pushed the 03-22-remaining_infra_changes branch from 5629b20 to 8e4612c Compare March 22, 2024 15:17
@bassrock bassrock force-pushed the 03-22-remaining_infra_changes branch from 8e4612c to c403588 Compare March 22, 2024 15:37
@bassrock bassrock force-pushed the 03-22-remaining_infra_changes branch from c403588 to f8b5a75 Compare March 22, 2024 15:49
@bassrock bassrock marked this pull request as ready for review March 22, 2024 16:27
@bassrock bassrock requested a review from a team as a code owner March 22, 2024 16:27
@bassrock bassrock requested review from marcin-kozinski and removed request for a team March 22, 2024 16:27
- run:
name: Get Github Bot Token
command: |
app_id=$GITHUB_APP_ID
Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly I couldn't find an orb to do this for us. But this script will take the Github Bot secrets and convert it to a regular access token like we already use, valid for 10 min.

i wish CircleCI let us ask for a github access token like Github Actions do, then this wouldnt be necessary 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, we can make this an orb of our own later?

@@ -52,7 +52,7 @@ export class ShareableListItemEvents extends Construct {
this,
pagerDuty,
this.snsTopicDlq.name,
`${eventConfig.shareableList.name}-Rule-dlq-alarm`,
`${eventConfig.shareableListItem.name}-Rule-dlq-alarm`,
Copy link
Member Author

Choose a reason for hiding this comment

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

type was causing the rule to keep changing nams cause one already existed with that name

@@ -49,6 +49,16 @@ export class DynamoDB extends Construct {
},
],
},
lifecycle: {
ignoreChanges: [
// Bug in terraform with DynamoDB and global secondary indexes
Copy link
Member Author

Choose a reason for hiding this comment

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

😮‍💨

Copy link
Contributor

Choose a reason for hiding this comment

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

from 2017? yikes

Copy link
Contributor

Choose a reason for hiding this comment

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

I linked it in the PR description so that it gets cross-referenced by gh

Base automatically changed from fixup/lambda-deploys to main March 22, 2024 17:27
Copy link

🎉 This PR is included in version @pocket-tools/terraform-modules-v5.9.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants