Class: Jets::Resource::S3::Bucket

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/resource/s3/bucket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#replacements, #resource

Constructor Details

#initialize(props = {}) ⇒ Bucket

Returns a new instance of Bucket.



4
5
6
7
# File 'lib/jets/resource/s3/bucket.rb', line 4

def initialize(props={})
  @props = props # associated_properties from dsl.rb
  @bucket_logical_id = props.delete(:logical_id) || "{namespace}_s3_bucket"
end

Instance Attribute Details

#bucket_logical_idObject (readonly)

Returns the value of attribute bucket_logical_id.



3
4
5
# File 'lib/jets/resource/s3/bucket.rb', line 3

def bucket_logical_id
  @bucket_logical_id
end

Instance Method Details

#definitionObject



9
10
11
12
13
14
15
16
# File 'lib/jets/resource/s3/bucket.rb', line 9

def definition
  {
    bucket_logical_id => {
      type: "AWS::S3::Bucket",
      properties: @props,
    }
  }
end

#outputsObject



18
19
20
21
22
# File 'lib/jets/resource/s3/bucket.rb', line 18

def outputs
  {
    bucket_logical_id => "!Ref #{bucket_logical_id.to_s.camelize}",
  }
end