https://infracost.io logo
#general
Title
# general
h

hallowed-soccer-34663

11/22/2022, 2:24 PM
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

little-author-61621

11/22/2022, 2:30 PM
Hi @hallowed-soccer-34663 can you share the exact command you are running please?
h

hallowed-soccer-34663

11/22/2022, 2:30 PM
Yes @little-author-61621
Copy code
infracost breakdown --path .
and I am currently positioned at the HCL file path
l

little-author-61621

11/22/2022, 2:59 PM
does the second module have a
provider
block? That’s how we detect that it is a root module
h

hallowed-soccer-34663

11/22/2022, 3:06 PM
Thanks I check it
message has been deleted
@little-author-61621 Yes the second module have a
provider
file
l

little-author-61621

11/22/2022, 3:37 PM
👍 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

hallowed-soccer-34663

11/22/2022, 3:39 PM
yes it is right
l

little-author-61621

11/22/2022, 3:51 PM
and how is that module being called from your code?
h

hallowed-soccer-34663

11/22/2022, 3:52 PM
Copy code
module "nodepool_app" {
  source                  = "git::<https://------>-/tf_modules/tf_gcp_gke_node_pool.git?ref=1.0.0"
}
l

little-author-61621

11/22/2022, 3:55 PM
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

hallowed-soccer-34663

11/22/2022, 4:50 PM
@little-author-61621 But in site of Google Cloud Pricing Calculator
These resources do have a cost
l

little-author-61621

11/22/2022, 5:00 PM
can you run
infracost breakdown --path=. --format=json
so we can see what the raw json result is for them
h

hallowed-soccer-34663

11/22/2022, 5:04 PM
l

little-author-61621

11/22/2022, 5:10 PM
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

hallowed-soccer-34663

11/22/2022, 7:16 PM
node_count = 1
and the other values are not present in the module definition
l

little-author-61621

11/22/2022, 8:16 PM
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

hallowed-soccer-34663

12/15/2022, 1:52 PM
Hi Alistair
how are you?
@little-author-61621
l

little-author-61621

12/15/2022, 2:25 PM
Hi @hallowed-soccer-34663
h

hallowed-soccer-34663

12/15/2022, 2:26 PM
Hi Alistair
thanks for answering me
l

little-author-61621

12/15/2022, 2:27 PM
No worries simple smile
h

hallowed-soccer-34663

12/15/2022, 2:27 PM
i need help with a case in Dashboard Infracost
l

little-author-61621

12/15/2022, 2:28 PM
Ok
h

hallowed-soccer-34663

12/15/2022, 2:28 PM
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

little-author-61621

12/15/2022, 2:46 PM
@hallowed-soccer-34663 are these env variables set when the
infracost breakdown
or
infracost diff
runs?
h

hallowed-soccer-34663

12/15/2022, 2:57 PM
when
infracost comment
run
l

little-author-61621

12/15/2022, 2:59 PM
Can you try adding them when
breakdown
and
diff
run?
h

hallowed-soccer-34663

12/15/2022, 3:02 PM
Done
now in Dashboard show this Badge
but in Pull Request i not see info
l

little-author-61621

12/15/2022, 3:05 PM
even if you hard refresh that page?
h

hallowed-soccer-34663

12/15/2022, 3:05 PM
i log out from dashboard, one moment
ok, i login back to dashboard but i not see change
message has been deleted
l

little-author-61621

12/15/2022, 3:13 PM
Okay, let me have more of a look…
h

hallowed-soccer-34663

12/15/2022, 3:14 PM
sure, thanks!
l

little-author-61621

12/15/2022, 3:26 PM
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

hallowed-soccer-34663

12/15/2022, 3:28 PM
Ok let me check.
Estimate uploaded to organization 'WebdoxCLM' in Infracost Cloud
Comment posted to GitLab
Great!
l

little-author-61621

12/15/2022, 3:31 PM
nice!
h

hallowed-soccer-34663

12/15/2022, 3:32 PM
then the sequence of steps should be
infracost breakdown
infracost diff
infracost comment
?
l

little-author-61621

12/15/2022, 3:34 PM
correct
h

hallowed-soccer-34663

12/15/2022, 4:15 PM
and the values for ENV must be set before
right?
l

little-author-61621

12/15/2022, 4:30 PM
Yes, but if it’s running in the GitLab pipeline we should be able to pick the PR information up automatically.
h

hallowed-soccer-34663

12/15/2022, 4:32 PM
Thanks, i understand