Sha256: 854951f8c7aafb114772f6a0678ba9eacc05766aa7977e2207ab247d6d9b9647

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

module Terraforming
  class CLI < Thor
    desc "dbpg", "Database Parameter Group"
    option :tfstate, type: :boolean
    def dbpg
      execute(Terraforming::Resource::DBParameterGroup, options)
    end

    desc "dbsg", "Database Security Group"
    option :tfstate, type: :boolean
    def dbsg
      execute(Terraforming::Resource::DBSecurityGroup, options)
    end

    desc "dbsn", "Database Subnet Group"
    option :tfstate, type: :boolean
    def dbsn
      execute(Terraforming::Resource::DBSubnetGroup, options)
    end

    desc "ec2", "EC2"
    option :tfstate, type: :boolean
    def ec2
      execute(Terraforming::Resource::EC2, options)
    end

    desc "elb", "ELB"
    option :tfstate, type: :boolean
    def elb
      execute(Terraforming::Resource::ELB, options)
    end

    desc "nacl", "Network ACL"
    option :tfstate, type: :boolean
    def nacl
      execute(Terraforming::Resource::NetworkACL, options)
    end

    desc "rds", "RDS"
    option :tfstate, type: :boolean
    def rds
      execute(Terraforming::Resource::RDS, options)
    end

    desc "s3", "S3"
    option :tfstate, type: :boolean
    def s3
      execute(Terraforming::Resource::S3, options)
    end

    desc "sg", "SecurityGroup"
    option :tfstate, type: :boolean
    def sg
      execute(Terraforming::Resource::SecurityGroup, options)
    end

    desc "sn", "Subnet"
    option :tfstate, type: :boolean
    def sn
      execute(Terraforming::Resource::Subnet, options)
    end

    desc "vpc", "VPC"
    option :tfstate, type: :boolean
    def vpc
      execute(Terraforming::Resource::VPC, options)
    end

    private

    def execute(klass, options)
      puts options[:tfstate] ? klass.tfstate : klass.tf
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
terraforming-0.0.2 lib/terraforming/cli.rb