diff --git a/pkg/provider/aws/action/fedora/fedora.go b/pkg/provider/aws/action/fedora/fedora.go index 5b8cbea1b..b09ac9ab8 100644 --- a/pkg/provider/aws/action/fedora/fedora.go +++ b/pkg/provider/aws/action/fedora/fedora.go @@ -16,6 +16,7 @@ import ( amiSVC "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/ami" "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/keypair" securityGroup "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/security-group" + "github.com/adrianriobo/qenvs/pkg/provider/util/command" "github.com/adrianriobo/qenvs/pkg/provider/util/output" "github.com/adrianriobo/qenvs/pkg/util" resourcesUtil "github.com/adrianriobo/qenvs/pkg/util/resources" @@ -191,7 +192,7 @@ func (r *Request) deploy(ctx *pulumi.Context) error { pulumi.String(amiUserDefault)) ctx.Export(fmt.Sprintf("%s-%s", r.Prefix, outputHost), c.GetHostIP(!r.Airgap)) - return c.Readiness(ctx, r.Prefix, awsFedoraDedicatedID, + return c.Readiness(ctx, command.CommandPing, r.Prefix, awsFedoraDedicatedID, keyResources.PrivateKey, amiUserDefault, bastion, []pulumi.Resource{}) } diff --git a/pkg/provider/aws/action/rhel/rhel.go b/pkg/provider/aws/action/rhel/rhel.go index c4d3093d9..8d498bce9 100644 --- a/pkg/provider/aws/action/rhel/rhel.go +++ b/pkg/provider/aws/action/rhel/rhel.go @@ -18,6 +18,7 @@ import ( amiSVC "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/ami" "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/keypair" securityGroup "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/security-group" + "github.com/adrianriobo/qenvs/pkg/provider/util/command" "github.com/adrianriobo/qenvs/pkg/provider/util/output" "github.com/adrianriobo/qenvs/pkg/util" "github.com/adrianriobo/qenvs/pkg/util/file" @@ -217,7 +218,7 @@ func (r *Request) deploy(ctx *pulumi.Context) error { pulumi.String(amiUserDefault)) ctx.Export(fmt.Sprintf("%s-%s", r.Prefix, outputHost), c.GetHostIP(!r.Airgap)) - return c.Readiness(ctx, r.Prefix, awsRHELDedicatedID, + return c.Readiness(ctx, command.CommandCloudInitWait, r.Prefix, awsRHELDedicatedID, keyResources.PrivateKey, amiUserDefault, bastion, []pulumi.Resource{}) } diff --git a/pkg/provider/aws/action/windows/windows.go b/pkg/provider/aws/action/windows/windows.go index 73cf1f7cb..c1281bb8e 100644 --- a/pkg/provider/aws/action/windows/windows.go +++ b/pkg/provider/aws/action/windows/windows.go @@ -19,6 +19,7 @@ import ( amiSVC "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/ami" "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/keypair" securityGroup "github.com/adrianriobo/qenvs/pkg/provider/aws/services/ec2/security-group" + "github.com/adrianriobo/qenvs/pkg/provider/util/command" "github.com/adrianriobo/qenvs/pkg/provider/util/output" "github.com/adrianriobo/qenvs/pkg/provider/util/security" "github.com/adrianriobo/qenvs/pkg/util" @@ -253,7 +254,7 @@ func (r *Request) deploy(ctx *pulumi.Context) error { password.Result) ctx.Export(fmt.Sprintf("%s-%s", r.Prefix, outputHost), c.GetHostIP(!r.Airgap)) - return c.Readiness(ctx, r.Prefix, awsWindowsDedicatedID, + return c.Readiness(ctx, command.CommandPing, r.Prefix, awsWindowsDedicatedID, keyResources.PrivateKey, r.AMIUser, bastion, []pulumi.Resource{}) } diff --git a/pkg/provider/aws/modules/ec2/compute/compute.go b/pkg/provider/aws/modules/ec2/compute/compute.go index 13fdf31f0..f0ee94c8a 100644 --- a/pkg/provider/aws/modules/ec2/compute/compute.go +++ b/pkg/provider/aws/modules/ec2/compute/compute.go @@ -197,8 +197,9 @@ func (c *Compute) GetHostIP(public bool) (ip pulumi.StringInput) { return c.LB.DnsName } -// Check if compute is healthy (ping on ssh) +// Check if compute is healthy based on running a remote cmd func (compute *Compute) Readiness(ctx *pulumi.Context, + cmd string, prefix, id string, mk *tls.PrivateKey, username string, b *bastion.Bastion, @@ -207,8 +208,8 @@ func (compute *Compute) Readiness(ctx *pulumi.Context, resourcesUtil.GetResourceName(prefix, id, "readiness-cmd"), &remote.CommandArgs{ Connection: remoteCommandArgs(compute, mk, username, b), - Create: pulumi.String(command.CommandPing), - Update: pulumi.String(command.CommandPing), + Create: pulumi.String(cmd), + Update: pulumi.String(cmd), }, pulumi.Timeouts( &pulumi.CustomTimeouts{ Create: command.RemoteTimeout,