Channels
  • Mohammad Yosefpor

    Mohammad Yosefpor

    11 months ago
    • In documents (https://www.infracost.io/docs/usage_based_resources#resource-arrays) I've seen notes for resource arrays and modules. My question is does the wildcard method also work with
    for_each
    resources? (it's not clear in docs)
  • Alistair (Infracost)

    Alistair (Infracost)

    11 months ago
    It should work for
    count
    and
    for_each
    . +1 we should clarify this.
  • Mohammad Yosefpor

    Mohammad Yosefpor

    11 months ago
    @Alistair (Infracost) it seems the wildcard char in usage-file is not working with for_each. (tested with
    infracost/example-terraform/sample1
    aws_lambda_function.hello_world

    aws_lambda_function.hello_world["hello"] ├─ Requests 0 1M requests $0.00 └─ Duration 0 GB-seconds $0.00 aws_lambda_function.hello_world["hi"] ├─ Requests 0 1M requests $0.00 └─ Duration 0 GB-seconds $0.00
    Oh sorry my bad it is working ok, but the issue is
    --sync-usage-file
    is destructive when using with wildcards (both for
    for_each
    and
    count
    )
    it deletes all the wildcard
    aws_lambda_function.hello_world[*]
    and replaces them with individual
    aws_lambda_function.hello_world["hi"]
    and
    "hello"
    with default value
    0
    .
  • Alistair (Infracost)

    Alistair (Infracost)

    11 months ago
    hmmm that's an interesting issue. I guess in that case it should recognise the wildcards and not overwrite them.
  • Mohammad Yosefpor

    Mohammad Yosefpor

    11 months ago
    We should also consider this behavior (having both wildcard and resource) in
    --sync-usage-file
    logic