This message was deleted.
# contributors
b
This message was deleted.
👀 1
l
@stocky-magazine-90066 which resource are you adding the new cost to? The
aws_lambda_function
or the
aws_lambda_provisioned_concurrency_config
?
s
Hi @little-author-61621 I was looking to add
aws_lambda_provisioned_concurrency_config
as a new resource, but the resource needs some information from
aws_lambda_function
which I thought I could do via the reference attributes.
Or maybe I'm actually thinking about this in the wrong way.
With some of the examples I looked at on the pricing page, provisioned concurrency is a separate charge. A common use case looks to be that provisioned concurrency isn't enabled 24 x 7 . So I was going to look at implementing this as a separate resource & provide the concurrency usage separate values. But maybe I was getting to far ahead & I wanted to include somethings from the lambda function. The only thing I actually need at the moment when I'm thinking out loud is the Architecture for the function, as there's a cost difference for ARM v x86. Which as an initial thought could be a usage parameter.
l
yeah, looking at it now it seems like it makes sense to treat it as a separate resource. I think what you might want is this on the
aws_lambda_provisioned_concurrency_config
resource:
Copy code
ReferenceAttributes: []string{"function_name"}
And then this on the
aws_lambda_function
resource so it knows to use
function_name
as an identifer:
Copy code
CustomRefIDFunc: func(d *schema.ResourceData) []string {
  name := d.Get("function_name").String()
  if name != "" {
    return []string{name}
  }

  return nil
}
s
Thanks @little-author-61621 I think initially I was possibly over complicating it. I think I've a clearer path forward for an initial stab.
l
👍 great! lmk if I can help more