Sha256: b62de612013a1e7f680cafa77ebf6a587b569c6a0ae17f35fbb50ce2e295741f

Contents?: true

Size: 1.63 KB

Versions: 8

Compression:

Stored size: 1.63 KB

Contents

require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        # @example
        #   s3_bucket 'BucketWithSNSNotification' do
        #     bucket_name "my-bucket.blah.com"
        #     notification_configuration(
        #       'TopicConfigurations' => [
        #          {'Event' => 's3:ObjectCreated:*', 'Topic' => "arn:aws:sns:sns-topic-arn...."}
        #       ])
        #     with_output
        #   end
        class S3Bucket < Resource
          include Model::Mixin::Taggable

          type 'AWS::S3::Bucket'
          property :bucket_name, 'BucketName'
          property :access_control, 'AccessControl'
          property :cors_configuration, 'CorsConfiguration'
          property :lifecycle_configuration, 'LifecycleConfiguration'
          property :logging_configuration, 'LoggingConfiguration'
          property :notification_configuration, 'NotificationConfiguration'
          property :versioning_configuration, 'VersioningConfiguration'

          def cors_configuration(&block)
            config = ResourceProperty::S3CorsConfiguration.new(self)
            config.instance_exec(&block) if block
            properties['CorsConfiguration'].set(config)
          end

          def cors_configurationm(*args)
            warn 'DEPRECATED: "cors_configurationm" is deprecated. Please use "cors_configuration" instead. https://github.com/rapid7/convection/pull/135'
            cors_configuration(*args)
          end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
convection-0.4.2 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.4.1 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.4.0 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.3.3.pre.beta.1 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.3.2 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.3.1 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.3.0 lib/convection/model/template/resource/aws_s3_bucket.rb
convection-0.2.34.pre.beta.1 lib/convection/model/template/resource/aws_s3_bucket.rb