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

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

Direct Known Subclasses

JetsBucket

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, #config, #logical_id, #normalize_tags, #parameters, #properties, #replacements, #replacer, #standarize, #template, truncate_id, #type

Methods included from Util::Camelize

#camelize

Methods included from Util::Logging

#log

Constructor Details

#initialize(props = {}) ⇒ Bucket

Returns a new instance of Bucket.



4
5
6
7
# File 'lib/jets/cfn/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/cfn/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/cfn/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/cfn/resource/s3/bucket.rb', line 18

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