jets 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 554083017110e6aef17fa79c69bbb53aaa0532c8015a7f9372a5cab266937840
4
- data.tar.gz: e93d0e030a9160120cef06b98a86c8417fccbefec7e89729f12b2371ef032a26
3
+ metadata.gz: 7a1e324ead9b88c6b0bb6086abfa1335cda56a02f1e99626fd670ebbb0c24c11
4
+ data.tar.gz: fb549594a20485ac5b0102b1693bc37e0082ef5031b073557cb4ffea7d90a73d
5
5
  SHA512:
6
- metadata.gz: 8f3cae69d437e4a45b3028d59823af81b9d4d1193429ab8cec6dae772f6fdc95a568469128374d107ca37377d3d98cd4edebcecb4d7987503b5fff7ef1df73bd
7
- data.tar.gz: 5474c0f27bb2860ce070021539ae0772e1fcc1a9464af205b5a892a604b396fb2ccc6ff57d5c11c03130fdd705bea1eb302934a8386f44809ca52f9e385a488c
6
+ metadata.gz: 04307b921ea8deb8a0b9db73aef2ba1920ec6e975a71d0b913d0d903b0e160a6bafe02cd4c3203684aaf9fa892b5370c8dd97b4e853778b534b064682e4321c5
7
+ data.tar.gz: 0a60c57975f1e121fd8bd35150ce9d8469d15616ff91c4a71c9f0bc04d7201707ee27427b5b3bf893599e0219ccf67adfc45edc6fc0524dcc3933c00f6842a43
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.8.4]
7
+ - fix custom iam policies
8
+ - fix edge case: allow stack to be delete in rollback completed state
9
+
6
10
  ## [0.8.3]
7
11
  - adjust prewarm.public_ratio default to 10
8
12
 
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (0.8.3)
14
+ jets (0.8.4)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -67,10 +67,10 @@ module Jets::AwsServices
67
67
  puts "The '#{stack_name}' stack status is #{status}. " \
68
68
  "Please wait until the stack is ready and try again.".colorize(:red)
69
69
  exit 0
70
- elsif resp.stacks[0].outputs.empty?
70
+ elsif resp.stacks[0].outputs.empty? && status != 'ROLLBACK_COMPLETE'
71
71
  # This Happens when the miminal stack fails at the very beginning.
72
72
  # There is no s3 bucket at all. User should delete the stack.
73
- puts "The minimal stack failed to create. Please delete the stack first and try again." \
73
+ puts "The minimal stack failed to create. Please delete the stack first and try again. " \
74
74
  "You can delete the CloudFormation stack or use the `jets delete` command"
75
75
  exit 0
76
76
  else
@@ -123,6 +123,9 @@ class Jets::Commands::Delete
123
123
  # Assumes stack exists
124
124
  resp = cfn.describe_stacks(stack_name: @parent_stack_name)
125
125
  status = resp.stacks[0].stack_status
126
+
127
+ return true if status == 'ROLLBACK_COMPLETE'
128
+
126
129
  if status =~ /_IN_PROGRESS$/
127
130
  puts "The '#{@parent_stack_name}' stack status is #{status}. " \
128
131
  "It is not in an updateable status. Please wait until the stack is ready and try again.".colorize(:red)
@@ -130,7 +133,7 @@ class Jets::Commands::Delete
130
133
  elsif resp.stacks[0].outputs.empty?
131
134
  # This Happens when the miminal stack fails at the very beginning.
132
135
  # There is no s3 bucket at all. User should delete the stack.
133
- puts "The minimal stack failed to create. Please delete the stack first and try again." \
136
+ puts "The minimal stack failed to create. Please delete the stack first and try again. " \
134
137
  "You can delete the CloudFormation stack or use the `jets delete` command"
135
138
  exit 0
136
139
  else
@@ -15,7 +15,7 @@ module Jets::Resource::Iam
15
15
  end
16
16
 
17
17
  def role_name
18
- "ApplicationRole" # camelized because used as template value
18
+ "#{Jets.config.project_namespace}-application-role" # camelized because used as template value
19
19
  end
20
20
 
21
21
  def outputs
@@ -22,13 +22,13 @@ module Jets::Resource::Iam
22
22
  }
23
23
 
24
24
  definition[logical_id][:properties][:policies] = [
25
- policy_name: "#{role_name}Policy",
25
+ policy_name: "#{role_name}-policy",
26
26
  policy_document: policy_document,
27
- ] if policy_document
27
+ ] unless policy_document['Statement'].empty?
28
28
 
29
- # if managed_iam_policy.arns
30
- # definition[logical_id][:properties][:managed_policy_arns] = managed_iam_policy.arns
31
- # end
29
+ unless managed_policy_arns.empty?
30
+ definition[logical_id][:properties][:managed_policy_arns] = managed_policy_arns
31
+ end
32
32
 
33
33
  definition
34
34
  end
@@ -37,7 +37,7 @@ module Jets::Resource::Iam
37
37
  PolicyDocument.new(@policy_definitions).policy_document
38
38
  end
39
39
 
40
- def managed_iam_policy
40
+ def managed_policy_arns
41
41
  ManagedPolicy.new(@managed_policy_definitions).arns
42
42
  end
43
43
  end
@@ -13,7 +13,8 @@ module Jets::Resource::Iam
13
13
  end
14
14
 
15
15
  def role_name
16
- "{namespace}Role" # camelized because used as template value
16
+ class_namespace = replacements[:namespace].underscore.dasherize
17
+ "#{Jets.config.project_namespace}-#{class_namespace}-role" # camelized because used as template value
17
18
  end
18
19
 
19
20
  def replacements
@@ -13,7 +13,8 @@ module Jets::Resource::Iam
13
13
  end
14
14
 
15
15
  def role_name
16
- "{namespace}Role" # camelized because used as template value
16
+ funcion_namespace = replacements[:namespace].underscore.dasherize
17
+ "#{Jets.config.project_namespace}-#{funcion_namespace}-role" # camelized because used as template value
17
18
  end
18
19
 
19
20
  def replacements
@@ -4,7 +4,7 @@ module Jets::Resource::Iam
4
4
 
5
5
  attr_reader :definitions
6
6
  def initialize(*definitions)
7
- @definitions = definitions.flatten
7
+ @definitions = definitions.flatten.compact
8
8
  end
9
9
 
10
10
  def arns
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen