MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / InputsToProps

Function InputsToProps

internal/pulumi/resources/aws/util.go:124–143  ·  view source on GitHub ↗

InputsToProps converts a resource's inputs to a flat string map for display.

(record resources.ResourceRecord)

Source from the content-addressed store, hash-verified

122
123// InputsToProps converts a resource's inputs to a flat string map for display.
124func InputsToProps(record resources.ResourceRecord) map[string]string {
125 props := map[string]string{
126 "type": record.Type,
127 }
128 for k, v := range record.Inputs {
129 key := string(k)
130 if v.IsString() {
131 props[key] = v.StringValue()
132 } else if v.IsNumber() {
133 props[key] = fmt.Sprintf("%g", v.NumberValue())
134 } else if v.IsBool() {
135 if v.BoolValue() {
136 props[key] = "true"
137 } else {
138 props[key] = "false"
139 }
140 }
141 }
142 return props
143}
144
145// DecodeFreeResource creates a no-pricing DecodedResource for free resource types.
146func DecodeFreeResource(record resources.ResourceRecord) resources.DecodedResource {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected