Skip to content

Conversation

juliareynolds-nava
Copy link
Contributor

@juliareynolds-nava juliareynolds-nava commented Sep 23, 2025

🎫 Ticket

https://jira.cms.gov/browse/PLT-1227

🛠 Changes

Added a cost anomaly cost monitor and sns topic subscription. This is the first part of required work for this feature. A lambda to push alerts to slack will be completed in PLT-1361

ℹ️ Context

Users want to be alerted in Slack about significant cost fluctuations, so that we can take actions on addressing potential cost anomalies.

🧪 Validation

@juliareynolds-nava juliareynolds-nava marked this pull request as ready for review September 24, 2025 20:40
@juliareynolds-nava juliareynolds-nava requested a review from a team as a code owner September 24, 2025 20:40
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
defaults:
run:
working-directory: ./terraform/services/cost-anomaly
Copy link
Member

Choose a reason for hiding this comment

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

The working-directory default can be dropped here now that it's specified at the top level.

}),
service = string,
is_ephemeral_env = string
})
Copy link
Member

Choose a reason for hiding this comment

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

I believe this change is being made in #316?

terraform = true
}
}
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

End file with newline

}
}


Copy link
Member

Choose a reason for hiding this comment

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

Drop blank lines

type = string
validation {
condition = contains(["dev", "test", "mgmt", "sandbox", "prod"], var.env)
error_message = "Valid value for env is dev, test, mgmt, sandbox, or prod."
Copy link
Member

Choose a reason for hiding this comment

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

Since this should only run in bcda test and prod the environments can be limited to test and prod.

Copy link
Member

Choose a reason for hiding this comment

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

Please update description and error_message as well.

code = "https://github.com/CMSgov/cdap/tree/main/terraform/services/cost-anomaly"
component = "cost-anomaly"
environment = var.env
terraform = true
Copy link
Member

Choose a reason for hiding this comment

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

Import the "standards" module and use it to set default tags.

@juliareynolds-nava juliareynolds-nava marked this pull request as draft September 29, 2025 19:11
@juliareynolds-nava juliareynolds-nava marked this pull request as ready for review September 30, 2025 16:50
@juliareynolds-nava juliareynolds-nava requested review from gsf and a team October 1, 2025 20:43
type = string
validation {
condition = contains(["dev", "test", "mgmt", "sandbox", "prod"], var.env)
error_message = "Valid value for env is dev, test, mgmt, sandbox, or prod."
Copy link
Member

Choose a reason for hiding this comment

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

Please update description and error_message as well.

@juliareynolds-nava juliareynolds-nava requested a review from gsf October 3, 2025 13:36
Comment on lines +56 to +57
- if: inputs.apply || (github.event_name == 'push' && github.ref == 'refs/heads/main')
run: tofu apply -exclude=module.sns_to_slack_queue.data.aws_iam_policy_document.sns_send_message -exclude=module.sns_to_slack_queue.aws_sns_topic_subscription.this -auto-approve tf.plan
Copy link
Member

Choose a reason for hiding this comment

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

This extra apply step appears to be left over from some kind of testing?

@@ -0,0 +1,59 @@
name: tf-cost-anomaly
run-name: tf-cost-anomaly ${{ (inputs.apply || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'apply' || 'plan' }}
Copy link
Member

Choose a reason for hiding this comment

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

Please add the cron trigger updates from #313

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.

2 participants