We have started a new infrastructure project where we are deploying aws-msk. We have two branches.
Project: <redacted>/infra-kafka/applications/prod/msk
Name Monthly Qty Unit Monthly Cost
aws_s3_bucket.custom_plugins
โโ Standard
โโ Storage Monthly cost depends on usage: $0.023 per GB
โโ PUT, COPY, POST, LIST requests Monthly cost depends on usage: $0.005 per 1k requests
โโ GET, SELECT, and all other requests Monthly cost depends on usage: $0.0004 per 1k requests
โโ Select data scanned Monthly cost depends on usage: $0.002 per GB
โโ Select data returned Monthly cost depends on usage: $0.0007 per GB
module.prod_msk_default.aws_cloudwatch_log_group.this
โโ Data ingested Monthly cost depends on usage: $0.50 per GB
โโ Archival Storage Monthly cost depends on usage: $0.03 per GB
โโ Insights queries data scanned Monthly cost depends on usage: $0.005 per GB
module.prod_msk_default.aws_msk_cluster.this
โโ Instance (kafka.m5.large) 2,190 hours $459.90
โโ Storage (autoscaling) 3 GB $0.30
module.prod_msk_mongodb_default_connector.aws_cloudwatch_log_group.this
โโ Data ingested Monthly cost depends on usage: $0.50 per GB
โโ Archival Storage Monthly cost depends on usage: $0.03 per GB
โโ Insights queries data scanned Monthly cost depends on usage: $0.005 per GB
module.prod_msk_mysql_default_connector.aws_cloudwatch_log_group.this
โโ Data ingested Monthly cost depends on usage: $0.50 per GB
โโ Archival Storage Monthly cost depends on usage: $0.03 per GB
โโ Insights queries data scanned Monthly cost depends on usage: $0.005 per GB
OVERALL TOTAL $460.20
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
30 cloud resources were detected:
โ 6 were estimated, 4 of which include usage-based costs, see https://infracost.io/usage-file
โ 14 were free:
โ 4 x aws_iam_role
โ 4 x aws_iam_role_policy_attachment
โ 2 x aws_iam_policy
โ 1 x aws_appautoscaling_policy
โ 1 x aws_iam_instance_profile
โ 1 x aws_msk_configuration
โ 1 x aws_security_group
โ 10 are not supported yet, see https://infracost.io/requested-resources:
โ 3 x aws_mskconnect_custom_plugin
โ 3 x aws_s3_object
โ 2 x aws_mskconnect_connector
โ 2 x aws_mskconnect_worker_configuration
name: terraform-ci
on:
workflow_call:
inputs:
TF_ROOT:
required: true
type: string
TF_APP_NAME:
required: true
type: string
jobs:
cost:
needs: plan
name: cost
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout/@v3
- name: Setup Infracost
uses: infracost/actions/setup@v2
with:
api-key: ${{ secrets.INFRACOST_API_KEY }}
- name: Checkout base branch
uses: actions/checkout@v3
with:
ref: '${{ github.event.pull_request.base.ref }}'
- name: Generate Infracost cost estimate baseline
run: |
infracost breakdown --path=${{ inputs.TF_ROOT }} \
--format=json \
--out-file=/tmp/infracost-base.json
cat /tmp/infracost-base.json
- name: Checkout PR branch
uses: actions/checkout@v3
- name: Generate Infracost diff
run: |
infracost diff --path=${{ inputs.TF_ROOT }} \
--format=json \
--compare-to=/tmp/infracost-base.json \
--out-file=/tmp/infracost.json
cat /tmp/infracost-base.json
echo "here"
cat /tmp/infracost.json
- name: Post Infracost comment
run: |
infracost comment github --path=/tmp/infracost.json \
--repo=$GITHUB_REPOSITORY \
--github-token=${{github.token}} \
--pull-request=${{github.event.pull_request.number}} \
--behavior=new
{"version":"0.2","metadata":{"infracostCommand":"breakdown","vcsBranch":"main","vcsCommitSha":"c9137bb438353a9a2d6630c7491c16bc28bd584e","vcsCommitAuthorName":"Kay Khan","vcsCommitAuthorEmail":"redacted","vcsCommitTimestamp":"2023-08-16T12:43:47Z","vcsCommitMessage":"first commit","vcsRepositoryUrl":"https://github.com/redacted/infra-kafka","vcsProvider":"github","vcsBaseBranch":"main","vcsPullRequestTitle":"feat: kafka + kafkaui","vcsPullRequestUrl":"https://github.com/redacted/infra-kafka/pull/1","vcsPullRequestAuthor":"kaykhan","vcsPipelineRunId":"5901458303","vcsPullRequestId":"1"},"currency":"USD","projects":[{"name":"redacted/infra-kafka/applications/prod/msk","metadata":{"path":"applications/prod/msk","type":"error","vcsSubPath":"applications/prod/msk","errors":[{"code":0,"message":"No such file or directory applications/prod/msk\n\nTry adding a config-file to configure how Infracost should run. See https://infracost.io/config-file for details and examples.","data":null}]},"pastBreakdown":{"resources":[],"totalHourlyCost":"0","totalMonthlyCost":"0"},"breakdown":{"resources":[],"totalHourlyCost":"0","totalMonthlyCost":"0"},"diff":{"resources":[],"totalHourlyCost":"0","totalMonthlyCost":"0"},"summary":{"totalDetectedResources":0,"totalSupportedResources":0,"totalUnsupportedResources":0,"totalUsageBasedResources":0,"totalNoPriceResources":0,"unsupportedResourceCounts":{},"noPriceResourceCounts":{}}}],"totalHourlyCost":"0","totalMonthlyCost":"0","pastTotalHourlyCost":"0","pastTotalMonthlyCost":"0","diffTotalHourlyCost":"0","diffTotalMonthlyCost":"0","timeGenerated":"2023-08-18T10:15:30.213041174Z","summary":{"totalDetectedResources":0,"totalSupportedResources":0,"totalUnsupportedResources":0,"totalUsageBasedResources":0,"totalNoPriceResources":0,"unsupportedResourceCounts":{},"noPriceResourceCounts":{}}}
{"version":"0.2","metadata":{"infracostCommand":"diff","vcsBranch":"dev/modules","vcsCommitSha":"40567b7ed14441c64890b09f0cca994f688a910e","vcsCommitAuthorName":"Kay Khan","vcsCommitAuthorEmail":"redacted","vcsCommitTimestamp":"2023-08-18T10:13:53Z","vcsCommitMessage":"update: debug","vcsRepositoryUrl":"https://github.com/redacted/infra-kafka","vcsProvider":"github","vcsBaseBranch":"main","vcsPullRequestTitle":"feat: kafka + kafkaui","vcsPullRequestUrl":"https://github.com/redacted/infra-kafka/pull/1","vcsPullRequestAuthor":"kaykhan","vcsPipelineRunId":"5901458303","vcsPullRequestId":"1"},"currency":"USD","projects":[{"name":"redacted/infra-kafka/applications/prod/msk","metadata":{"path":"applications/prod/msk","type":"terraform_dir","vcsSubPath":"applications/prod/msk","errors":[{"code":0,"message":"Diff baseline error: No such file or directory applications/prod/msk\n\nTry adding a config-file to configure how Infracost should run. See https://infracost.io/config-file for details and examples.","data":null}],"providers":[{"name":"aws","filename":"applications/prod/msk/versions.tf","startLine":13,"endLine":15}]},"pastBreakdown":null,"breakdown":{"resources":[],"totalHourlyCost":"0","totalMonthlyCost":"0"},"diff":null,"summary":{"totalDetectedResources":30,"totalSupportedResources":6,"totalUnsupportedResources":10,"totalUsageBasedResources":4,"totalNoPriceResources":14,"unsupportedResourceCounts":{"aws_mskconnect_connector":2,"aws_mskconnect_custom_plugin":3,"aws_mskconnect_worker_configuration":2,"aws_s3_object":3},"noPriceResourceCounts":{"aws_appautoscaling_policy":1,"aws_iam_instance_profile":1,"aws_iam_policy":2,"aws_iam_role":4,"aws_iam_role_policy_attachment":4,"aws_msk_configuration":1,"aws_security_group":1}}}],"totalHourlyCost":"0","totalMonthlyCost":"0","pastTotalHourlyCost":null,"pastTotalMonthlyCost":null,"diffTotalHourlyCost":null,"diffTotalMonthlyCost":null,"timeGenerated":"2023-08-18T10:15:33.247471322Z","summary":{"totalDetectedResources":30,"totalSupportedResources":6,"totalUnsupportedResources":10,"totalUsageBasedResources":4,"totalNoPriceResources":14,"unsupportedResourceCounts":{"aws_mskconnect_connector":2,"aws_mskconnect_custom_plugin":3,"aws_mskconnect_worker_configuration":2,"aws_s3_object":3},"noPriceResourceCounts":{"aws_appautoscaling_policy":1,"aws_iam_instance_profile":1,"aws_iam_policy":2,"aws_iam_role":4,"aws_iam_role_policy_attachment":4,"aws_msk_configuration":1,"aws_security_group":1}}}