This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from rapid7/support-s3-bucket-configuration-t…
…ypes Support s3 bucket configuration types
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
lib/convection/model/template/resource_property/aws_s3_cors_configuration.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require_relative '../resource_property' | ||
|
||
module Convection | ||
module Model | ||
class Template | ||
class ResourceProperty | ||
# Represents an {http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html | ||
# Amazon S3 Cors Configuration} | ||
class S3CorsConfiguration < ResourceProperty | ||
property :cors_rules, 'CorsRules', :type => :list | ||
|
||
def cors_rule(&block) | ||
cors_rule = ResourceProperty::S3CorsConfigurationRule.new(self) | ||
cors_rule.instance_exec(&block) if block | ||
cors_rules << cors_rule | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
20 changes: 20 additions & 0 deletions
20
lib/convection/model/template/resource_property/aws_s3_cors_configuration_rule.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require_relative '../resource_property' | ||
|
||
module Convection | ||
module Model | ||
class Template | ||
class ResourceProperty | ||
# Represents an {http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html | ||
# Amazon S3 Cors Configuration Rule} | ||
class S3CorsConfigurationRule < ResourceProperty | ||
property :allowed_headers, 'AllowedHeaders', :type => :list | ||
property :allowed_methods, 'AllowedMethods', :type => :list | ||
property :allowed_origins, 'AllowedOrigins', :type => :list | ||
property :exposed_headers, 'ExposedHeaders', :type => :list | ||
property :id, 'Id' | ||
property :max_age, 'MaxAge' | ||
end | ||
end | ||
end | ||
end | ||
end |