Defined Type: simianarmy::chaos_properties::asg

Defined in:
manifests/chaos_properties/asg.pp

Summary

Write properties for a specific Autoscaling group (ASG) to the `chaos.properties` file.

Overview

Copyright © 2017-2019 Shine Solutions Group, unless otherwise noted.

Examples:

simianarmy::chaos_properties::asg { <asg_name>:
  enabled                  => true,
  probability              => 0.5,
  max_terminations_per_day => 1.0,
  owner_email              => 'owner@domain.com',
}

Parameters:

  • path (String) (defaults to: $::simianarmy::chaos_properties::path)

    The path to the application.properties file on disk. Defaults to the chaos.properties managed by the simianarmy::chaos_properties class.

  • enabled (Boolean) (defaults to: false)

    Boolean to control whether this ASG is enabled.

  • probability (String) (defaults to: '1.0')

    This is the probability of termination per day. See the following link for more details: github.com/Netflix/SimianArmy/wiki/Chaos-Settings#simianarmychaosasgprobability

  • max_terminations_per_day (String) (defaults to: '1.0')

    This setting allows you to set a value of maximum terminations per calendar day (24 hours) for a specific ASG.

  • owner_email (Variant[String, Undef]) (defaults to: undef)

    Set the destination email that the termination notifications will be sent to for a specific ASG's instances. Also sets simianarmy.chaos.ASG.${title}.notification.enabled to true.

Author:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'manifests/chaos_properties/asg.pp', line 38

define simianarmy::chaos_properties::asg (
  String $path = $::simianarmy::chaos_properties::path,

  Boolean $enabled                  = false,
  String  $probability              = '1.0',
  String  $max_terminations_per_day = '1.0',

  Variant[String, Undef] $owner_email = undef,
) {
  File_line {
    path => $path,
  }

  $line_prefix = "simianarmy.chaos.ASG.${title}"

  file_line { "${title}.enabled":
    line  => "${line_prefix}.enabled = ${enabled}",
    match => "${line_prefix}.enabled",
  }

  if $enabled {
    file_line {
      "${title}.probability":
        line  => "${line_prefix}.probability = ${probability}",
        match => "${line_prefix}.probability";
      "${title}.maxTerminationsPerDay":
        line  => "${line_prefix}.maxTerminationsPerDay = ${max_terminations_per_day}",
        match => "${line_prefix}.maxTerminationsPerDay";
    }

    if $owner_email != undef {
      file_line {
        "${title}.notification.enabled":
          line  => "${line_prefix}.notification.enabled = true",
          match => "${line_prefix}.notification.enabled";
        "${title}.ownerEmail":
          line  => "${line_prefix}.ownerEmail = ${owner_email}",
          match => "${line_prefix}.ownerEmail";
      }
    }
  }
}