What could be causing these terminations?
The IAM user launching those instances is missing ec2:RunInstances permissions
The AMI used was encrypted and the IAM user does not have the required AWS KMS permissions
The instance profile used with the EC2 instances is unable to query instance metadata
AWS currently does not have sufficient capacity in the Region
Explanations:
If the IAM user lacks the ec2permission, the instances would not launch at all, not terminate immediately after launching.
If the AMI used is encrypted and the IAM user does not have the required AWS KMS permissions, the instance launch will fail, leading to automatic termination of the instances.
The instance profile is related to permissions for actions performed by the instance itself, not for its launch. Issues with querying instance metadata would not cause immediate termination after launch.
While insufficient capacity in the Region can cause instance launch issues, it would typically result in a failure to launch rather than immediate termination of already launched instances.