Sha256: f982279363f41ab8afe97ebf331fe95b477f98c7444cddafda2d145244ca5d2f

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        ##
        # AWS::S3::Bucket
        ##
        class S3Bucket < Resource
          include Model::Mixin::Taggable

          def initialize(*args)
            super
            type 'AWS::S3::Bucket'
          end

          def access_control(value)
            property('AccessControl', value)
          end

          def bucket_name(value)
            property('BucketName', value)
          end

          def cors_configuration(value)
            property('CorsConfiguration', value)
          end

          def lifecycle_configuration(value)
            property('LifecycleConfiguration', value)
          end

          def logging_configuration(value)
            property('LoggingConfiguration', value) 
          end

          def notification_configuration(value)
            property('NotificationConfiguration', value)
          end

          def version_configuration(value)
            property('VersionConfiguration', value)
          end

          def render(*args)
            super.tap do |resource|
              render_tags(resource)
            end
          end
        end
      end
    end
  end

  module DSL
    ## Add DSL method to template namespace
    module Template
      def s3_bucket(name, &block)
        r = Model::Template::Resource::S3Bucket.new(name, self)

        r.instance_exec(&block) if block
        resources[name] = r
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
convection-0.0.1 lib/convection/model/template/resource/aws_s3_bucket.rb