Skip to content

Conversation

@akuzminsky
Copy link
Member

Wrap custom_metrics configuration in a conditional check for the
jumphost fact, matching the pattern used in cloudwatch_agent.pp.

This prevents Puppet failures when the jumphost fact is not provided
by older Terraform modules that haven't been updated yet.

Benefits:

  • Prevents "Operator '[]' is not applicable to an Undef Value" errors
  • Avoids configuring metrics on instances without proper IAM permissions
  • Eliminates unnecessary resource consumption from failed cron jobs
    running every minute without CloudWatch PutMetricData permissions
  • Metrics auto-enable once Terraform module provides the fact
  • Consistent defensive pattern across all jumphost CloudWatch classes

Files updated:

  • environments/sandbox/modules/profile/manifests/jumphost/custom_metrics.pp
  • environments/development/modules/profile/manifests/jumphost/custom_metrics.pp
  • modules/profile/manifests/jumphost/custom_metrics.pp

This follows the pattern of your recent commits with:

  • Imperative mood subject line
  • Detailed explanation of the problem and solution
  • Clear benefits
  • List of affected files

Wrap custom_metrics configuration in a conditional check for the
jumphost fact, matching the pattern used in cloudwatch_agent.pp.

This prevents Puppet failures when the jumphost fact is not provided
by older Terraform modules that haven't been updated yet.

Benefits:
- Prevents "Operator '[]' is not applicable to an Undef Value" errors
- Avoids configuring metrics on instances without proper IAM permissions
- Eliminates unnecessary resource consumption from failed cron jobs
  running every minute without CloudWatch PutMetricData permissions
- Metrics auto-enable once Terraform module provides the fact
- Consistent defensive pattern across all jumphost CloudWatch classes

Files updated:
- environments/sandbox/modules/profile/manifests/jumphost/custom_metrics.pp
- environments/development/modules/profile/manifests/jumphost/custom_metrics.pp
- modules/profile/manifests/jumphost/custom_metrics.pp

This follows the pattern of your recent commits with:
- Imperative mood subject line
- Detailed explanation of the problem and solution
- Clear benefits
- List of affected files
@akuzminsky akuzminsky merged commit 1f4d26c into main Jan 2, 2026
2 checks passed
@akuzminsky akuzminsky deleted the fix-jumphost-custom-metrics-conditional branch January 2, 2026 23:37
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