def create_tags(ec2_client, ec2_instance_id, event_detail):
    """
    Given an EC2 Instance ID, and event['detail'] from an ECS Container
    Instance State Change, updates EC2 Instance tags with clusterArn &
    containerInstanceArn

    Returns the SDK response to the create_tags call.
    """

    cluster_arn = event_detail["clusterArn"]
    container_instance_arn = event_detail["containerInstanceArn"]

    print(f"Tag {ec2_instance_id} clusterArn: {cluster_arn}")
    print(f"Tag {ec2_instance_id} containerInstanceArn: {container_instance_arn}")

    return ec2_client.create_tags(
        Resources=[ec2_instance_id],
        Tags=[
            {"Key": "clusterArn", "Value": event_detail["clusterArn"]},
            {
                "Key": "containerInstanceArn",
                "Value": event_detail["containerInstanceArn"],
            },
        ],
    )