We can demonstrate the use of key policies with condition keys as follows:
- Create a key with the default configuration from the console, as follows:
- Provide an Alias and Description on the first screen. I have provided testkey and test key, respectively.
- Optionally, you can add any Tags on the next screen.
- On the next screen, do not add any key administrators.
- Do not add any key users either.
- Review the policy and click Finish:
- You can add this KMS CMK as the encryption key for an S3 bucket in the same region as follows:
- Go to the Properties tab of an S3 bucket.
- Click on Default encryption.
- Select AWS-KMS as the encryption ...