class GeoEngineer::Resources::AwsCloudwatchMetricAlarm

AwsCloudwatchMetricAlarm is the aws_cloudwatch_metric_alarm terrform resource,

{www.terraform.io/docs/providers/aws/r/aws_cloudwatch_metric_alarm.html Terraform Docs}

Public Class Methods

_fetch_remote_resources(provider) click to toggle source
# File lib/geoengineer/resources/aws_cloudwatch_metric_alarm.rb, line 26
def self._fetch_remote_resources(provider)
  _get_all_alarms(provider).map { |alarm|
    {
      _terraform_id: alarm[:alarm_name],
      _geo_id: alarm[:alarm_name],
      alarm_name: alarm[:alarm_name]
    }
  }
end
_get_all_alarms(provider) click to toggle source
# File lib/geoengineer/resources/aws_cloudwatch_metric_alarm.rb, line 36
def self._get_all_alarms(provider)
  alarm_page = AwsClients.cloudwatch(provider).describe_alarms({ max_records: 100 })
  alarms = alarm_page.metric_alarms.map(&:to_h)
  while alarm_page.next_token
    alarm_page = AwsClients
                 .cloudwatch(provider)
                 .describe_alarms({
                                    max_records: 100,
                                    next_token: alarm_page.next_token
                                  })
    alarms.concat alarm_page.metric_alarms.map(&:to_h)
  end
  alarms
end

Public Instance Methods

support_tags?() click to toggle source
# File lib/geoengineer/resources/aws_cloudwatch_metric_alarm.rb, line 22
def support_tags?
  false
end