Class: Ufo::Cfn::Stack::Builder::Resources::IamRoles::Base
- Inherits:
-
Base
- Object
- Ufo::CLI::Base
- Base
- Base
- Ufo::Cfn::Stack::Builder::Resources::IamRoles::Base
- Defined in:
- lib/ufo/cfn/stack/builder/resources/iam_roles/base.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Ufo::CLI::Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
build, #initialize, #manage_ecs_security_group?, #managed_security_group, #security_groups
Methods included from Ufo::Concerns
Methods included from Ufo::Concerns::Names
Methods included from AwsServices
#acm, #applicationautoscaling, #aws_options, #cfn, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #s3, #ssm_client, #waf_client
Methods included from AwsServices::Concerns
#find_stack, #find_stack_resources, #stack_resources, #status, #task_definition_arns
Methods inherited from Ufo::CLI::Base
Methods included from Utils::Sure
Methods included from Utils::Pretty
#pretty_home, #pretty_path, #pretty_time
Methods included from Utils::Logging
Constructor Details
This class inherits a constructor from Ufo::Cfn::Stack::Builder::Base
Class Method Details
.build? ⇒ Boolean
13 14 15 16 17 18 |
# File 'lib/ufo/cfn/stack/builder/resources/iam_roles/base.rb', line 13 def build? path = lookup_path return unless path.nil? || File.exist?(path) Ufo::IamRole::Dsl.new(path).evaluate # runs the role.rb and registers items Ufo::IamRole::Builder.new(role_type).build? end |
.lookup_path ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ufo/cfn/stack/builder/resources/iam_roles/base.rb', line 20 def lookup_path iam_roles = "#{Ufo.root}/.ufo/resources/iam_roles" paths = ["#{Ufo.app}/#{role_type}", "#{role_type}"] paths.map! do |path| "#{iam_roles}/#{path}.rb" end paths.find do |path| File.exist?(path) end end |
.role_type ⇒ Object
9 10 11 |
# File 'lib/ufo/cfn/stack/builder/resources/iam_roles/base.rb', line 9 def role_type self.name.to_s.split("::").last.underscore end |