'multiple google_kms_crypto_key within a one key_ring

I am very new to terraform and trying to learn some of the GCP resources. I am sourcing the value from the JSON file. I have split the creation of the key ring and crypto keys in separate key pair values.I can not create the multiple crypto_key until give complete given resource id of the key ring. I understand from the resource that "google_kms_key_ring.keyring.id" build the correct REST format but I do not understand how to use this with for loop.

{
    "kms_test": {
        "keyring-01": {
            "location": "us-central1"
        },
        "keyring-02": {
            "location": "us-central1"
        }
    }
}
{
    "kms_crypto": {
        "keys01": {
            "keyring": "projects/project01/locations/us-central1/keyRings/keyring-01"
        },
        "keys02": {
            "keyring": "projects/project01/locations/us-central1/keyRings/keyring-02"
        }
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source