Skip to content

Commit

Permalink
Implement 'aws_ssm' connection type #26
Browse files Browse the repository at this point in the history
dominik-przybyl-wttech committed Jan 25, 2024
1 parent c5ea9a4 commit 8669a9f
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/client/connection_aws_ssm.go
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@ func (a *AWSSSMConnection) Info() string {
}

func (a *AWSSSMConnection) User() string {
return "root"
out, _ := a.Command([]string{"whoami"})
return strings.TrimSpace(string(out))
}

func (a *AWSSSMConnection) Connect() error {
@@ -108,7 +109,6 @@ func (a *AWSSSMConnection) CopyFile(localPath string, remotePath string) error {
encodedContent := base64.StdEncoding.EncodeToString(fileContent)

cmd := fmt.Sprintf("echo -n %s | base64 -d > %s", encodedContent, remotePath)
cmdLine := []string{"sh", "-c", "\"" + cmd + "\""}
_, err = a.Command(cmdLine)
_, err = a.Command([]string{cmd})
return err
}
2 changes: 1 addition & 1 deletion internal/provider/instance_client.go
Original file line number Diff line number Diff line change
@@ -220,7 +220,7 @@ func (ic *InstanceClient) ReadStatus() (InstanceStatus, error) {

func (ic *InstanceClient) bootstrap() error {
return ic.doActionOnce("bootstrap", ic.cl.WorkDir, func() error {
return ic.runScript("bootstrap", ic.data.System.Bootstrap, ic.cl.WorkDir)
return ic.runScript("bootstrap", ic.data.System.Bootstrap, ".")
})
}

0 comments on commit 8669a9f

Please sign in to comment.