Error is:
Error: Unsupported argument
│
│ on eks.tf line 71, in module “eks”:
│ 71: kms_key_arn = “aws_kms_key.eks_kms_key.arn”
│
│ An argument named “kms_key_arn” is not expected here.
The error isn’t referencing the provider, but rather the "eks" module block which isn’t expecting a kms_key_arn argument.
Note also that you are assigning the string literal "aws_kms_key.eks_kms_key.arn" to that input variable, when in all likelihood you should be using a reference to aws_kms_key.eks_kms_key.arn without the quotes.
Thanks. You are right. I was wondering if it’s complaining about kms_key_arn or the assigned value. so I put the double quotes and result did not change.
So even this is failing: kms_key_arn = aws_kms_key.eks_kms_key.arn
I don’t claim to have specific expertise of AWS but, for what it’s worth, kms_key_arn is an output only of this module. Regardless of what value you assign to it, it’s not a recognised input.
create_kms_key is an input and this is set to “true” as default which appears to create a KMS key for cluster encryption through calling a kms module from within this eks module.
In the kms module, there is a key_arn output that is mapped to the value of aws_kms_key.arn so I think this relationship that you are attempting to set explicitly here (unless I have misinterpreted) is already handled intrinsically, within the eks module and its kms dependency.