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

Function DecodeS3BucketObject

internal/pulumi/resources/aws/s3.go:106–131  ·  view source on GitHub ↗

DecodeS3BucketObject maps an S3 BucketObject / BucketObjectv2 to a single Storage pricing query. The storageClass input determines the volumeType.

(record resources.ResourceRecord, region, inputsJSON string)

Source from the content-addressed store, hash-verified

104// DecodeS3BucketObject maps an S3 BucketObject / BucketObjectv2 to a single
105// Storage pricing query. The storageClass input determines the volumeType.
106func 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.

Callers

nothing calls this directly

Calls 3

ExtractInputFunction · 0.85
storageClassToVolumeTypeFunction · 0.85
s3EntryFunction · 0.85

Tested by

no test coverage detected