HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3/dist-packages/awscli/examples/kms/import-key-material.rst
**To import key material into a KMS customer master key**

The following ``import-key-material`` example uploads key material into a CMK that was created with no key material. The key state of the CMK must be ``PendingImport``.

This command uses key material that you encrypted with the public key that the ``get-parameters-for-import`` command returned. It also uses the import token from the same ``get-parameters-for-import`` command. 

The ``expiration-model`` parameter indicates that the key material automatically expires on the date and time specified by the ``valid-to`` parameter. When the key material expires, AWS KMS deletes the key material, the key state of the CMK changes to ``Pending import`` and the CMK becomes unusable. To restore the CMK, you must reimport the same key material. To use different key material, you must create a new CMK.

Before running this command, replace the example key ID with a valid key ID or key ARN from your AWS account. ::

    aws kms import-key-material \
        --key-id 1234abcd-12ab-34cd-56ef-1234567890ab \
        --encrypted-key-material fileb://EncryptedKeyMaterial.bin \
        --import-token fileb://ImportToken.bin \
        --expiration-model KEY_MATERIAL_EXPIRES \
        --valid-to 2021-09-21T19:00:00Z

This command produces no output.

For more information about importing key material, see `Importing Key Material <https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html>`__ in the *AWS Key Management Service Developer Guide*.