- Newest
- Most votes
- Most comments
Based on the information available, RHEL 9.6 is not explicitly listed among the supported Linux distributions for seamless domain join to AWS Directory Service. However, RHEL 8 is supported, which suggests that newer versions might work with similar approaches.
For automating domain join for multiple EC2 instances using a custom RHEL 9.6 AMI, you have several options:
- Seamless Domain Join:
- Ensure your custom AMI has AWS Systems Manager (SSM Agent) version 2.3.1644.0 or higher installed
- Create an AWS Secrets Manager secret to store your domain service account credentials
- Create a custom IAM policy that allows read-only access to this secret
- Create an IAM role (e.g., LinuxEC2DomainJoin) with this policy attached
- When launching your instances, assign this IAM role and select the domain from the Domain join directory dropdown
- Event-driven Automation:
- Use Amazon EventBridge to trigger domain join automatically
- Set up either tag-based triggering (using EC2 tags like "StartEvent:Join") or
- Configure Auto Scaling lifecycle hooks if you're using Auto Scaling groups
- These events can trigger AWS Systems Manager Automation runbooks to handle the domain join process
- Manual Domain Join Script in AMI:
- Install required packages in your AMI (realmd, sssd, krb5-workstation, adcli, samba-common)
- Create a script that uses the
realm joincommand to join the domain - Configure the script to run on instance launch (e.g., via user data or cloud-init)
Note that when the domain join occurs, the SSM Agent will change the hostname of your Linux instances to the format EC2AMAZ-XXXXXXX.
If you're using Auto Scaling for your 30 instances, the lifecycle hook approach would be most efficient, as it automatically handles both joining instances when they launch and removing them from the domain when they terminate.
Sources
Seamlessly joining an Amazon EC2 Linux instance to a shared AWS Managed Microsoft AD - AWS Directory Service
Seamlessly joining an Amazon EC2 Linux instance to your AWS Managed Microsoft AD Active Directory - AWS Directory Service
Manually join an Amazon EC2 Linux instance to your Simple AD Active Directory - AWS Directory Service
Event-driven Active Directory domain join with Amazon EventBridge | Microsoft Workloads on AWS
Seamlessly join an Amazon EC2 Linux instance to your Simple AD Active Directory - AWS Directory Service
You can additionally perform domain join as part of userdata. You can either the paste the script directly on userdata or save it in S3 and download using userdata. Note, you will need to configure IAM policy to get to S3.
Relevant content
asked 9 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
