cfhighlander 0.5.0.alpha.1532475939 → 0.5.0.alpha.1533598770
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 +4 -4
- data/README.md +20 -0
- data/bin/cfhighlander.rb +1 -1
- data/lib/cfhighlander.validator.rb +5 -0
- 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: 3b49cd3b396b061c0f206802a8c2c6c3e03ca16b63adb6bb56735ae0dbbd80dd
|
4
|
+
data.tar.gz: 34af7300204b6a7e32d85027f2a34317d69a6bd3efbb1679a41f726e3d1a3b91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45696c171086b2ae974ce3555eb2a50c5c5f8ae905821abb09605462728448176df37e805bd2a74a701667af5a23a2f15995350ef08e88a80397b8ac7ac2303c
|
7
|
+
data.tar.gz: 2b935de2734e82b582350598b71f0d4152cc967e4349eaa2f4d875d183649a1da8ad5c1e706b856b3fe65d32bd9ea133bd164b6439f7ecce4028566cf3ddf27d
|
data/README.md
CHANGED
@@ -443,7 +443,27 @@ end
|
|
443
443
|
|
444
444
|
```
|
445
445
|
|
446
|
+
**Convert config value to parameter** - In case of inner component having configuration value
|
447
|
+
you wish to expose as runtime parameter, it is possible to do so with limitation that configuration
|
448
|
+
value is only used in *resource declarations*, as property value. If configuration value is being used
|
449
|
+
to control the dsl flow, taking part in any control structure statements, and such gets evaluated at
|
450
|
+
**compile** time, there is no sense of making CloudFormation stack parameter out of it.
|
446
451
|
|
452
|
+
Below example demonstrate use of `ConfigParameter` statement on simple S3 Bucket component -
|
453
|
+
it assumes that `s3bucket` template exists with `bucketName` as configuration value for it.
|
454
|
+
|
455
|
+
|
456
|
+
```ruby
|
457
|
+
CfhighlanderTemplate do
|
458
|
+
|
459
|
+
Component template: 's3bucket', name: 'parameterizedBucket' do
|
460
|
+
ConfigParameter config_key: 'bucketName', parameter_name: '', type: 'String'
|
461
|
+
end
|
462
|
+
|
463
|
+
end
|
464
|
+
|
465
|
+
|
466
|
+
```
|
447
467
|
|
448
468
|
### Parameters
|
449
469
|
|
data/bin/cfhighlander.rb
CHANGED
@@ -84,7 +84,7 @@ class HighlanderCli < Thor
|
|
84
84
|
|
85
85
|
component = build_component(options, component_name)
|
86
86
|
|
87
|
-
if component.distribution_bucket.nil? or component.distribution_prefix.nil?
|
87
|
+
if component.highlander_dsl.distribution_bucket.nil? or component.highlander_dsl.distribution_prefix.nil?
|
88
88
|
component.distribution_bucket="#{aws_account_id()}.#{aws_current_region()}.cfhighlander.templates" if component.distribution_bucket.nil?
|
89
89
|
component.distribution_prefix="published-templates/#{component.name}" if component.distribution_prefix.nil?
|
90
90
|
puts "INFO: Reloading component, as auto-generated distribution settings are being applied..."
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'aws-sdk-cloudformation'
|
2
2
|
require 'aws-sdk-s3'
|
3
3
|
require 'digest/md5'
|
4
|
+
require_relative '../hl_ext/aws_helper'
|
4
5
|
|
5
6
|
module Cfhighlander
|
6
7
|
|
@@ -46,6 +47,10 @@ module Cfhighlander
|
|
46
47
|
def validate_s3(path)
|
47
48
|
template = File.read path
|
48
49
|
bucket = @component.highlander_dsl.distribution_bucket
|
50
|
+
if bucket.nil?
|
51
|
+
bucket = "#{aws_account_id()}.#{aws_current_region()}.cfhighlander.templates"
|
52
|
+
s3_create_bucket_if_not_exists(bucket)
|
53
|
+
end
|
49
54
|
prefix = @component.highlander_dsl.distribution_prefix
|
50
55
|
md5 = Digest::MD5.hexdigest template
|
51
56
|
s3_key = "#{prefix}/highlander/validate/#{md5}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfhighlander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.alpha.
|
4
|
+
version: 0.5.0.alpha.1533598770
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Tosic
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-08-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|