Class: AwsXRegionSync::Configure
- Inherits:
-
Object
- Object
- AwsXRegionSync::Configure
- Defined in:
- lib/aws_xregion_sync/configure.rb
Class Method Summary collapse
Class Method Details
.configure_from_file(file_path) ⇒ Object
6 7 8 9 |
# File 'lib/aws_xregion_sync/configure.rb', line 6 def self.configure_from_file file_path # For now, just assume a yaml config file..we can certainly support json/xml or something more complicated here internally later. generate_sync_jobs load_yaml_config_file file_path end |
.generate_sync_jobs(config) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/aws_xregion_sync/configure.rb', line 11 def self.generate_sync_jobs config # We need at least one sync key, each sync must have a type indicator, each sync must have a source and destination region sync_keys = config.keys global_aws_config = config['aws_client_config'] sync_jobs = [] configuration_errors = {} sync_keys.each do |job_key| if job_key.upcase.to_s.start_with? "SYNC_" sync_config = config[job_key] begin sync_jobs << create_sync_job(global_aws_config, job_key, sync_config) rescue => e configuration_errors[job_key] = [e] end end end {jobs: sync_jobs, errors: configuration_errors} end |