Class: Bauble::Resources::S3Bucket

Inherits:
Resource
  • Object
show all
Defined in:
lib/bauble/resources/s3_bucket.rb

Overview

S3 bucket

Instance Attribute Summary collapse

Attributes inherited from Resource

#app

Instance Method Summary collapse

Methods inherited from Resource

#resource_name

Constructor Details

#initialize(app, name: 'bauble-bucket', force_destroy: false) ⇒ S3Bucket

Returns a new instance of S3Bucket.



12
13
14
15
16
# File 'lib/bauble/resources/s3_bucket.rb', line 12

def initialize(app, name: 'bauble-bucket', force_destroy: false)
  super(app)
  @name = name
  @force_destroy = force_destroy
end

Instance Attribute Details

#force_destroyObject

Returns the value of attribute force_destroy.



10
11
12
# File 'lib/bauble/resources/s3_bucket.rb', line 10

def force_destroy
  @force_destroy
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/bauble/resources/s3_bucket.rb', line 10

def name
  @name
end

Instance Method Details

#bundleObject



30
31
32
# File 'lib/bauble/resources/s3_bucket.rb', line 30

def bundle
  true
end

#synthesizeObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/bauble/resources/s3_bucket.rb', line 18

def synthesize
  {
    @name => {
      'type' => 'aws:s3:Bucket',
      'properties' => {
        'bucket' => resource_name(@name),
        'forceDestroy' => @force_destroy
      }
    }
  }
end