aws_cloudformation_helper 0.1.0 → 0.2.0

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: e2557da5d307726c403d35dfda7173c9c17d3400c513c017bf6d055f2262a4f0
4
- data.tar.gz: 1bc54b9ea4df94a1a199528fa58e49c7aa4069e01c304823d361e4326c6e986c
3
+ metadata.gz: dd3ce1da146dcd54c6a07723f0e5052ee6e7a2629541f045b88aac3d2461527f
4
+ data.tar.gz: bad68458a88cb436e03fd7db93bcf9d88be648bedfa24729983916db8a5d7744
5
5
  SHA512:
6
- metadata.gz: 53fc752f5b5af740aec1269900d9919cadc980552f9cdc514552ace3dc4f70656736606afbcd38e5ed5101df51b6d809957f790486ffb314869ca40580d496fd
7
- data.tar.gz: 8f47f9b95aca6765eeab448158b45e4f699a53e8eaa0aa18226775a7edaa82e6af4988eb5935c512a1090d1461773e65d2a4698c71bc5cf9ef31e075c4bf4c19
6
+ metadata.gz: 72346296e4d2b0d8ae05fce7f8863c687c9b5e206827673f806b12d25e6258a786d74052f67be69271d498fd57ef08b32b26a899793b304b273bfda5222c6189
7
+ data.tar.gz: e427cbb999dea4d89fb013ac6e9d9cc095b36dc42075828d5b5971f31f14e50bfee1832703cf57fea68d2b56c951b5c2e4aca113134a37d9cf3ff3ec427b6539
data/.rubocop.yml CHANGED
@@ -13,3 +13,6 @@ Metrics/BlockLength:
13
13
  - '**/*.rake'
14
14
  - 'test/**/*.rb'
15
15
  - 'spec/**/*.rb'
16
+
17
+ Gemspec/RequiredRubyVersion:
18
+ Enabled: false
data/.travis.yml CHANGED
@@ -3,9 +3,9 @@ language: ruby
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.4.5
7
- - 2.5.4
8
- - 2.6.2
6
+ - 2.5.9
7
+ - 2.6.8
8
+ - 2.7.4
9
9
 
10
10
  script:
11
11
  - bundle exec rubocop .
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # aws_cloudformation_helper Changelog
2
2
 
3
+ ## 0.2.0
4
+ - Feature: Custom response data and custom physical_resource_id ([PR-1](https://github.com/jeffreycoe/aws_cloudformation_helper/pull/1))
5
+
3
6
  ## 0.1.0
4
- Initial release
7
+ - Initial release
data/README.md CHANGED
@@ -80,6 +80,10 @@ end
80
80
 
81
81
  The event data and context object are available from the `@cfn_helper` variable in the main class. Access this data by calling `@cfn_helper.event` and `@cfn_helper.context`.
82
82
 
83
+ Additional response data can also be sent back to CloudFormation stack, ex: `@cfn_helper.event.response_data['Foo']='Bar'`
84
+
85
+ Custom `physical_resource_id` can be sent back to CloudFormation stack by calling `@cfn_helper.event.update_physical_resource_id('custom-id') # returns boolean`. Please note, this only works when CloudFormation stack did not provide an id already.
86
+
83
87
  ## Development
84
88
 
85
89
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  if spec.respond_to?(:metadata)
22
22
  spec.metadata['homepage_uri'] = spec.homepage
23
23
  spec.metadata['source_code_uri'] = 'https://github.com/jeffreycoe/aws_cloudformation_helper'
24
- spec.metadata['changelog_uri'] = 'https://github.com/jeffreycoe/aws_cloudformation_helper/CHANGELOG.md'
24
+ spec.metadata['changelog_uri'] = 'https://github.com/jeffreycoe/aws_cloudformation_helper/blob/master/CHANGELOG.md'
25
25
  end
26
26
 
27
27
  # Specify which files should be added to the gem when it is released.
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.require_paths = ['lib']
35
35
 
36
36
  spec.add_development_dependency 'bundler'
37
- spec.add_development_dependency 'rake'
37
+ spec.add_development_dependency 'rake', '~> 12.3.3'
38
38
  spec.add_development_dependency 'rspec', '~> 3.2'
39
39
  spec.add_development_dependency 'rubocop', '~> 0.79'
40
40
  end
@@ -17,6 +17,7 @@ module AWS
17
17
  attr_reader :request_id
18
18
  attr_reader :request_type
19
19
  attr_reader :stack_id
20
+ attr_accessor :response_data
20
21
 
21
22
  def initialize(event, create_method, delete_method, update_method)
22
23
  parse_event_data(event)
@@ -25,6 +26,7 @@ module AWS
25
26
  @create_method = create_method
26
27
  @delete_method = delete_method
27
28
  @update_method = update_method
29
+ @response_data = {}
28
30
  end
29
31
 
30
32
  def execute
@@ -75,6 +77,13 @@ module AWS
75
77
  raise e
76
78
  end
77
79
 
80
+ def update_physical_resource_id(physical_resource_id)
81
+ return false unless @physical_resource_id.to_s.empty?
82
+
83
+ @physical_resource_id = physical_resource_id
84
+ true
85
+ end
86
+
78
87
  private
79
88
 
80
89
  def parse_event_data(event)
@@ -90,7 +90,7 @@ module AWS
90
90
  LogicalResourceId: Event.instance.logical_resource_id,
91
91
  Data: {
92
92
  Result: 'OK'
93
- }
93
+ }.merge(Event.instance.response_data)
94
94
  }
95
95
  end
96
96
  end
@@ -4,7 +4,7 @@ module AWS
4
4
  module CloudFormation
5
5
  class Helper
6
6
  module Version
7
- GEM_VERSION = '0.1.0'
7
+ GEM_VERSION = '0.2.0'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_cloudformation_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Coe
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2021-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0.79'
69
69
  description: Assists with the development of custom resources for AWS CloudFormation
70
70
  using the Ruby runtime
71
- email:
71
+ email:
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
@@ -95,8 +95,8 @@ licenses:
95
95
  metadata:
96
96
  homepage_uri: https://github.com/jeffreycoe/aws_cloudformation_helper
97
97
  source_code_uri: https://github.com/jeffreycoe/aws_cloudformation_helper
98
- changelog_uri: https://github.com/jeffreycoe/aws_cloudformation_helper/CHANGELOG.md
99
- post_install_message:
98
+ changelog_uri: https://github.com/jeffreycoe/aws_cloudformation_helper/blob/master/CHANGELOG.md
99
+ post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths:
102
102
  - lib
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubygems_version: 3.0.6
115
- signing_key:
115
+ signing_key:
116
116
  specification_version: 4
117
117
  summary: Assists with the development of custom resources for AWS CloudFormation using
118
118
  the Ruby runtime