ripe-answer-8822
08/25/2023, 1:27 PMaws_kinesis_streams
https://github.com/infracost/infracost/issues/2510
I have read and followed the guide on how to add a cost component and that bit works fine until I try to add 2 resources, 1 of Provisioned
and 1 of On_Demand
. Given the pricing API results look like this, I am really struggling to work out how to structure my cost component to accept both stream types. In the example it seemed quite trivial since the transfer family resource shared the same naming scheme (on operation
)
service | productFamily | data | operation | usagetype
---------------+-----------------+------+----------------------------------+------------------------------------
AmazonKinesis | Kinesis Streams | | ConsumerHour | EnhancedFanoutHour
AmazonKinesis | Kinesis Streams | | EnhancedFanoutDataRetrieval | ReadBytes
AmazonKinesis | Kinesis Streams | | LongTermRetentionByteHrs | LongTermRetention-ByteHrs
AmazonKinesis | Kinesis Streams | | LongTermRetentionDataRetrieval | LongTermRetention-ReadBytes
AmazonKinesis | Kinesis Streams | | OnDemandDataIngested | OnDemand-BilledIncomingBytes
AmazonKinesis | Kinesis Streams | | OnDemandDataRetrieval | OnDemand-BilledOutgoingBytes
AmazonKinesis | Kinesis Streams | | OnDemandEFODataRetrieval | OnDemand-BilledOutgoingEFOBytes
AmazonKinesis | Kinesis Streams | | OnDemandExtendedRetentionByteHrs | OnDemand-ExtendedRetention-ByteHrs
AmazonKinesis | Kinesis Streams | | OnDemandLongTermRetentionByteHrs | OnDemand-LongTermRetention-ByteHrs
AmazonKinesis | Kinesis Streams | | OnDemandStreamHr | OnDemand-StreamHour
AmazonKinesis | Kinesis Streams | | PutRequest | PutRequestPayloadUnits
AmazonKinesis | Kinesis Streams | | shardHourStorage | Extended-ShardHour
AmazonKinesis | Kinesis Streams | | shardHourStorage | Storage-ShardHour
Do I just make separate components in this case, or is there a fancy way to get both stream types working in the same one, if so is there any examples in the code where this has been done before?
Apologies if its common knowledge to create 2 components for this situation, Problems with this being my first 1!little-author-61621
operation
in the table. Then only add the relevant ones to the resource depending if it’s On-Demand or Provisioned.stream_mode == On-Demand
add the following cost components:
• On-demand stream - OnDemandStreamHr
• Data ingested - OnDemandDataIngested
• Data retrievals - OnDemandDataRetrieval
• Enhanced fan-out data retrievals - OnDemandEFODataRetrieval
• Data stored (after 24 hours) OnDemandExtendedRetentionByteHrs
• Data stored (after 7 days) - OnDemandLongTermRetentionByteHrs
if stream_mode == Provisioned
add the following cost components:
• Shared hour - shardHourStorage
, Storage-ShardHour
• PUT payload units - PutRequest
• Extended data retention - shardHourStorage
, Extended-ShardHour
- I’m not sure about this one?
• Long-term data retention - LongTermRetentionByteHrs
• Long-term data retrieval - LongTermRetentionDataRetrieval
• Enhanced fan-out data retrievals - EnhancedFanoutDataRetrieval
• Enhanced fan-out - ConsumerHour
, EnhancedFanoutHour