Below is my VPC, security group and KMS setting, I encounter the error:
Terraform script has failed because of: Error: data.aws_kms_key.by_key_arn: : invalid or unknown key: kms_key_id,
I was given one KMS_key_id, so how to define the kms_key_id? should I use "data "aws_kms_key" "by_key_arn"?
is this a valid root key for my aws_vpc? eu-west-1 is my region,22***** is my aws account, 5367*-***** is my key id
data "aws_vpc" "vpc" {
tags = {
Name = "my_vpc"
}
}
resource "aws_security_group" "a" {
name = "a"
vpc_id = "${data.aws_vpc.vpc.id}"
}
data "aws_kms_key" "by_key_arn" {
kms_key_id = "arn:aws:kms:eu-west-1:22******:key/5367*-****-****-****-********"
}