Class: Jets::Cfn::Base
Direct Known Subclasses
Resource, Resource::ApiGateway::Authorizer, Resource::ApiGateway::BasePath::Function, Resource::ApiGateway::BasePath::Mapping, Resource::ApiGateway::BasePath::Role, Resource::ApiGateway::Deployment, Resource::ApiGateway::DomainName, Resource::ApiGateway::Method, Resource::ApiGateway::Resource, Resource::ApiGateway::RestApi, Resource::ApiGateway::RestApi::Routes::Change::To, Resource::Config::ConfigRule, Resource::Events::Rule, Resource::Iam::ApplicationRole, Resource::Iam::ClassRole, Resource::Iam::FunctionRole, Resource::Iam::Policy, Resource::Iot::TopicRule, Resource::Lambda::EventSourceMapping, Resource::Lambda::Function, Resource::Lambda::LayerVersion, Resource::Lambda::Permission, Resource::Logs::SubscriptionFilter, Resource::Nested::Base, Resource::One::Permission, Resource::Route53::RecordSet, Resource::S3::Bucket, Resource::Sns::Subscription, Resource::Sns::Topic, Resource::Sns::TopicPolicy, Resource::Sqs::Queue
Class Method Summary
collapse
Instance Method Summary
collapse
#camelize
Class Method Details
.truncate_id(id, postfix = '') ⇒ Object
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/jets/cfn/base.rb', line 70
def truncate_id(id, postfix = '')
if id.size + postfix.size > 62
"#{id[0..(55 - postfix.size)]}#{Digest::MD5.hexdigest(id)[0..5]}#{postfix}"
else
"#{id}#{postfix}"
end
end
|
Instance Method Details
#attributes ⇒ Object
50
51
52
53
54
|
# File 'lib/jets/cfn/base.rb', line 50
def attributes
attributes = template.values.first
attributes = replacer.replace_placeholders(attributes)
camelize(attributes)
end
|
#logical_id ⇒ Object
36
37
38
39
40
|
# File 'lib/jets/cfn/base.rb', line 36
def logical_id
id = template.keys.first
id = replacer.replace_value(id) Jets::Camelizer.camelize(id) end
|
#outputs ⇒ Object
60
61
62
|
# File 'lib/jets/cfn/base.rb', line 60
def outputs
{}
end
|
#parameters ⇒ Object
56
57
58
|
# File 'lib/jets/cfn/base.rb', line 56
def parameters
{}
end
|
#properties ⇒ Object
46
47
48
|
# File 'lib/jets/cfn/base.rb', line 46
def properties
attributes[:Properties]
end
|
#replacements ⇒ Object
17
18
19
|
# File 'lib/jets/cfn/base.rb', line 17
def replacements
@replacements || {}
end
|
#replacer ⇒ Object
21
22
23
|
# File 'lib/jets/cfn/base.rb', line 21
def replacer
Resource::Replacer.new(replacements)
end
|
#standarize(*definition) ⇒ Object
#template ⇒ Object
26
27
28
|
# File 'lib/jets/cfn/base.rb', line 26
def template
standarize(definition)
end
|
#type ⇒ Object
42
43
44
|
# File 'lib/jets/cfn/base.rb', line 42
def type
attributes[:Type]
end
|