Module: Convection::DSL::Template

Includes:
Helpers, Resource
Included in:
Model::Template
Defined in:
lib/convection/model/template.rb,
lib/convection/model/template/resource/aws_ec2_vpc.rb,
lib/convection/model/template/resource/aws_kms_key.rb,
lib/convection/model/template/resource/aws_iam_role.rb,
lib/convection/model/template/resource/aws_iam_user.rb,
lib/convection/model/template/resource/aws_ec2_subnet.rb,
lib/convection/model/template/resource/aws_logs_loggroup.rb,
lib/convection/model/template/resource/aws_ec2_network_acl.rb,
lib/convection/model/template/resource/aws_ec2_route_table.rb,
lib/convection/model/template/resource/aws_ec2_security_group.rb,
lib/convection/model/template/resource/aws_ec2_internet_gateway.rb

Overview

Add DSL method to template namespace

Defined Under Namespace

Modules: Resource

Constant Summary

CF_MAX_BYTESIZE =
51_200
CF_MAX_DESCRIPTION_BYTESIZE =
1_024
CF_MAX_MAPPING_ATTRIBUTE_NAME =
255
CF_MAX_MAPPING_ATTRIBUTES =
30
CF_MAX_MAPPING_NAME =
25
CF_MAX_MAPPINGS =
100
CF_MAX_OUTPUT_NAME_CHARACTERS =
255
CF_MAX_OUTPUTS =
60
CF_MAX_PARAMETER_NAME_CHARACTERS =
255
CF_MAX_PARAMETERS =
60
CF_MAX_PARAMETER_VALUE_BYTESIZE =
4_086
CF_MAX_RESOURCE_NAME =
255
CF_MAX_RESOURCES =
200

Instance Method Summary collapse

Methods included from Resource

attach_resource

Methods included from Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_not, #fn_or, #fn_ref, #get_att, #get_azs, #join, #select

Instance Method Details

#condition(name, &block) ⇒ Object



65
66
67
68
69
70
# File 'lib/convection/model/template.rb', line 65

def condition(name, &block)
  c = Model::Template::Condition.new(name, self)

  c.instance_exec(&block) if block
  conditions[name] = c
end

#logs_log_group(name, &block) ⇒ Object



25
26
27
28
29
30
# File 'lib/convection/model/template/resource/aws_logs_loggroup.rb', line 25

def logs_log_group(name, &block)
  r = Model::Template::Resource::LogGroup.new(name, self)

  r.instance_exec(&block) if block
  resources[name] = r
end

#mapping(name, &block) ⇒ Object



58
59
60
61
62
63
# File 'lib/convection/model/template.rb', line 58

def mapping(name, &block)
  m = Model::Template::Mapping.new(name, self)

  m.instance_exec(&block) if block
  mappings[name] = m
end

#metadata(name = nil, value = nil) ⇒ Object

Parameters:

  • name (String) (defaults to: nil)

    the name of the new metadata configuration to set

  • value (Hash) (defaults to: nil)

    an arbritrary JSON object to set as the value of the new metadata configuration



89
90
91
92
93
# File 'lib/convection/model/template.rb', line 89

def (name = nil, value = nil)
  return @metadata unless name

  @metadata[name] = Model::Template::Metadata.new(name, value)
end

#output(name, &block) ⇒ Object



79
80
81
82
83
84
# File 'lib/convection/model/template.rb', line 79

def output(name, &block)
  o = Model::Template::Output.new(name, self)

  o.instance_exec(&block) if block
  outputs[name] = o
end

#parameter(name, &block) ⇒ Object



51
52
53
54
55
56
# File 'lib/convection/model/template.rb', line 51

def parameter(name, &block)
  pa = Model::Template::Parameter.new(name, self)

  pa.instance_exec(&block) if block
  parameters[name] = pa
end

#resource(name, &block) ⇒ Object



72
73
74
75
76
77
# File 'lib/convection/model/template.rb', line 72

def resource(name, &block)
  r = Model::Template::Resource.new(name, self)

  r.instance_exec(&block) if block
  resources[name] = r
end