dh-proteus 0.3.7 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cdd09685fbb59a3fba9da1b7b1e0b1f84bdbaec975dccd6eb3148526ab7ae05
4
- data.tar.gz: 631163e0ae642ae6328eff584a7be1eafb1fbf8d1f0de7fab19e52d45832dc15
3
+ metadata.gz: edc99646e608a421f7b125ee09bd0a4f59466325d93183bfab5064d20794b875
4
+ data.tar.gz: 9b08c970dc9862454939d8069e9f0af38f0fe7ec75381634d588ee5a089562f1
5
5
  SHA512:
6
- metadata.gz: c62a0a514498abeef4f19cf913920f98802726ba83694bebc8dd03ece8cbfb4a70a11b2304b44ba4bfae2e95049e58de8c36fb54f37cd0cfe753e2d6681310ff
7
- data.tar.gz: f010f09c3129f436ae3bd728020ee395c3fdbd22c42ef7dec4dc8371f7c6f7a7b864bdedb0fe19b2b2e24c797d11cb5ab8667c0ef3634dd14d0a18094ca3c7cc
6
+ metadata.gz: 5bcdbb93ec216b96491fee20b60999b8a40aa1659939d1dbf2b1c042ae0c048c22d1eb89a8a61bcd9ea2aca700d93e2ddb3aeb24085f22baf17d613aaff4bc9f
7
+ data.tar.gz: 4b86d53686fa246d7b764e8ef38e2a03accd9a7198e306b94e5cdf0d8caf1199f061f725f9da5e7ef03cf86e6059a3371ab45b741c581b6f6ac0c6b3d763bd86
@@ -79,6 +79,10 @@ module Proteus
79
79
  key = "<%= @config[:backend][@backend_key][:key_prefix] %>#{@context}-#{@environment}.tfstate"
80
80
  region = "<%= @config[:backend][@backend_key][:bucket][:region] %>"
81
81
  profile = "<%= @config[:backend][@backend_key][:profile]%>"
82
+ <%- if (@config[:backend][@backend_key].keys & ["encrypt", "kms_key_id"]).size == 2 -%>
83
+ encrypt = true
84
+ kms_key_id = "<%= @config[:backend][@backend_key][:kms_key_id] %>"
85
+ <%- end -%>
82
86
  }
83
87
  }
84
88
  TEMPLATE
@@ -20,7 +20,7 @@ module Proteus
20
20
  terraform destroy \
21
21
  -var-file=#{var_file(context, environment)} \
22
22
  #{aws_profile} \
23
- ##{limit(options[:limit])}
23
+ #{limit(options[:limit])}
24
24
  DESTROY_COMMAND
25
25
 
26
26
  plan_destroy_command = <<~PLAN_DESTROY_COMMAND
@@ -30,7 +30,7 @@ module Proteus
30
30
  -out=#{plan_file(context, environment)} \
31
31
  -var-file=#{var_file(context, environment)} \
32
32
  #{aws_profile} \
33
- ##{limit(options[:limit])}
33
+ #{limit(options[:limit])}
34
34
  PLAN_DESTROY_COMMAND
35
35
 
36
36
 
@@ -0,0 +1,31 @@
1
+ module Proteus
2
+ module Commands
3
+ module Untaint
4
+ def self.included(thor_class)
5
+ thor_class.class_eval do
6
+
7
+ desc "untaint", "Untaints an existing resource"
8
+ long_desc <<-LONGDESC
9
+ Untaints an existing resource
10
+
11
+ --resource The resource to untaint
12
+ LONGDESC
13
+ option :resource, type: :string, aliases: "-r", required: true
14
+ def untaint
15
+ init(verbose: parent_options[:verbose])
16
+ confirm question: "Do you really want to run 'terraform untaint' on environment '#{environment}' in context '#{context}'?", color: :on_red, exit_code: 0 do
17
+
18
+ untaint_command = <<~UNTAINT_COMMAND
19
+ cd #{context_path(context)} && \
20
+ terraform untaint \
21
+ #{options[:resource]}
22
+ UNTAINT_COMMAND
23
+ syscall untaint_command.squeeze(' ')
24
+ end
25
+ end
26
+
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -7,6 +7,7 @@ require 'proteus/commands/output'
7
7
  require 'proteus/commands/plan'
8
8
  require 'proteus/commands/render'
9
9
  require 'proteus/commands/taint'
10
+ require 'proteus/commands/untaint'
10
11
 
11
12
  module Proteus
12
13
  class Common < Thor
@@ -45,6 +46,7 @@ module Proteus
45
46
  `rm -rf #{context_path(context)}/.terraform/*.tf*`
46
47
  `rm -rf #{context_path(context)}/.terraform/modules`
47
48
  `rm -rf #{context_path(context)}/terraform.tfstate*`
49
+ `rm -rf #{context_path(context)}/.terraform.lock.hcl`
48
50
 
49
51
  terraform_command = <<~TERRAFORM_COMMAND
50
52
  cd #{context_path(context)} && \
@@ -1,5 +1,5 @@
1
1
  module Proteus
2
- VERSION = "0.3.7"
2
+ VERSION = "0.4.1"
3
3
  end
4
4
 
5
5
  if $0 == __FILE__
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dh-proteus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Albrecht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-21 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,6 +160,7 @@ files:
160
160
  - lib/proteus/commands/state/remove.rb
161
161
  - lib/proteus/commands/state/show.rb
162
162
  - lib/proteus/commands/taint.rb
163
+ - lib/proteus/commands/untaint.rb
163
164
  - lib/proteus/common.rb
164
165
  - lib/proteus/config/config.rb
165
166
  - lib/proteus/context_management/context.rb