Skip to content

Updated so the watching CloudWatch alert could handle the SNS topic being in another region.#239

Merged
kcantrel merged 6 commits intomainfrom
handle_different_sns_region
May 22, 2025
Merged

Updated so the watching CloudWatch alert could handle the SNS topic being in another region.#239
kcantrel merged 6 commits intomainfrom
handle_different_sns_region

Conversation

@kcantrel
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 20, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@kcantrel kcantrel requested a review from Copilot May 20, 2025 02:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds cross-region SNS support via a watchdog Lambda, enhances API call resilience, and updates docs

  • Append return_timeout to ONTAP API endpoints and streamline volumeRecords handling
  • Introduce CloudFormation watchdog Lambda with IAM role and permissions to publish to SNS in another region
  • Update README for the new watchdog feature and correct the Lambda layer link

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
monitor_ontap_services.py Added return_timeout query parameter to all API endpoints and refactored storage utilization to use volumeRecords
cloudformation.yaml Defined watchdog IAM role, Lambda, permission, and new watchdogRoleArn parameter; wired alarm to invoke it
README.md Fixed download URL path, added watchdog feature description, and refined parameter table
Files not reviewed (1)
  • Monitoring/monitor-ontap-services/updateMonOntapServiceCFTemplate: Language not supported
Comments suppressed due to low confidence (3)

Monitoring/monitor-ontap-services/cloudformation.yaml:27

  • [nitpick] Parameter names use PascalCase, so watchdogRoleArn should be renamed to WatchdogRoleArn for consistency with other parameters.
-          - watchdogRoleArn

Monitoring/monitor-ontap-services/README.md:77

  • Typo: 'aother' should be 'another'.
-    - Create a Lambda function to send the CloudWatch alarm alert to an SNS topic. This is done so the SNS topic can be in aother region since CloudWatch doesn't support doing that natively.

Monitoring/monitor-ontap-services/cloudformation.yaml:354

  • CreateWatchdogAlarm condition is not defined in the Conditions section; this will cause deployment errors. Define it or use the appropriate existing condition.
    Condition: CreateWatchdogAlarm

Comment on lines +888 to 890
for record in volumeRecords:
if rule[key] and record["state"].lower() == "offline":
uniqueIdentifier = f'{record["uuid"]}_{key}_{rule[key]}'
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

This loop does not guard against volumeRecords being None if the initial API call failed. Consider checking if volumeRecords: before iterating to avoid a runtime error.

Suggested change
for record in volumeRecords:
if rule[key] and record["state"].lower() == "offline":
uniqueIdentifier = f'{record["uuid"]}_{key}_{rule[key]}'
if volumeRecords:
for record in volumeRecords:
if rule[key] and record["state"].lower() == "offline":
uniqueIdentifier = f'{record["uuid"]}_{key}_{rule[key]}'

Copilot uses AI. Check for mistakes.
@kcantrel kcantrel merged commit 6ba4c39 into main May 22, 2025
15 checks passed
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