customer kms key assign to volume

4 views
Skip to first unread message

Jayesh Mahajan

unread,
Apr 21, 2021, 4:24:53 AM4/21/21
to ansible...@googlegroups.com
Dear Tean,

I want to encrypt my EBS volume with KMS for that I used the below task.

- ec2_lc:
name: "{{ childtenantname }}-iqb-{{ ami_name }}-{{ ansible_date_time.epoch }}"
image_id: "{{ ami_facts.images[0].image_id }}"
key_name: "{{ envrn }}-{{ region }}-eks"
security_groups: "{{ envrn }}-iqbot"
instance_type: "{{ instance_type }}"
region: "{{ region }}"
user_data: "{{ lookup('template', './roles/templates/user_data.ps1') }}"
instance_profile_name: "{{ envrn }}-{{ region }}-iqbot-profile"
state: present
instance_monitoring: true
volumes:
- device_name: /dev/sda1
volume_size: 512
volume_type: gp2
delete_on_termination: true
encrypted: true
kms_key_id: "{{ iqbot_ebs_key[\"keys\"][0][\"key_id\"] }}"

 but still, it takes AWS/EBS default key. Can anyone knows how to pass our own encryption key.

Thanks & Regards,

Jayesh D. Mahajan.

ÈMobile: +91 9028602679

* jaymah...@gmail.com
Reply all
Reply to author
Forward
0 new messages