Sha256: 8f5cd74e910aa269f76a2b01bbae743ecfda2d709f09b25449ad547d6634ea6e

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

module Jets::Cfn::Resource::Codebuild
  class Fleet < Jets::Cfn::Base
    def definition
      {
        CodebuildFleet: {
          Type: "AWS::CodeBuild::Fleet",
          Properties: props
        }
      }
    end

    def props
      {
        BaseCapacity: base_capacity,        # Integer
        ComputeType: compute_type,          # String
        EnvironmentType: environment_type   # String
        # Name: "",                         # String
        # Tags: "",                         # [ Tag, ... ]
      }
    end

    def base_capacity
      Jets.bootstrap.config.codebuild.fleet.base_capacity
    end

    def compute_type
      codebuild_properties[:Environment][:ComputeType]
    end

    def environment_type
      codebuild_properties[:Environment][:Type]
    end

    def outputs
      {
        "CodebuildFleet" => "!Ref CodebuildFleet"
      }
    end

    private

    def codebuild_properties
      project = Jets::Cfn::Resource::Codebuild::Project::Ec2.new
      project.properties
    end
    memoize :codebuild_properties
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jets-6.0.5 lib/jets/cfn/resource/codebuild/fleet.rb
jets-6.0.4 lib/jets/cfn/resource/codebuild/fleet.rb
jets-6.0.3 lib/jets/cfn/resource/codebuild/fleet.rb
jets-6.0.2 lib/jets/cfn/resource/codebuild/fleet.rb