mytemplates-stack_actions_validation 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 530fc7b4e78e091733873f8d816a79ba5e92cab5
4
+ data.tar.gz: f98f9f3d13cfff2268ba0f11d8ad70d49feb9b93
5
+ SHA512:
6
+ metadata.gz: 8022063cabcb47be81c701e873696da4c98432e7364d83d1d91e638a02d2fa8d31536b675bb36a6f738fca03ef80a2a2a397c7e06be5827df91a7dcfa706b7cb
7
+ data.tar.gz: 74c4daa4c0a576a9488be3b4a8185f95e356ed345483b3d3e143c342a7adde62e040a3bf02d0f441d28c4315bc42d3f25c35f1de39b49d5fa9f3f41f7d690e07
@@ -0,0 +1 @@
1
+ quiet: true
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .idea/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1 @@
1
+ mytemplates-stack_actions_validation
@@ -0,0 +1 @@
1
+ ruby-2.4.1
@@ -0,0 +1,2 @@
1
+ sudo: false
2
+ language: ruby
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at km@krishnanm.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in mytemplates-stack_actions_validation.gemspec
4
+ gemspec
@@ -0,0 +1,43 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mytemplates-stack_actions_validation (0.1.1)
5
+ json-schema (~> 2.8)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.5.2)
11
+ public_suffix (>= 2.0.2, < 4.0)
12
+ diff-lcs (1.3)
13
+ gem-release (1.0.0)
14
+ json-schema (2.8.0)
15
+ addressable (>= 2.4)
16
+ public_suffix (3.0.2)
17
+ rake (12.3.0)
18
+ rspec (3.7.0)
19
+ rspec-core (~> 3.7.0)
20
+ rspec-expectations (~> 3.7.0)
21
+ rspec-mocks (~> 3.7.0)
22
+ rspec-core (3.7.1)
23
+ rspec-support (~> 3.7.0)
24
+ rspec-expectations (3.7.0)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.7.0)
27
+ rspec-mocks (3.7.0)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.7.0)
30
+ rspec-support (3.7.1)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ bundler (~> 1.16)
37
+ gem-release (~> 1.0)
38
+ mytemplates-stack_actions_validation!
39
+ rake (~> 12.3)
40
+ rspec (~> 3.7)
41
+
42
+ BUNDLED WITH
43
+ 1.16.1
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org>
@@ -0,0 +1,37 @@
1
+ # Mytemplates::StackActionsValidation
2
+
3
+ Validate information supplied to operate on stacks in AWS CloudFormation against the supported API
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'mytemplates-stack_actions_validation'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install mytemplates-stack_actions_validation
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ 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.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at [mytemplates-stack_actions_validation](https://github.com/rain-again/mytemplates-stack_actions_validation). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
+
35
+ ## Code of Conduct
36
+
37
+ Everyone interacting in the Mytemplates::StackActionsValidation project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "mytemplates/stack_actions_validation"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,16 @@
1
+ require "mytemplates/stack_actions_validation/version"
2
+
3
+ require 'json'
4
+ require 'json-schema'
5
+
6
+ module Mytemplates
7
+ module StackActionsValidation
8
+
9
+ @schema = JSON.parse(IO.read(File.join(File.dirname(__FILE__), 'stack_actions_validation', 'resources', 'schema.json')))
10
+
11
+ def self.validate(stack_action)
12
+ JSON::Validator.validate!(@schema, stack_action)
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,165 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "StackName": {
5
+ "type": "string"
6
+ },
7
+ "TemplateBody": {
8
+ "type": "string"
9
+ },
10
+ "TemplateURL": {
11
+ "type": "string"
12
+ },
13
+ "Parameters": {
14
+ "type": "array",
15
+ "items": {
16
+ "oneOf": [
17
+ {
18
+ "$ref": "#/definitions/parameter"
19
+ }
20
+ ]
21
+ }
22
+ },
23
+ "DisableRollback": {
24
+ "type": "boolean"
25
+ },
26
+ "RollbackConfiguration": {
27
+ "type": "object",
28
+ "properties": {
29
+ "RollBackTriggers": {
30
+ "type": "array",
31
+ "items": {
32
+ "oneOf": [
33
+ {
34
+ "$ref": "#/definitions/rollback_trigger"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ "MonitoringTimeInMinutes": {
40
+ "type": "integer"
41
+ }
42
+ }
43
+ },
44
+ "TimeoutInMinutes": {
45
+ "type": "integer"
46
+ },
47
+ "NotificationARNs": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string"
51
+ }
52
+ },
53
+ "Capabilities": {
54
+ "type": "array",
55
+ "items": {
56
+ "oneOf": [
57
+ {
58
+ "type": "string",
59
+ "enum": [
60
+ "CAPABILITY_IAM",
61
+ "CAPABILITY_NAMED_IAM"
62
+ ]
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ "ResourceTypes": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "string"
71
+ }
72
+ },
73
+ "RoleARN": {
74
+ "type": "string"
75
+ },
76
+ "OnFailure": {
77
+ "type": "string",
78
+ "enum": [
79
+ "DO_NOTHING",
80
+ "ROLLBACK",
81
+ "DELETE"
82
+ ]
83
+ },
84
+ "StackPolicyBody": {
85
+ "type": "string"
86
+ },
87
+ "StackPolicyURL": {
88
+ "type": "string"
89
+ },
90
+ "Tags": {
91
+ "type": "array",
92
+ "items": {
93
+ "oneOf": [
94
+ {
95
+ "$ref": "#/definitions/tag"
96
+ }
97
+ ]
98
+ }
99
+ },
100
+ "ClientRequestToken": {
101
+ "type": "string"
102
+ },
103
+ "EnableTerminationProtection": {
104
+ "type": "boolean"
105
+ }
106
+ },
107
+ "definitions": {
108
+ "parameter": {
109
+ "type": "object",
110
+ "properties": {
111
+ "ParameterKey": {
112
+ "type": "string"
113
+ },
114
+ "ParameterValue": {
115
+ "type": "string"
116
+ },
117
+ "UsePreviousValue": {
118
+ "type": "boolean"
119
+ }
120
+ },
121
+ "required": [
122
+ "ParameterKey"
123
+ ],
124
+ "minProperties": 2,
125
+ "maxProperties": 2,
126
+ "dependencies": {
127
+ "ParameterValue": [
128
+ "ParameterKey"
129
+ ],
130
+ "UsePreviousValue": [
131
+ "ParameterKey"
132
+ ]
133
+ }
134
+ },
135
+ "rollback_trigger": {
136
+ "type": "object",
137
+ "properties": {
138
+ "Arn": {
139
+ "type": "string"
140
+ },
141
+ "Type": {
142
+ "type": "string"
143
+ }
144
+ }
145
+ },
146
+ "tag": {
147
+ "type": "object",
148
+ "properties": {
149
+ "Key": {
150
+ "type": "string"
151
+ },
152
+ "Value": {
153
+ "type": "string"
154
+ }
155
+ },
156
+ "required": [
157
+ "Key",
158
+ "Value"
159
+ ]
160
+ }
161
+ },
162
+ "required": [
163
+ "StackName"
164
+ ]
165
+ }
@@ -0,0 +1,5 @@
1
+ module Mytemplates
2
+ module StackActionsValidation
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
@@ -0,0 +1,27 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "mytemplates/stack_actions_validation/version"
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "mytemplates-stack_actions_validation"
8
+ s.version = Mytemplates::StackActionsValidation::VERSION
9
+ s.authors = ["Krishnan"]
10
+ s.email = ["km@krishnanm.com"]
11
+
12
+ s.summary = %q{Validate information supplied to operate on stacks in AWS CloudFormation}
13
+ s.description = %q{When creating, updating, or otherwise changing stacks in AWS CloudFormation, one must supply information such as the stack name, a list of parameters, and so on. This gem helps validate the information against the requirements of the corresponding API actions}
14
+ s.homepage = "http://mytemplat.es"
15
+
16
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency "json-schema", "~> 2.8"
22
+
23
+ s.add_development_dependency "bundler", "~> 1.16"
24
+ s.add_development_dependency "rake", "~> 12.3"
25
+ s.add_development_dependency "rspec", "~> 3.7"
26
+ s.add_development_dependency "gem-release", "~> 1.0"
27
+ end
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mytemplates-stack_actions_validation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Krishnan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json-schema
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.16'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: gem-release
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.0'
83
+ description: When creating, updating, or otherwise changing stacks in AWS CloudFormation,
84
+ one must supply information such as the stack name, a list of parameters, and so
85
+ on. This gem helps validate the information against the requirements of the corresponding
86
+ API actions
87
+ email:
88
+ - km@krishnanm.com
89
+ executables: []
90
+ extensions: []
91
+ extra_rdoc_files: []
92
+ files:
93
+ - ".gem_release.yml"
94
+ - ".gitignore"
95
+ - ".rspec"
96
+ - ".ruby-gemset"
97
+ - ".ruby-version"
98
+ - ".travis.yml"
99
+ - CODE_OF_CONDUCT.md
100
+ - Gemfile
101
+ - Gemfile.lock
102
+ - LICENSE
103
+ - README.md
104
+ - Rakefile
105
+ - bin/console
106
+ - bin/setup
107
+ - lib/mytemplates/stack_actions_validation.rb
108
+ - lib/mytemplates/stack_actions_validation/resources/schema.json
109
+ - lib/mytemplates/stack_actions_validation/version.rb
110
+ - mytemplates-stack_actions_validation.gemspec
111
+ homepage: http://mytemplat.es
112
+ licenses: []
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project:
130
+ rubygems_version: 2.6.14
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: Validate information supplied to operate on stacks in AWS CloudFormation
134
+ test_files: []