Sha256: afd48c8816594e24952d10e1bba6ecd199b55d90aaadb4fbc40b0933374a80e3

Contents?: true

Size: 846 Bytes

Versions: 5

Compression:

Stored size: 846 Bytes

Contents

require 'yaml'
require 'active_support/core_ext/hash'

module AwsRds
  class Create
    autoload :Params, "aws_rds/create/params"

    include AwsServices

    def initialize(options)
      @options = options
    end

    def run
      puts "Creating RDS database #{@options[:name]} with the following parameters:"
      pretty_display(params)
      if @options[:noop]
        puts "NOOP mode enabled. RDS instance not created."
        return
      end

      resp = rds.create_db_instance(params)
      puts "RDS database #{@options[:name]} created! 🎉"
      puts "Visit https://console.aws.amazon.com/rds/home?#dbinstances to check on the status"
    end

    def params
      @params ||= Params.new(@options).generate
    end

    def pretty_display(data)
      data = data.deep_stringify_keys
      puts YAML.dump(data)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aws-rds-0.6.0 lib/aws_rds/create.rb
aws-rds-0.5.0 lib/aws_rds/create.rb
aws-rds-0.4.0 lib/aws_rds/create.rb
aws-rds-0.3.0 lib/aws_rds/create.rb
aws-rds-0.2.0 lib/aws_rds/create.rb