You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command runs successfully and it does provide me with the cost, however I get a warning:
+ infracost breakdown --path .
2024-04-08T18:35:56-04:00 INF Evaluating Terraform directory at .
2024-04-08T18:35:56-04:00 INF Starting: Downloading Terraform modules
2024-04-08T18:35:56-04:00 INF Starting: Evaluating Terraform directory
2024-04-08T18:35:56-04:00 WRN Input values were not provided for following Terraform variables: "variable.required_aws_tags", "variable.eks_vpc_id", "variable.eks_vpc_private_subnet_ids", "variable.aws_region", "variable.rancher_eks_user_cloud_credential_names", "variable.eks_devopstools_cluster_name". Use --terraform-var-file or --terraform-var to specify them.
2024-04-08T18:35:57-04:00 INF Starting: Retrieving usage defaults for 5 resources from Infracost Cloud
2024-04-08T18:35:57-04:00 INF Starting: Retrieving cloud prices to calculate costs
For some reason it looks like it's not fetching the variables I've defined on my Terraform Enterprise Workspace. Even though I specified all the necessary variables:
In fact, I was able to make it work while writing this. I was missing the INFRACOST_TERRAFORM_CLOUD_ORG environment variable. However, the documentation mentions the following:
So I believe this is a bit misleading and should be corrected. Because my cloud block is valid (I was able to run a terraform init and terraform plan successfully right before running the infracost stage), that's why I hadn't set that environment variable in the first place.
The infracost utility was probably not able to parse the organization from my cloud block in versions.tf. The problem may be that in my cloud block I have this:
Meaning, I don't set the workspace in there. Whenever I run an init/plan, the workspace is retrieved from the TF_WORKSPACE variable instead. So maybe infracost deemed my cloud block invalid because it's "imcomplete". But it's still a valid cloud block nonetheless.
The text was updated successfully, but these errors were encountered:
Description
Hello!
I'm trying to do a simple run of infracost from my Jenkins declarative pipeline. This is the stage I have for infracost:
The command runs successfully and it does provide me with the cost, however I get a warning:
For some reason it looks like it's not fetching the variables I've defined on my Terraform Enterprise Workspace. Even though I specified all the necessary variables:
env.INFRACOST_TERRAFORM_CLOUD_HOST = "terra.tmx.cloud"
env.INFRACOST_TERRAFORM_CLOUD_WORKSPACE = env.TF_WORKSPACE
Solution
In fact, I was able to make it work while writing this. I was missing the
INFRACOST_TERRAFORM_CLOUD_ORG
environment variable. However, the documentation mentions the following:So I believe this is a bit misleading and should be corrected. Because my
cloud
block is valid (I was able to run aterraform init
andterraform plan
successfully right before running the infracost stage), that's why I hadn't set that environment variable in the first place.The infracost utility was probably not able to parse the organization from my
cloud
block inversions.tf
. The problem may be that in mycloud
block I have this:Meaning, I don't set the workspace in there. Whenever I run an init/plan, the workspace is retrieved from the TF_WORKSPACE variable instead. So maybe infracost deemed my cloud block invalid because it's "imcomplete". But it's still a valid
cloud
block nonetheless.The text was updated successfully, but these errors were encountered: