uc3-sam-sceptre 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +64 -56
- data/lib/uc3-sam-sceptre/version.rb +1 -1
- data/lib/uc3-sam-sceptre.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64fdd8ce5b3381224cc3d9599724258ef949bf00616ba090f759f3024b021563
|
4
|
+
data.tar.gz: 47cc57eca27a3a792dd370c5d57840ac5356489fa1b1ad7d3d98c9f31143da90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae05c6e2581a4d4b81eaff17108646a5b08873a503507f1f88e0dac850853dd191427150c778e929526419ac189ffd8c52b87c707d87978441639cf1bd941054
|
7
|
+
data.tar.gz: 489ff775002d7a6efd27fb1940049226858cb61122c87011ee4e7c542ba14a11d3577171ee872604b6ef7569b5c7ac064452aabb48ff5fcbd4856ce0c15f67bd
|
data/README.md
CHANGED
@@ -171,7 +171,7 @@ parameters:
|
|
171
171
|
hooks:
|
172
172
|
after_create:
|
173
173
|
# Build the Lambda code and store in the bucket so it is available downstream
|
174
|
-
- !cmd './templates/lambdas/src/sam_build_deploy.rb'
|
174
|
+
- !cmd './templates/lambdas/src/sam_build_deploy.rb true true'
|
175
175
|
```
|
176
176
|
|
177
177
|
### Examples Ruby scripts:
|
@@ -181,36 +181,40 @@ The following is an example of deploying to a Lambda that is a Docker image into
|
|
181
181
|
|
182
182
|
require 'uc3-sam-sceptre'
|
183
183
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
proxy.
|
213
|
-
proxy.
|
184
|
+
if ARGV.length == 2
|
185
|
+
params = {
|
186
|
+
service: 'dmp',
|
187
|
+
subservice: 'hub',
|
188
|
+
git_repo: 'https://github.com/CDLUC3/dmp-hub-cfn',
|
189
|
+
stack_suffix: 'docker-lambdas',
|
190
|
+
admin_email_key: 'AdminEmail',
|
191
|
+
|
192
|
+
ecr_uri_key: 'EcrRepositoryUri',
|
193
|
+
|
194
|
+
fetchable_cf_params: [
|
195
|
+
{ stack_export_name: 'VpcId' },
|
196
|
+
{ stack_export_name: 'SubnetA' },
|
197
|
+
{ stack_export_name: 'SubnetB' },
|
198
|
+
{ stack_export_name: 'SubnetC' },
|
199
|
+
{ stack_export_name: 'DeadLetterQueueArn' },
|
200
|
+
{ stack_export_name: 'LambdaSecGroupId' },
|
201
|
+
{ stack_export_name: 'SnsTopicEmailArn', template_param_name: 'SnsEmailTopicArn' },
|
202
|
+
{ stack_export_name: 'DomainName' },
|
203
|
+
{ stack_export_name: 'RdsHost' },
|
204
|
+
{ stack_export_name: 'RdsPort' },
|
205
|
+
{ stack_export_name: 'RdsDbName' }
|
206
|
+
],
|
207
|
+
static_cf_params: [
|
208
|
+
{ template_param_name: 'Version', value: 'v0' }
|
209
|
+
]
|
210
|
+
}
|
211
|
+
|
212
|
+
proxy = Uc3SamSceptre::Proxy.new(params)
|
213
|
+
proxy.build if ARGV[0].to_s.downcase.strip == 'true'
|
214
|
+
proxy.deploy if ARGV[1].to_s.downcase.strip == 'true'
|
215
|
+
else
|
216
|
+
p 'Expected 2 arguments: run build? and run deploy? (For example: `ruby sam_build_deploy.rb true true`)'
|
217
|
+
end
|
214
218
|
```
|
215
219
|
|
216
220
|
The following is an example of deploying a Lambda that is NOT a Docker image into a ZIP archive stored in S3
|
@@ -219,29 +223,33 @@ The following is an example of deploying a Lambda that is NOT a Docker image int
|
|
219
223
|
|
220
224
|
require 'uc3-sam-sceptre'
|
221
225
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
proxy.
|
246
|
-
proxy.
|
226
|
+
if ARGV.length == 2
|
227
|
+
params = {
|
228
|
+
service: 'dmp',
|
229
|
+
subservice: 'hub',
|
230
|
+
git_repo: 'https://github.com/CDLUC3/dmp-hub-cfn',
|
231
|
+
ecr_uri_key: 'EcrRepositoryUri',
|
232
|
+
stack_suffix: 'docker-lambdas',
|
233
|
+
admin_email_key: 'AdminEmail',
|
234
|
+
|
235
|
+
s3_arn_key: 'S3PrivateBucketArn',
|
236
|
+
|
237
|
+
fetchable_cf_params: [
|
238
|
+
{ stack_export_name: 'CloudFrontDistroId' },
|
239
|
+
{ stack_export_name: 'S3PublicBucketArn' },
|
240
|
+
{ stack_export_name: 'DynamoTableName' },
|
241
|
+
{ stack_export_name: 'SnsTopicEmailArn', template_param_name: 'SnsEmailTopicArn' },
|
242
|
+
{ stack_export_name: 'DomainName' }
|
243
|
+
],
|
244
|
+
static_cf_params: [
|
245
|
+
{ template_param_name: 'Version', value: 'v0' }
|
246
|
+
]
|
247
|
+
}
|
248
|
+
|
249
|
+
proxy = Uc3SamSceptre::Proxy.new(params)
|
250
|
+
proxy.build if ARGV[0].to_s.downcase.strip == 'true'
|
251
|
+
proxy.deploy if ARGV[1].to_s.downcase.strip == 'true'
|
252
|
+
else
|
253
|
+
p 'Expected 2 arguments: run build? and run deploy? (For example: `ruby sam_build_deploy.rb true true`)'
|
254
|
+
end
|
247
255
|
```
|
data/lib/uc3-sam-sceptre.rb
CHANGED
@@ -71,7 +71,7 @@ module Uc3SamSceptre
|
|
71
71
|
"--confirm-changeset #{!@auto}",
|
72
72
|
'--capabilities CAPABILITY_NAMED_IAM',
|
73
73
|
'--disable-rollback false',
|
74
|
-
"--tags #{_sam_tags(admin_email: _locate_value(key: @admin_email_key)}",
|
74
|
+
"--tags #{_sam_tags(admin_email: _locate_value(key: @admin_email_key))}",
|
75
75
|
"--parameter-overrides #{_build_deploy_overrides}"
|
76
76
|
]
|
77
77
|
# Add the S3 or ECR details depending on what we're working with
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-sam-sceptre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2023-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: aws-sdk-
|
14
|
+
name: aws-sdk-cloudformation
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|