aws kms create-key --description 'My application encryption key'
Topics
58
Amazon API Gateway
Amazon Athena
Amazon CloudFront & Content Delivery
Amazon DynamoDB
Amazon ECS (Elastic Container Service)
Amazon EFS (Elastic File System)
Amazon EKS (Elastic Kubernetes Service)
Amazon ElastiCache (Redis & Memcached)
Amazon EventBridge
Amazon Kinesis & Data Streaming
Amazon QuickSight & Business Intelligence
Amazon Redshift & Data Warehousing
Amazon Route 53 & DNS Management
Amazon SageMaker & Machine Learning on AWS
Amazon SNS (Simple Notification Service)
Amazon SQS (Simple Queue Service)
Auto Scaling Groups
AWS AI Services (Rekognition, Polly, Lex & Comprehend)
AWS Backup & Disaster Recovery
AWS Batch
AWS Certificate Manager (ACM)
AWS Certification Paths & Career Roadmap
AWS CLI & SDKs
AWS CloudTrail & Auditing
AWS CodePipeline, CodeBuild & CodeDeploy (CI/CD)
AWS Config
AWS Cost Management & Billing
AWS Database Migration Service & Application Migration
AWS Direct Connect & Hybrid Connectivity
AWS Elastic Beanstalk
AWS Fargate
AWS Free Tier & Account Setup
AWS Global Infrastructure (Regions, AZs & Edge Locations)
AWS Glue & ETL
AWS KMS & Data Encryption
AWS Organizations & Multi Account Strategy
AWS Outposts & Hybrid Cloud
AWS Secrets Manager & Parameter Store
AWS Security Hub & GuardDuty
AWS Serverless Application Model (SAM)
AWS Step Functions
AWS Storage Gateway
AWS Systems Manager
AWS Trusted Advisor
AWS WAF & Shield
Core Services Overview
EC2 & Compute
Elastic Container Registry (ECR)
Elastic Load Balancing (ALB, NLB & CLB)
IaC (CloudFormation)
IAM
Lambda & Serverless
Monitoring (CloudWatch)
RDS & Databases
S3 & Storage
Tagging Strategies & Resource Management
VPC & Networking
Well-Architected Framework
AWS KMS & Data Encryption
7 questions found
AWS Key Management Service, or KMS, is a fully managed service that lets you create and control cryptographic keys used to encrypt data across many AWS services, such as S3, EBS, and RDS, handling the complex work of securely generating, storing, and managing the lifecycle of encryption keys so you can enable encryption throughout your applications without needing to build and operate your own key management infrastructure.
Real-world example
A company enables encryption on its S3 buckets and RDS databases using a KMS managed key, ensuring sensitive customer data is encrypted at rest without needing to build any custom key management system themselves.
S3 & Storage;RDS & Databases
A customer managed key is a KMS key that you create and fully control, including defining its key policy, rotation schedule, and who can use it, while an AWS managed key is automatically created and managed by AWS on your behalf for a specific service, offering less control and customization but requiring no setup effort, meaning customer managed keys are generally chosen when you need fine grained control over exactly who can use a key or need to share it across specific accounts or services.
aws kms create-key --policy file://key-policy.json --description 'Customer managed key for finance data'
Real-world example
A finance department creates its own customer managed KMS key with a strict key policy limiting usage to only specific finance team IAM roles, rather than relying on the default AWS managed key used broadly across the rest of the organization.
IAM;AWS Organizations & Multi Account Strategy
How does envelope encryption work in KMS, and why is it used instead of encrypting large amounts of data directly with a KMS key?
IntermediateEnvelope encryption uses a KMS master key to encrypt a smaller, unique data key, which is then used to actually encrypt your data locally, meaning the potentially large data itself never needs to be sent to KMS for encryption, only the small data key does, significantly improving performance and reducing the number of calls made to KMS compared to encrypting large volumes of data directly through the service itself.
response = kms_client.generate_data_key(KeyId='alias/my-key', KeySpec='AES_256')
plaintext_key = response['Plaintext']
encrypted_key = response['CiphertextBlob']
Real-world example
An application encrypting large video files locally generates a unique data key from KMS for each file, encrypts the file using that data key on the local machine, and stores only the small encrypted version of the data key alongside the file, avoiding the need to send massive file contents through KMS itself.
S3 & Storage;Amazon EFS (Elastic File System)
A key policy is the primary mechanism for controlling access to a KMS key, defining exactly which IAM principals can perform actions such as encrypting, decrypting, or managing the key, and it must explicitly grant access since KMS key policies do not automatically inherit permissions the way some other AWS resources do, while grants provide a more temporary and delegated way to give specific permissions to a principal, often used for short lived or programmatic access scenarios.
aws kms put-key-policy --key-id abc123 --policy-name default --policy file://updated-key-policy.json
Real-world example
A company restricts its most sensitive KMS key's policy to allow decryption only from a specific application's IAM role, ensuring that even administrators with broad account permissions cannot decrypt that particular sensitive data without an explicit, separately granted exception.
IAM;AWS CloudTrail & Auditing
How does automatic key rotation work in KMS, and why is it a recommended security practice?
IntermediateKMS supports automatic annual rotation for customer managed keys, which generates new underlying cryptographic material for the key every year while keeping the same key identifier, meaning existing encrypted data remains fully accessible and no application changes are needed, and this rotation practice reduces the risk associated with a single cryptographic key being used indefinitely, limiting the amount of data that could be exposed if a key were ever somehow compromised.
aws kms enable-key-rotation --key-id abc123
Real-world example
A company enables automatic annual key rotation on all of its customer managed KMS keys as a standard security practice, ensuring cryptographic material is refreshed regularly without requiring any manual intervention or application downtime.
AWS Security Hub & GuardDuty;AWS CloudTrail & Auditing
How can KMS multi region keys support encryption and decryption of the same data across multiple AWS regions without needing to re encrypt data during a cross region transfer?
AdvancedKMS multi region keys let you create a primary key in one region and replicate it as related keys in other regions, sharing the same underlying key material, meaning data encrypted with the primary key in one region can be decrypted directly using the replica key in another region without requiring you to decrypt and re encrypt the data during a cross region migration or in a multi region disaster recovery scenario.
aws kms replicate-key --key-id abc123 --replica-region eu-west-1
Real-world example
A company running a multi region disaster recovery setup uses KMS multi region keys so that encrypted database backups replicated from its primary region to a secondary region can be decrypted immediately during a failover, without any complex re encryption process.
AWS Backup & Disaster Recovery;AWS Global Infrastructure (Regions
AZs & Edge Locations)
How does AWS CloudHSM differ from KMS, and when would an organization need the additional control it provides?
AdvancedAWS CloudHSM provides dedicated, single tenant hardware security modules that give you complete, exclusive control over the cryptographic keys and hardware, meeting certain strict regulatory or compliance requirements that specifically mandate the use of dedicated hardware security modules, whereas KMS uses shared multi tenant hardware managed entirely by AWS, which is sufficient and far simpler for the vast majority of use cases but does not offer the same level of exclusive physical control that some highly regulated industries specifically require.
aws cloudhsmv2 create-cluster --hsm-type hsm1.medium --subnet-ids subnet-12345
Real-world example
A payment processing company operating under strict regulatory requirements that mandate dedicated hardware security modules uses CloudHSM instead of standard KMS, satisfying an auditor's specific requirement for exclusive, non shared cryptographic hardware.
AWS Security Hub & GuardDuty;IAM