Hi Guys! i have one question above case of use wit...
# general
h
Hi Guys! i have one question above case of use with Terragrunt, i runned a test but in breakdown result i only have cost of one module and not show me cost of second module, any please can help me?
message has been deleted
message has been deleted
l
Hi @hallowed-soccer-34663 can you share the exact command you are running please?
h
Yes @little-author-61621
Copy code
infracost breakdown --path .
and I am currently positioned at the HCL file path
l
does the second module have a
provider
block? That’s how we detect that it is a root module
h
Thanks I check it
message has been deleted
@little-author-61621 Yes the second module have a
provider
file
l
👍 so from what I can see this is in the
.infracost
directory. So I’m assuming this is a remote module and infracost has downloaded it right?
h
yes it is right
l
and how is that module being called from your code?
h
Copy code
module "nodepool_app" {
  source                  = "git::<https://------>-/tf_modules/tf_gcp_gke_node_pool.git?ref=1.0.0"
}
l
I wonder if the resources inside that module are detected as having zero cost. I noticed it says “3 were estimated” but only displays the cluster cost, so that suggests it estimated 2 others that have no cost.
h
@little-author-61621 But in site of Google Cloud Pricing Calculator
These resources do have a cost
l
can you run
infracost breakdown --path=. --format=json
so we can see what the raw json result is for them
h
l
Okay, yeah it looks like the
hourlyQuantity
is 0 for those, which means it will have no cost. So I wonder why infracost is detecting those as zero. What do you have set for the
initial_node_count
,
node_count
and
autoscaling
attributes?
h
node_count = 1
and the other values are not present in the module definition
l
Ok thanks, are you able to post the terraform code for the node pool and cluster so we can reproduce it?
Happy to pair on zoom as well if that helps.
h
Hi Alistair
how are you?
@little-author-61621
l
Hi @hallowed-soccer-34663
h
Hi Alistair
thanks for answering me
l
No worries simple smile
h
i need help with a case in Dashboard Infracost
l
Ok
h
I run PoC in my local machine via CLI Command
the comment work fine
but in pull request no show information
message has been deleted
i create a pull request and pass the next flags
to command in CLI
infracost comment gitlab --path=infracost.json --repo=webdoxclm/infra/tg_resources/tg_gcp_cloudstorage --merge-request=5 --gitlab-token="glpat-########" --gitlab-server-url="<https://gitlab.com>" --behavior=update
with the next ENV
INFRACOST_VCS_PROVIDER=gitlab
INFRACOST_VCS_REPOSITORY_URL=<https://gitlab.com/####/####/tg_resources/tg_gcp_cloudstorage>
INFRACOST_VCS_PULL_REQUEST_URL=<https://gitlab.com/######/-/merge_requests/5>
INFRACOST_VCS_PULL_REQUEST_AUTHOR=Felipe Saravia
INFRACOST_VCS_PULL_REQUEST_TITLE=Review case with Infracost Team
INFRACOST_VCS_BRANCH=feature/ST-00
INFRACOST_VCS_COMMIT_SHA=3ce57f339ea28c0b7d8e9ace8167de5e72e2bdb0
INFRACOST_VCS_COMMIT_TIMESTAMP=1671111600
INFRACOST_VCS_COMMIT_AUTHOR_EMAIL=####@#####.com
INFRACOST_VCS_COMMIT_AUTHOR_NAME=####
for what reason the Pull Request not show in Dashboard?
l
@hallowed-soccer-34663 are these env variables set when the
infracost breakdown
or
infracost diff
runs?
h
when
infracost comment
run
l
Can you try adding them when
breakdown
and
diff
run?
h
Done
now in Dashboard show this Badge
but in Pull Request i not see info
l
even if you hard refresh that page?
h
i log out from dashboard, one moment
ok, i login back to dashboard but i not see change
message has been deleted
l
Okay, let me have more of a look…
h
sure, thanks!
l
Ok @hallowed-soccer-34663 we only show the PR when we count the run as “completed”, which happens when you run
infracost comment
. So if you run
infracost comment
again now it should show. We need to put in a fix so that the env vars work properly with just
infracost comment
, but at the moment you need them on the
breakdown
and
diff
commands as well.
h
Ok let me check.
Estimate uploaded to organization 'WebdoxCLM' in Infracost Cloud
Comment posted to GitLab
Great!
l
nice!
h
then the sequence of steps should be
infracost breakdown
infracost diff
infracost comment
?
l
correct
h
and the values for ENV must be set before
right?
l
Yes, but if it’s running in the GitLab pipeline we should be able to pick the PR information up automatically.
h
Thanks, i understand