Module: Genesis::Commands

Included in:
Cli
Defined in:
lib/genesis/commands.rb

Instance Method Summary collapse

Instance Method Details

#apply_commandObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/genesis/commands.rb', line 27

def apply_command
  %W[
    terraform apply
    -var "aws_access_key=#{@aws_access_key}"
    -var "aws_secret_key=#{@aws_secret_key}"
    -var "aws_key_pair=#{@aws_key_pair}"
    -refresh=true
    -state=#{state_file}
    #{terraform_dir}
  ].join(' ')
end

#apply_plan_commandObject



19
20
21
22
23
24
25
# File 'lib/genesis/commands.rb', line 19

def apply_plan_command
  %W[
    terraform apply
    -state=#{state_file}
    #{plan_file}
  ].join(' ')
end

#destroy_plan_commandObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/genesis/commands.rb', line 5

def destroy_plan_command
  %W[
    terraform plan
    -var "aws_access_key=#{@aws_access_key}"
    -var "aws_secret_key=#{@aws_secret_key}"
    -var "aws_key_pair=#{@aws_key_pair}"
    -refresh=true
    -destroy
    -state=#{state_file}
    -out=#{plan_file}
    #{terraform_dir}
  ].join(' ')
end

#plan_commandObject



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/genesis/commands.rb', line 50

def plan_command
  %W[
    terraform plan
    -var "aws_access_key=#{@aws_access_key}"
    -var "aws_secret_key=#{@aws_secret_key}"
    -var "aws_key_pair=#{@aws_key_pair}"
    -refresh=true
    -state=#{state_file}
    #{terraform_dir}
  ].join(' ')
end

#refresh_commandObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/genesis/commands.rb', line 39

def refresh_command
  %W[
    terraform refresh
    -var "aws_access_key=#{@aws_access_key}"
    -var "aws_secret_key=#{@aws_secret_key}"
    -var "aws_key_pair=#{@aws_key_pair}"
    -state=#{state_file}
    #{terraform_dir}
  ].join(' ')
end

#show_commandObject



62
63
64
# File 'lib/genesis/commands.rb', line 62

def show_command
  "terraform show #{state_file}"
end