Skip to content

Commit

Permalink
🧹 update tests for aws ec2 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Oct 4, 2023
1 parent bb8c4dd commit 04de2ce
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 29 deletions.
3 changes: 2 additions & 1 deletion providers/os/connection/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (c *Connection) RunCommand(command string) (*shared.Command, error) {
found, ok := c.data.Commands[command]
if !ok {
// try to fetch command by hash (more reliable for whitespace)
found, ok = c.data.Commands[hashCmd(command)]
hash := hashCmd(command)
found, ok = c.data.Commands[hash]
}
if !ok {
c.missing["command"][command] = true
Expand Down
8 changes: 5 additions & 3 deletions providers/os/id/aws/testdata/instance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
gid = 0
size = 0

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -43,6 +46,5 @@ stdout = """
}
"""


[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = "ec2-name"
7 changes: 5 additions & 2 deletions providers/os/id/aws/testdata/instancearm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
gid = 0
size = 0

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -55,5 +58,5 @@ stdout = """
}
"""

[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = "ec2-name"
5 changes: 4 additions & 1 deletion providers/os/id/aws/testdata/notinstance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"
gid = 0
size = 0

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand Down
47 changes: 37 additions & 10 deletions providers/os/id/awsec2/metadata_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

const (
identityUrl = `-H "X-aws-ec2-metadata-token: %s" -v http://169.254.169.254/latest/dynamic/instance-identity/document`
tokenUrl = `-X PUT "http://169.254.169.254/latest/api/token"`
tokenUrl = `-H "X-aws-ec2-metadata-token-ttl-seconds: 21600" -X PUT "http://169.254.169.254/latest/api/token"`
tagNameUrl = `-H "X-aws-ec2-metadata-token: %s" -v http://169.254.169.254/latest/meta-data/tags/instance/Name`

identityUrlWindows = `
Expand All @@ -37,6 +37,12 @@ $Headers = @{
"X-aws-ec2-metadata-token-ttl-seconds" = "21600"
}
Invoke-RestMethod -Method Put -Uri "http://169.254.169.254/latest/api/token" -Headers $Headers -TimeoutSec 1 -UseBasicParsing
`
tagNameUrlWindows = `
$Headers = @{
"X-aws-ec2-metadata-token" = %s
}
Invoke-RestMethod -Method Put -Uri "http://169.254.169.254/latest/meta-data/tags/instance/Name" -Headers $Headers -TimeoutSec 1 -UseBasicParsing
`
)

Expand Down Expand Up @@ -96,10 +102,17 @@ func (m *CommandInstanceMetadata) Identify() (Identity, error) {
}, nil
}

func (m *CommandInstanceMetadata) curlDocument(url string, tokenUrl string) (string, error) {
type metadataType int

const (
document metadataType = iota
instanceNameTag
)

func (m *CommandInstanceMetadata) curlDocument(metadataType metadataType) (string, error) {
switch {
case m.platform.IsFamily(inventory.FAMILY_UNIX):
cmd, err := m.conn.RunCommand("curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" " + tokenUrl)
cmd, err := m.conn.RunCommand("curl " + tokenUrl)
if err != nil {
return "", err
}
Expand All @@ -109,7 +122,15 @@ func (m *CommandInstanceMetadata) curlDocument(url string, tokenUrl string) (str
}
tokenString := strings.TrimSpace(string(data))

cmd, err = m.conn.RunCommand("curl " + fmt.Sprintf(identityUrl, tokenString))
commandScript := ""
switch metadataType {
case document:
commandScript = "curl " + fmt.Sprintf(identityUrl, tokenString)
case instanceNameTag:
commandScript = "curl " + fmt.Sprintf(tagNameUrl, tokenString)
}

cmd, err = m.conn.RunCommand(commandScript)
if err != nil {
return "", err
}
Expand All @@ -120,8 +141,7 @@ func (m *CommandInstanceMetadata) curlDocument(url string, tokenUrl string) (str

return strings.TrimSpace(string(data)), nil
case m.platform.IsFamily(inventory.FAMILY_WINDOWS):

tokenPwshEncoded := powershell.Encode(fmt.Sprintf(tokenUrlWindows, tokenUrl))
tokenPwshEncoded := powershell.Encode(tokenUrlWindows)
cmd, err := m.conn.RunCommand(tokenPwshEncoded)
if err != nil {
return "", err
Expand All @@ -132,8 +152,15 @@ func (m *CommandInstanceMetadata) curlDocument(url string, tokenUrl string) (str
}
tokenString := strings.TrimSpace(string(data))

curlPwshEncoded := powershell.Encode(fmt.Sprintf(identityUrlWindows, tokenString))
cmd, err = m.conn.RunCommand(curlPwshEncoded)
commandScript := ""
switch metadataType {
case document:
commandScript = powershell.Encode(fmt.Sprintf(identityUrlWindows, tokenString))
case instanceNameTag:
commandScript = powershell.Encode(fmt.Sprintf(tagNameUrlWindows, tokenString))
}

cmd, err = m.conn.RunCommand(commandScript)
if err != nil {
return "", err
}
Expand All @@ -149,7 +176,7 @@ func (m *CommandInstanceMetadata) curlDocument(url string, tokenUrl string) (str
}

func (m *CommandInstanceMetadata) instanceNameTag() (string, error) {
res, err := m.curlDocument(tagNameUrl, tokenUrl)
res, err := m.curlDocument(instanceNameTag)
if err != nil {
return "", err
}
Expand All @@ -160,5 +187,5 @@ func (m *CommandInstanceMetadata) instanceNameTag() (string, error) {
}

func (m *CommandInstanceMetadata) instanceIdentityDocument() (string, error) {
return m.curlDocument(identityUrl, tokenUrl)
return m.curlDocument(document)
}
14 changes: 14 additions & 0 deletions providers/os/id/awsec2/metadata_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ func TestEC2RoleProviderInstanceIdentityLocal(t *testing.T) {
cfg := fakeConfig()
cfg.HTTPClient = smithyhttp.ClientDoFunc(func(r *http.Request) (*http.Response, error) {
url := r.URL.String()
if strings.Contains(url, "latest/api/token") {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: io.NopCloser(bytes.NewBufferString("mock-token")),
}, nil
}
if strings.Contains(url, "tags/instance/Name") {
return &http.Response{
StatusCode: 200,
Expand Down Expand Up @@ -75,6 +82,13 @@ func TestEC2RoleProviderInstanceIdentityLocalDisabledTagsService(t *testing.T) {
cfg := fakeConfig()
cfg.HTTPClient = smithyhttp.ClientDoFunc(func(r *http.Request) (*http.Response, error) {
url := r.URL.String()
if strings.Contains(url, "latest/api/token") {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: io.NopCloser(bytes.NewBufferString("mock-token")),
}, nil
}
if strings.Contains(url, "tags/instance/Name") {
return &http.Response{
StatusCode: 404,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ stdout = "4.9.125-linuxkit"
[files."/etc/redhat-release"]
content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -31,5 +34,5 @@ stdout = """
}
"""

[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = "ec2-name"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ stdout = "4.9.125-linuxkit"
[files."/etc/redhat-release"]
content = "Red Hat Enterprise Linux Server release 7.2 (Maipo)"

[commands."curl http://169.254.169.254/latest/dynamic/instance-identity/document"]
[commands."curl -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\" -X PUT \"http://169.254.169.254/latest/api/token\""]
stdout = "MYTOKEN"

[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/dynamic/instance-identity/document"]
stdout = """
{
"devpayProductCodes" : null,
Expand All @@ -31,7 +34,7 @@ stdout = """
}
"""

[commands."curl http://169.254.169.254/latest/meta-data/tags/instance/Name"]
[commands."curl -H \"X-aws-ec2-metadata-token: MYTOKEN\" -v http://169.254.169.254/latest/meta-data/tags/instance/Name"]
stdout = """
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[commands]
[commands.91c156428b424f02b6d9b55114d3c59363d93e949562699f15fd09a244018994]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"
[commands.e56abebcba6dd24f679c4735d8528f601cbaaa8ce87d252864eb3dc20b37c2ab]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuAC0AdAB0AGwALQBzAGUAYwBvAG4AZABzACIAIAA9ACAAIgAyADEANgAwADAAIgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBhAHAAaQAvAHQAbwBrAGUAbgAiACAALQBIAGUAYQBkAGUAcgBzACAAJABIAGUAYQBkAGUAcgBzACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBzAGUAQgBhAHMAaQBjAFAAYQByAHMAaQBuAGcACgA="
stdout = "MYTOKEN"
[commands.6d04327ce300f1710513ea721bedbcc6f69ca633530aa1413d89e729bebabde9]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAACgB9AAoASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0ASABlAGEAZABlAHIAcwAgACQASABlAGEAZABlAHIAcwAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4ACgA="
stdout = "{\r\n \"accountId\": \"123456789012\",\r\n \"architecture\": \"x86_64\",\r\n \"availabilityZone\": \"us-east-1d\",\r\n \"billingProducts\": [\r\n \"bp-6ba54002\"\r\n ],\r\n \"devpayProductCodes\": null,\r\n \"marketplaceProductCodes\": null,\r\n \"imageId\": \"ami-0b17e49efb8d755c3\",\r\n \"instanceId\": \"i-1234567890abcdef0\",\r\n \"instanceType\": \"t2.micro\",\r\n \"kernelId\": null,\r\n \"pendingTime\": \"2021-11-17T15:26:40Z\",\r\n \"privateIp\": \"172.31.25.200\",\r\n \"ramdiskId\": null,\r\n \"region\": \"us-east-1\",\r\n \"version\": \"2017-09-30\"\r\n}\r\n"
stderr = ""
exit_status = 0
[commands.fb0f5ced4f556de99f237ea35a78ba4ddd5fc4e149589805d95cbf44f5ccc7aa]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"
[commands.22c5978cf5e5d4bea90d4ee9887a992a7ad26ab93f39ddb241584c18a55f641b]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAATQBZAFQATwBLAEUATgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACIAIAAtAEgAZQBhAGQAZQByAHMAIAAkAEgAZQBhAGQAZQByAHMAIAAtAFQAaQBtAGUAbwB1AHQAUwBlAGMAIAAxACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAKAA=="
stdout = "ec2-name-windows"
stderr = ""
exit_status = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
[commands]
[commands.91c156428b424f02b6d9b55114d3c59363d93e949562699f15fd09a244018994]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"
[commands.e56abebcba6dd24f679c4735d8528f601cbaaa8ce87d252864eb3dc20b37c2ab]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuAC0AdAB0AGwALQBzAGUAYwBvAG4AZABzACIAIAA9ACAAIgAyADEANgAwADAAIgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBhAHAAaQAvAHQAbwBrAGUAbgAiACAALQBIAGUAYQBkAGUAcgBzACAAJABIAGUAYQBkAGUAcgBzACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBzAGUAQgBhAHMAaQBjAFAAYQByAHMAaQBuAGcACgA="
stdout = "MYTOKEN"
[commands.6d04327ce300f1710513ea721bedbcc6f69ca633530aa1413d89e729bebabde9]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAACgB9AAoASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0ASABlAGEAZABlAHIAcwAgACQASABlAGEAZABlAHIAcwAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBkAHkAbgBhAG0AaQBjAC8AaQBuAHMAdABhAG4AYwBlAC0AaQBkAGUAbgB0AGkAdAB5AC8AZABvAGMAdQBtAGUAbgB0ACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4ACgA="
stdout = "{\r\n \"accountId\": \"123456789012\",\r\n \"architecture\": \"x86_64\",\r\n \"availabilityZone\": \"us-east-1d\",\r\n \"billingProducts\": [\r\n \"bp-6ba54002\"\r\n ],\r\n \"devpayProductCodes\": null,\r\n \"marketplaceProductCodes\": null,\r\n \"imageId\": \"ami-0b17e49efb8d755c3\",\r\n \"instanceId\": \"i-1234567890abcdef0\",\r\n \"instanceType\": \"t2.micro\",\r\n \"kernelId\": null,\r\n \"pendingTime\": \"2021-11-17T15:26:40Z\",\r\n \"privateIp\": \"172.31.25.200\",\r\n \"ramdiskId\": null,\r\n \"region\": \"us-east-1\",\r\n \"version\": \"2017-09-30\"\r\n}\r\n"
stderr = ""
exit_status = 0
[commands.fb0f5ced4f556de99f237ea35a78ba4ddd5fc4e149589805d95cbf44f5ccc7aa]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsASQBuAHYAbwBrAGUALQBSAGUAcwB0AE0AZQB0AGgAbwBkACAALQBUAGkAbQBlAG8AdQB0AFMAZQBjACAAMQAgAC0AVQBSAEkAIABoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4A"

[commands.22c5978cf5e5d4bea90d4ee9887a992a7ad26ab93f39ddb241584c18a55f641b]
command = "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAEgAZQBhAGQAZQByAHMAIAA9ACAAQAB7AAoAIAAgACAAIAAiAFgALQBhAHcAcwAtAGUAYwAyAC0AbQBlAHQAYQBkAGEAdABhAC0AdABvAGsAZQBuACIAIAA9ACAATQBZAFQATwBLAEUATgAKAH0ACgBJAG4AdgBvAGsAZQAtAFIAZQBzAHQATQBlAHQAaABvAGQAIAAtAE0AZQB0AGgAbwBkACAAUAB1AHQAIAAtAFUAcgBpACAAIgBoAHQAdABwADoALwAvADEANgA5AC4AMgA1ADQALgAxADYAOQAuADIANQA0AC8AbABhAHQAZQBzAHQALwBtAGUAdABhAC0AZABhAHQAYQAvAHQAYQBnAHMALwBpAG4AcwB0AGEAbgBjAGUALwBOAGEAbQBlACIAIAAtAEgAZQBhAGQAZQByAHMAIAAkAEgAZQBhAGQAZQByAHMAIAAtAFQAaQBtAGUAbwB1AHQAUwBlAGMAIAAxACAALQBVAHMAZQBCAGEAcwBpAGMAUABhAHIAcwBpAG4AZwAKAA=="
stdout = """
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Expand Down

0 comments on commit 04de2ce

Please sign in to comment.