cloudformation-ruby-dsl-addedvars 1.2.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 +7 -0
- data/.gitignore +29 -0
- data/Gemfile +4 -0
- data/LICENSE +13 -0
- data/OWNERS +4 -0
- data/README.md +125 -0
- data/Rakefile +1 -0
- data/bin/aws-sdk-patch +3 -0
- data/bin/cfntemplate-to-ruby +345 -0
- data/cloudformation-ruby-dsl-addedvars.gemspec +42 -0
- data/docs/Contributing.md +21 -0
- data/docs/Releasing.md +20 -0
- data/examples/cloudformation-ruby-script.rb +232 -0
- data/examples/maps/domains.txt +4 -0
- data/examples/maps/map.json +9 -0
- data/examples/maps/map.rb +5 -0
- data/examples/maps/map.yaml +5 -0
- data/examples/maps/more_maps/map1.json +8 -0
- data/examples/maps/more_maps/map2.json +8 -0
- data/examples/maps/more_maps/map3.json +8 -0
- data/examples/maps/table.txt +5 -0
- data/examples/maps/vpc.txt +25 -0
- data/examples/userdata.sh +4 -0
- data/initial_contributions.md +5 -0
- data/lib/cloudformation-ruby-dsl-addedvars.rb +1 -0
- data/lib/cloudformation-ruby-dsl-addedvars/cfntemplate.rb +595 -0
- data/lib/cloudformation-ruby-dsl-addedvars/dsl.rb +270 -0
- data/lib/cloudformation-ruby-dsl-addedvars/spotprice.rb +50 -0
- data/lib/cloudformation-ruby-dsl-addedvars/table.rb +123 -0
- data/lib/cloudformation-ruby-dsl-addedvars/version.rb +21 -0
- data/share/aws-sdk-patch.sh +108 -0
- metadata +192 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# There is the temporary solution allows to use the Assume Role parameter in aws-ruby-sdk.
|
4
|
+
# This script contains patch and allows to apply or revert it.
|
5
|
+
|
6
|
+
# Put the patch content to the variable $PATCH
|
7
|
+
read -r -d '' PATCH <<EOP
|
8
|
+
70c70
|
9
|
+
< @credentials = Credentials.new(
|
10
|
+
---
|
11
|
+
> credentials = Credentials.new(
|
12
|
+
74a75,83
|
13
|
+
> @credentials = if role_arn = profile['role_arn']
|
14
|
+
> AssumeRoleCredentials.new(
|
15
|
+
> role_session_name: [*('A'..'Z')].sample(16).join,
|
16
|
+
> role_arn: role_arn,
|
17
|
+
> credentials: credentials
|
18
|
+
> ).credentials
|
19
|
+
> else
|
20
|
+
> credentials
|
21
|
+
> end
|
22
|
+
79c88,92
|
23
|
+
< profile
|
24
|
+
---
|
25
|
+
> if source = profile.delete('source_profile')
|
26
|
+
> profiles[source].merge(profile)
|
27
|
+
> else
|
28
|
+
> profile
|
29
|
+
> end
|
30
|
+
EOP
|
31
|
+
|
32
|
+
# Define the target gem and file
|
33
|
+
GEM_NAME='aws-sdk-core'
|
34
|
+
FILE_NAME='shared_credentials.rb'
|
35
|
+
|
36
|
+
# Find the latest version of gem file
|
37
|
+
GEM_FILE=$(gem contents "${GEM_NAME}" | grep "${FILE_NAME}")
|
38
|
+
|
39
|
+
# Define the commands
|
40
|
+
TEST_COMMAND='echo "${PATCH}" | patch --dry-run --force --silent '"${GEM_FILE} $@"
|
41
|
+
PATCH_COMMAND='echo "${PATCH}" | patch '"${GEM_FILE} $@"
|
42
|
+
|
43
|
+
# Parse arguments
|
44
|
+
while [ $# -gt 0 ]
|
45
|
+
do
|
46
|
+
case "$1" in
|
47
|
+
--help|-h|-\?) pod2usage -verbose 1 "$0"; exit 0 ;;
|
48
|
+
--man) pod2usage -verbose 2 "$0"; exit 0 ;;
|
49
|
+
--dry-run) shift; echo == Command: ==; echo "$PATCH_COMMAND"; exit 0 ;;
|
50
|
+
-R|--reverse) shift ;;
|
51
|
+
*) echo "Unknown option: $1" >&2; exit 2 ;;
|
52
|
+
esac
|
53
|
+
done
|
54
|
+
|
55
|
+
eval $TEST_COMMAND && eval $PATCH_COMMAND
|
56
|
+
exit $?
|
57
|
+
|
58
|
+
__END__
|
59
|
+
|
60
|
+
=pod
|
61
|
+
|
62
|
+
=head1 NAME
|
63
|
+
|
64
|
+
aws-sdk-patch.sh - Apply or revert patch to aws-ruby-sdk to enable the support of Assume roles
|
65
|
+
|
66
|
+
=head1 SYNOPSIS
|
67
|
+
|
68
|
+
aws-sdk-patch.sh [OPTIONS]
|
69
|
+
|
70
|
+
=head1 OPTIONS
|
71
|
+
|
72
|
+
=over 4
|
73
|
+
|
74
|
+
=item B<--help> | B<-h>
|
75
|
+
|
76
|
+
Print the brief help message and exit.
|
77
|
+
|
78
|
+
=item B<--man>
|
79
|
+
|
80
|
+
Print the manual page and exit.
|
81
|
+
|
82
|
+
=item B<-R> | B<--reverse>
|
83
|
+
|
84
|
+
Revert the previously applied patch
|
85
|
+
|
86
|
+
=item B<--dry-run>
|
87
|
+
|
88
|
+
Print the command and results of applying the patches without actually changing any files.
|
89
|
+
|
90
|
+
=back
|
91
|
+
|
92
|
+
=head1 ARGUMENTS
|
93
|
+
|
94
|
+
Arguments are not allowed.
|
95
|
+
|
96
|
+
=head1 DESCRIPTION
|
97
|
+
|
98
|
+
There is the temporary solution allows to use the Assume Role parameter in aws-ruby-sdk. This script contains patch and allows to apply or revert it.
|
99
|
+
|
100
|
+
=head1 SEE ALSO
|
101
|
+
|
102
|
+
GIT PR #1092, https://github.com/aws/aws-sdk-ruby/pull/1092
|
103
|
+
|
104
|
+
=head1 AUTHOR
|
105
|
+
|
106
|
+
Serhiy Suprun <serhiy.suprun@bazaarvoice.com>
|
107
|
+
|
108
|
+
=cut
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cloudformation-ruby-dsl-addedvars
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shawn Smith
|
8
|
+
- Dave Barcelo
|
9
|
+
- Morgan Fletcher
|
10
|
+
- Csongor Gyuricza
|
11
|
+
- Igor Polishchuk
|
12
|
+
- Nathaniel Eliot
|
13
|
+
- Jona Fenocchi
|
14
|
+
- Tony Cui
|
15
|
+
- Troy Ready
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain: []
|
19
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: detabulator
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
type: :runtime
|
29
|
+
prerelease: false
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: json
|
37
|
+
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
type: :runtime
|
43
|
+
prerelease: false
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: bundler
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: aws-sdk
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: diffy
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
type: :runtime
|
85
|
+
prerelease: false
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: highline
|
93
|
+
requirement: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
type: :runtime
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: rake
|
107
|
+
requirement: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
type: :runtime
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
description: Ruby DSL library that provides a wrapper around the CloudFormation.
|
120
|
+
email:
|
121
|
+
- Shawn.Smith@bazaarvoice.com
|
122
|
+
- Dave.Barcelo@bazaarvoice.com
|
123
|
+
- Morgan.Fletcher@bazaarvoice.com
|
124
|
+
- Csongor.Gyuricza@bazaarvoice.com
|
125
|
+
- Igor.Polishchuk@bazaarvoice.com
|
126
|
+
- Nathaniel.Eliot@bazaarvoice.com
|
127
|
+
- Jona.Fenocchi@bazaarvoice.com
|
128
|
+
- Tony.Cui@bazaarvoice.com
|
129
|
+
- troy@troyready.com
|
130
|
+
executables:
|
131
|
+
- aws-sdk-patch
|
132
|
+
- cfntemplate-to-ruby
|
133
|
+
extensions: []
|
134
|
+
extra_rdoc_files: []
|
135
|
+
files:
|
136
|
+
- ".gitignore"
|
137
|
+
- Gemfile
|
138
|
+
- LICENSE
|
139
|
+
- OWNERS
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- bin/aws-sdk-patch
|
143
|
+
- bin/cfntemplate-to-ruby
|
144
|
+
- cloudformation-ruby-dsl-addedvars.gemspec
|
145
|
+
- docs/Contributing.md
|
146
|
+
- docs/Releasing.md
|
147
|
+
- examples/cloudformation-ruby-script.rb
|
148
|
+
- examples/maps/domains.txt
|
149
|
+
- examples/maps/map.json
|
150
|
+
- examples/maps/map.rb
|
151
|
+
- examples/maps/map.yaml
|
152
|
+
- examples/maps/more_maps/map1.json
|
153
|
+
- examples/maps/more_maps/map2.json
|
154
|
+
- examples/maps/more_maps/map3.json
|
155
|
+
- examples/maps/table.txt
|
156
|
+
- examples/maps/vpc.txt
|
157
|
+
- examples/userdata.sh
|
158
|
+
- initial_contributions.md
|
159
|
+
- lib/cloudformation-ruby-dsl-addedvars.rb
|
160
|
+
- lib/cloudformation-ruby-dsl-addedvars/cfntemplate.rb
|
161
|
+
- lib/cloudformation-ruby-dsl-addedvars/dsl.rb
|
162
|
+
- lib/cloudformation-ruby-dsl-addedvars/spotprice.rb
|
163
|
+
- lib/cloudformation-ruby-dsl-addedvars/table.rb
|
164
|
+
- lib/cloudformation-ruby-dsl-addedvars/version.rb
|
165
|
+
- share/aws-sdk-patch.sh
|
166
|
+
homepage: http://github.com/bazaarvoice/cloudformation-ruby-dsl
|
167
|
+
licenses: []
|
168
|
+
metadata: {}
|
169
|
+
post_install_message:
|
170
|
+
rdoc_options: []
|
171
|
+
require_paths:
|
172
|
+
- lib
|
173
|
+
- bin
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubyforge_project:
|
186
|
+
rubygems_version: 2.6.4
|
187
|
+
signing_key:
|
188
|
+
specification_version: 4
|
189
|
+
summary: Ruby DSL library that provides a wrapper around the CloudFormation. Written
|
190
|
+
by [Bazaarvoice](http://www.bazaarvoice.com).
|
191
|
+
test_files: []
|
192
|
+
has_rdoc:
|