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
17 18 19 20 |
# File 'lib/cfn-model/transforms/serverless.rb', line 17 def self.instance @instance ||= Serverless.new @instance end |
Instance Method Details
#perform_transform(cfn_hash) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/cfn-model/transforms/serverless.rb', line 9 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 |