Idempotency in amazon..aws.ec2_instance

Hi

when you run use “ec2” module to create an ec2 instance you can specify an id parameter to provide the client token for idempotency.

I can’t see an equivalent in ec2_instance - there’s instance_ids, but this seems to be used only for filtering (when searching) and doesn’t seem to be used for setting the client token.

Is there a way to set the client token / run instance idempotency for a new instance?

thanks!

FYI My tests seem to indicate that using the instance_ids parameter with a single id something like this will set it correctly:

  • name: start an ec2 instance with a specific client token / instance idempotency id
    community.aws.ec2_instance:
    instance_ids: “public-compute-instance-20210610-1922”

name: “public-compute-instance”
key_name: “prod-ssh-key”
vpc_subnet_id: subnet-5ca1ab1e
instance_type: c5.large
security_group: default
network:
assign_public_ip: true
image_id: ami-123456