Class: CfnModel::Transforms::Serverless
- Inherits:
-
Object
- Object
- CfnModel::Transforms::Serverless
- Defined in:
- lib/cfn-model/transforms/serverless.rb
Overview
Handle transformation of model elements performed by the Serverless trasnform, see docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.instance ⇒ Object
15 16 17 18 |
# File 'lib/cfn-model/transforms/serverless.rb', line 15 def self.instance @instance ||= Serverless.new @instance end |
Instance Method Details
#perform_transform(cfn_hash) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/cfn-model/transforms/serverless.rb', line 7 def perform_transform(cfn_hash) resources = cfn_hash['Resources'].clone resources.each do |resource_name, resource| next unless resource['Type'].eql? 'AWS::Serverless::Function' replace_serverless_function cfn_hash, resource_name end end |