Class: Sessel::ConfigurationSetCreator
- Inherits:
-
Object
- Object
- Sessel::ConfigurationSetCreator
- Defined in:
- lib/sessel/configuration_set_creator.rb
Overview
Takes care of creating the configuration set and making sure all the prerequisites are in place
Instance Method Summary collapse
- #configuration_set ⇒ Object
-
#create ⇒ Object
Creates the configuration set in SES accoring to the paramteres passed when the object was initialised.
-
#initialize(configuration_set) ⇒ ConfigurationSetCreator
constructor
A new instance of ConfigurationSetCreator.
Constructor Details
#initialize(configuration_set) ⇒ ConfigurationSetCreator
Returns a new instance of ConfigurationSetCreator.
8 9 10 11 |
# File 'lib/sessel/configuration_set_creator.rb', line 8 def initialize(configuration_set) @configuration_set = configuration_set @ses = Aws::SES::Client.new(region: configuration_set.region) end |
Instance Method Details
#configuration_set ⇒ Object
13 14 15 |
# File 'lib/sessel/configuration_set_creator.rb', line 13 def configuration_set return @configuration_set end |
#create ⇒ Object
Creates the configuration set in SES accoring to the paramteres passed when the object was initialised
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/sessel/configuration_set_creator.rb', line 18 def create() rule = { configuration_set: { name: @configuration_set.configuration_set_name, } } begin @ses.create_configuration_set(rule) rescue Aws::SES::Errors::ConfigurationSetAlreadyExists puts "#{@configuration_set.configuration_set_name} already exists. Skipping." end end |