Hi Team , I am deploying EC2 machine using golang ...
# golang
l
Hi Team , I am deploying EC2 machine using golang api. After provisioning we would like to confirm if the machine is fully provisioned before deploying other services. Is there a way to check using pulumi automation api to confirm that machine is fully provisioned?
b
I’m not sure what fully provisioned here means, but my guess is that your best hope is to use the
Command
module with the
remote
command to verify this.
l
Thanks @bored-table-20691, What I meant with provisioned the machine is ready for ssh connection . I am looking to deploy docker compose file after creating the ec2 machine and I guess we need to ssh . Can command module confirm if the machine is ready for ssh connection ?
Also one more question please . I have a following docker-compose file which i would like to deploying using Pulumi, is this possible ? on the newly created ec2 machine with pulumi
Copy code
mssql:
    image: '<http://mcr.microsoft.com/mssql/server|mcr.microsoft.com/mssql/server>'
    ports:
        - '1433:1433'
    environment:
        - ACCEPT_EULA=Y
        - SA_PASSWORD=Secret1234
    volumes:
        - './drive:/var/opt/mssql'
a
This might be a great task to use cloud-init aka userdata for. TLDR all the ssh commands you want to do you provide in a "script" for the machine to run at boot. You could hydrate the secret at deploy time by having cloudinit perform a shell command to fetch secret from aws Secret Manager or Parameter Store. I did this at previous gig and it was super reliable.
l
@astonishing-solstice-53645 Thanks for the suggestion , Is there s a example in golang I can follow as starting point
a
https://yetiops.net/posts/pulumi-iac-terraform/#pulumi-using-go This came up on a quick search. I skimmed it and a follow up post about other cloud providers but looks good. Also cloudinit.readthedocs.io is invaluable.
q
You can also use the Pulumi provider for this, but I only have TS examples
l
Thanks @quiet-wolf-18467, If you can share the TS example please , i will try to see how can I convert to go code
l
🙏