Humm, if you can produce the yaml file then everything is possible. A simple example.
indiana@mars:~$ more test.yaml
#cloud-config
users:
- default
- name: foo
gecos: Foo
indiana@mars:~$ lxc launch images:alpine/edge/cloud --config=user.user-data="$(cat test.yaml)"
Creating the instance
Instance name is: inspired-whale
Starting inspired-whale
indiana@mars:~$ lxc exec inspired-whale – getent passwd | grep -i foo
foo:x:1000:1000:Foo:/home/foo:/bin/ash