Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit 571bf2d

Browse files
kencochraneDavid Chung
authored andcommitted
Added support for getting CFN output values in aws metadata plugin (#691)
Signed-off-by: Ken Cochrane <[email protected]>
1 parent a02e62b commit 571bf2d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/controller/ingress/example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#m4fghruao79i t2 replicated 1/1 nginx:latest *:7777->80/tcp
2727
#
2828
# Remove the service
29-
# docker service rm test1
29+
# docker service rm t2
3030
#
3131
# infrakit simulator/lb1 routes ls # should be empty
3232
#

pkg/provider/aws/plugin/metadata/funcs.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,19 @@ func cfn(clients AWSClients, name string) (interface{}, error) {
135135
parameters[*p.ParameterKey] = p
136136
}
137137

138+
// index outputs by name
139+
outputs := map[string]interface{}{}
140+
for _, p := range output.Stacks[0].Outputs {
141+
if p.OutputKey == nil {
142+
continue
143+
}
144+
outputs[*p.OutputKey] = p
145+
}
146+
138147
// JMESPath package has trouble with fields that are pointers
139148
return template.ToMap(map[string]interface{}{
140149
"Resources": resources,
141150
"Parameters": parameters,
151+
"Outputs": outputs,
142152
})
143153
}

0 commit comments

Comments
 (0)