diff --git a/hive/gateway/ec2.go b/hive/gateway/ec2.go index f8f398780..ba57d96c5 100644 --- a/hive/gateway/ec2.go +++ b/hive/gateway/ec2.go @@ -2,6 +2,7 @@ package gateway import ( "errors" + "strings" "github.com/aws/aws-sdk-go/service/ec2" "github.com/gofiber/fiber/v2" @@ -208,6 +209,12 @@ func (gw *GatewayConfig) EC2_Request(ctx *fiber.Ctx) error { case "ImportKeyPair": var input = &ec2.ImportKeyPairInput{} + + // Bug in parser, end of Base64 is URL encoded + if strings.HasSuffix(queryArgs["PublicKeyMaterial"], "%3D%3D") { + queryArgs["PublicKeyMaterial"] = strings.Replace(queryArgs["PublicKeyMaterial"], "%3D%3D", "==", 1) + } + err = awsec2query.QueryParamsToStruct(queryArgs, input) if err != nil { diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh index 88a631ad4..03b7c5a17 100755 --- a/scripts/start-dev.sh +++ b/scripts/start-dev.sh @@ -241,7 +241,8 @@ echo "๐Ÿ“Š Monitor background service logs:" echo " tail -f $LOGS_DIR/*.log" echo "" echo "๐Ÿงช Test with AWS CLI (once daemon is running):" -echo " aws --endpoint-url https://localhost:9999 --no-verify-ssl ec2 describe-instances" +echo " export AWS_PROFILE=hive" +echo " aws ec2 describe-instances" echo "" # This will only be reached if air/daemon exits normally