DecodeS3BucketObject maps an S3 BucketObject / BucketObjectv2 to a single Storage pricing query. The storageClass input determines the volumeType.
(record resources.ResourceRecord, region, inputsJSON string)
| 104 | // DecodeS3BucketObject maps an S3 BucketObject / BucketObjectv2 to a single |
| 105 | // Storage pricing query. The storageClass input determines the volumeType. |
| 106 | func DecodeS3BucketObject(record resources.ResourceRecord, region, inputsJSON string) []resources.DecodedResource { |
| 107 | storageClass := ExtractInput(record.Inputs, "storageClass") |
| 108 | volumeType := storageClassToVolumeType(storageClass) |
| 109 | |
| 110 | props := map[string]string{"type": record.Type} |
| 111 | if v := ExtractInput(record.Inputs, "bucket"); v != "" { |
| 112 | props["bucket"] = v |
| 113 | } |
| 114 | if v := ExtractInput(record.Inputs, "key"); v != "" { |
| 115 | props["key"] = v |
| 116 | } |
| 117 | if storageClass != "" { |
| 118 | props["storageClass"] = storageClass |
| 119 | } |
| 120 | props["volumeType"] = volumeType |
| 121 | |
| 122 | return []resources.DecodedResource{ |
| 123 | s3Entry(record, region, inputsJSON, "Storage", |
| 124 | map[string]string{ |
| 125 | "productFamily": "Storage", |
| 126 | "volumeType": volumeType, |
| 127 | "storageClass": "General Purpose", |
| 128 | }, |
| 129 | props), |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | // DecodeS3DirectoryBucket maps an S3 Express DirectoryBucket to a Storage |
| 134 | // pricing query using the "High Performance" storageClass. |
nothing calls this directly
no test coverage detected