Puppet Class: psick::aws::cli::vpc

Defined in:
manifests/aws/cli/vpc.pp

Overview

Setup a VPC via aws cli

Parameters:

  • region (String) (defaults to: $psick::aws::region)
  • ensure (String) (defaults to: 'present')
  • default_cidr_block_prefix (String) (defaults to: $psick::aws::default_cidr_block_prefix)
  • default_vpc_name (String) (defaults to: $psick::aws::default_vpc_name)
  • create_defaults (Boolean) (defaults to: $psick::aws::create_defaults)
  • autorun (Boolean) (defaults to: true)
  • aws_scripts (Hash) (defaults to: {})
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'manifests/aws/cli/vpc.pp', line 2

class psick::aws::cli::vpc (
  String  $region                    = $psick::aws::region,
  String  $ensure                    = 'present',
  String  $default_cidr_block_prefix = $psick::aws::default_cidr_block_prefix,
  String  $default_vpc_name          = $psick::aws::default_vpc_name,
  Boolean $create_defaults           = $psick::aws::create_defaults,
  Boolean $autorun                   = true,
  Hash    $aws_scripts               = {},

  Boolean      $manage               = $psick::manage,
  Boolean      $noop_manage          = $psick::noop_manage,
  Boolean      $noop_value           = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    if $create_defaults {
      $default_aws_scripts = {
        "vpc_${default_vpc_name}" => {
          template    => 'psick/aws/cli/vpc.erb',
        },
      }
    } else {
      $default_aws_scripts = {}
    }
    $all_aws_scripts = $aws_scripts+$default_aws_scripts

    $aws_scripts_defaults = {
      ensure                  => $ensure,
      region                  => $region,
      autorun                 => $autorun,
    }
    if $all_aws_scripts != {} {
      $all_aws_scripts.each | $k,$v | {
        psick::aws::cli::script { $k:
          * => $aws_scripts_defaults + $v,
        }
      }
    }
  }
}