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

Function DecodeAppSyncApi

internal/pulumi/resources/aws/appsync.go:111–149  ·  view source on GitHub ↗

DecodeAppSyncApi decodes an AppSync Event API (aws:appsync/api:Api) resource. The Event API produces 4 pricing dimensions: - GraphQL Notifications (realtimeoperation=Notification) - Connection Duration (realtimeoperation=Duration) - Event Connection (eventapioperation=Connection duration)

(record resources.ResourceRecord, region, inputsJSON string)

Source from the content-addressed store, hash-verified

109// - Event Connection (eventapioperation=Connection duration)
110// - Event Operation (eventapioperation=Operation)
111func DecodeAppSyncApi(record resources.ResourceRecord, region, inputsJSON string) []resources.DecodedResource {
112 props := map[string]string{"type": record.Type}
113 if v := ExtractInput(record.Inputs, "name"); v != "" {
114 props["name"] = v
115 }
116
117 return []resources.DecodedResource{
118 // RealTime product family — realtimeoperation dimension
119 appSyncEntry(record, region, inputsJSON, "GraphQL Notifications",
120 map[string]string{
121 "productFamily": "RealTime",
122 "realtimeoperation": "Notification",
123 "protocol": "MQTT_WSS",
124 },
125 props),
126 appSyncEntry(record, region, inputsJSON, "Connection Duration",
127 map[string]string{
128 "productFamily": "RealTime",
129 "realtimeoperation": "Duration",
130 "protocol": "MQTT_WSS",
131 },
132 props),
133 // RealTime product family — eventapioperation dimension
134 appSyncEntry(record, region, inputsJSON, "Event Connection",
135 map[string]string{
136 "productFamily": "RealTime",
137 "eventapioperation": "Connection duration",
138 "protocol": "MQTT_WSS",
139 },
140 props),
141 appSyncEntry(record, region, inputsJSON, "Event Operation",
142 map[string]string{
143 "productFamily": "RealTime",
144 "eventapioperation": "Operation",
145 "protocol": "MQTT_WSS",
146 },
147 props),
148 }
149}

Callers

nothing calls this directly

Calls 2

ExtractInputFunction · 0.85
appSyncEntryFunction · 0.85

Tested by

no test coverage detected