pokepay / aws-sdk-lisp Goto Github PK
View Code? Open in Web Editor NEWAWS-SDK for Common Lisp
AWS-SDK for Common Lisp
I'm trying to regenerate all AWS SDK services with lake:
CL-USER> (swank:set-default-directory "/usr/home/duncan/code/aws-sdk-lisp/")
"/usr/home/duncan/code/aws-sdk-lisp/"
CL-USER> (ql:quickload "lake")
To load "lake":
Load 1 ASDF system:
lake
; Loading "lake"
("lake")
CL-USER> (lake:lake)
This runs the default task, but that immediately produces the following error:
System "aws-sdk/generator" not found
[Condition of type QUICKLISP-CLIENT:SYSTEM-NOT-FOUND]
Must I install the lake binary using Roswell and regenerate services that way? Or is there a way of making this work from the REPL that I don't know?
This call fails with an error saying that the signature provided in the Authorization header didn't match the signature Amazon computed:
(aws-sdk/services/cloudformation:list-stacks
:stack-status-filter '("UPDATE_COMPLETE" "UPDATE_IN_PROGRESS"
"UPDATE_COMPLETE_CLEANUP_IN_PROGRESS" "UPDATE_ROLLBACK_COMPLETE"
"UPDATE_ROLLBACK_IN_PROGRESS" "UPDATE_ROLLBACK_FAILED"
"UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS" "CREATE_FAILED"
"CREATE_COMPLETE" "CREATE_IN_PROGRESS"))
I think this PR fixes it upstream: rotatef/aws-sign4#6, I'm just reporting this here in case that PR doesn't get merged.
It mistakenly passes a cons
instead of an alist
for a parameter.
(common-lisp:defun list-buckets ()
(aws-sdk/generator/operation::parse-response
(aws-sdk/api:aws-request :service "s3" :method :get :params
(common-lisp:cons "Action" "ListBuckets"))
"ListBucketsOutput" common-lisp:nil))
This
(common-lisp:cons "Action" "ListBuckets")
should be
(common-lisp:list (common-lisp:cons "Action" "ListBuckets"))
This is what hits me first when I try to use aws/lambda
, the problem is probably present for other related functions too.
According to https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html, CreateFunction
should not use any URI parameters, and all data should be JSON-encoded in HTTP payload. However, aws-sdk-lisp
put everything in URI parameters. This generates a 414 URI too large error when submitting a ZipFile
with size in the MBs, and will probably not function even if the ZipFile is small enough.
Calling
(aws/ssm:get-parameter
:name "FOO"
:with-decryption t)
results in
The value of QURI.ENCODE::VALUE is T, which is not of type (OR
STRING
NUMBER
(SIMPLE-ARRAY
(UNSIGNED-BYTE
8)
(*))).
If I pass a non-boolean values, such as "1", I get an error that I'm not passing a boolean.
Please add support of AWS Bedrock and other related APIs.
I'm trying to specify the profile in my ~/.aws/credentials
file that I'd like to use, but it seems to be ignored in favour of default.
Am I doing this the wrong way, or is this unsupported?
CL-USER> (ql:quickload :ironclad)
(:IRONCLAD)
CL-USER> (ql:quickload :aws-sdk)
(:AWS-SDK)
CL-USER> (setq aws-sdk:*aws-profile* "foo")
"foo"
CL-USER> (ql:quickload :aws-sdk/services/s3)
(:AWS-SDK/SERVICES/S3)
Profile 'default' doesn't exist in '~/.aws/credentials'.
[Condition of type SIMPLE-ERROR]
CL-USER> aws-sdk:*aws-profile*
"foo"
The profile definitely exists:
[foo]
aws_access_key_id = REDACTED
aws_secret_access_key = REDACTED
region = ap-southeast-2
I get this error in Windows 10:
Could not parse character 11 of "[default]^M
which makes me think aws-sdk-lisp
is trying to read something from my credentials file and failing.
Add the ability to use S3 service with other S3 providers (Wasabi, Storj, Minio etc) .
Probably need to add endpoint
option to make-session
function.
Examples:
Hi, XMLS:PARSE
now produces structures instead of lists. So, all the AWS calls fail. It's possible to fix this by replacing XMLS:PARSE
with XMLS:PARSE-TO-LIST
in operation.lisp. However, it might make more sense to rewrite the relevant parts to use the new api?
Because DEX:REQUEST
defaults to keep-alive t, this call can leak sockets. This has caused issues with a long-running process eventually running out of file descriptors.
Consider the following request:
(aws/ec2:describe-instances :filters (list (aws/ec2:make-filter :name "filter-1"
:values (list "val-1" "val-2"))
(aws/ec2:make-filter :name "filter-2"
:values (list "val-3"))))
An error occurs:
;; sbcl
The value of QURI.ENCODE::VALUE is #S(AWS-SDK/SERVICES/EC2/API:FILTER
:NAME "filter-1"
:VALUES ("val-1" "val-2")), which is not of type (OR
STRING
NUMBER
(SIMPLE-ARRAY
(UNSIGNED-BYTE
8)
(*))).
[Condition of type SIMPLE-TYPE-ERROR]
After some investigation, it seems that ec2-request
is not generated properly when :filters
argument is presented.
The generated request has following request-params
:
(("Action" . "DescribeInstances") ("Version" . "2016-11-15")
("Filters.member.1"
. #S(AWS-SDK/SERVICES/EC2/API:FILTER
:NAME "filter-1"
:VALUES ("val-1" "val-2")))
("Filters.member.2"
. #S(AWS-SDK/SERVICES/EC2/API:FILTER :NAME "filter-2" :VALUES ("val-3"))))
instead of something like this:
(("Action" . "DescribeInstances") ("Version" . "2016-11-15")
("Filters.member.1.Name" . "filter-1")
("Filters.member.1.Values.member.1" . "val-1")
("Filters.member.1.Values.member.2" . "val-2")
("Filters.member.2.Name" . "filter-2")
("Filters.member.2.Values.member.1" . "val-3"))
Compilation is currently failing:
CL-USER> (ql:quickload :ironclad)
(:IRONCLAD)
CL-USER> (ql:quickload :aws-sdk)
(:AWS-SDK)
CL-USER> (setq aws-sdk:*aws-profile* "bayne-family")
"bayne-family"
CL-USER> (ql:quickload :aws-sdk/services/s3)
To load "aws-sdk/services/s3":
Load 1 ASDF system:
aws-sdk/services/s3
; Loading "aws-sdk/services/s3"
[package aws-sdk/services/s3].....................
..................................................
..................................................
......
Cannot DEFTYPE TYPE because TYPE has been declared as a declaration name
[Condition of type SIMPLE-ERROR]
Backtrace:
0: (CCL::CHECK-DECLARATION-REDEFINITION TYPE DEFTYPE)
1: (CCL::%DEFTYPE TYPE #<Compiled-function TYPE (Non-Global) #x30200409BA6F> NIL)
2: (CCL::%COMPILE-TIME-EVAL (CCL::%DEFTYPE 'TYPE (NFUNCTION TYPE (LAMBDA (#:WHOLE27721 #:ENVIRONMENT27722) (DECLARE #) (BLOCK TYPE #))) NIL) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D>)
3: (CCL::FCOMP-FORM-1 (CCL::%DEFTYPE 'TYPE (NFUNCTION TYPE (LAMBDA (#:WHOLE27721 #:ENVIRONMENT27722) (DECLARE #) (BLOCK TYPE #))) NIL) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :COMPILE-TIME-TOO)
4: (CCL::FCOMP-FORM (CCL::%DEFTYPE 'TYPE (NFUNCTION TYPE (LAMBDA (#:WHOLE27721 #:ENVIRONMENT27722) (DECLARE #) (BLOCK TYPE #))) NIL) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :COMPILE-TIME-TOO)
5: (CCL::FCOMP-FORM-LIST ((CCL::%DEFTYPE 'TYPE (NFUNCTION TYPE (LAMBDA # # #)) NIL)) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :COMPILE-TIME-TOO)
6: (CCL::FCOMP-EVAL-WHEN (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (CCL::%DEFTYPE 'TYPE (NFUNCTION TYPE (LAMBDA # # #)) NIL)) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :NOT-COMPILE-TIME)
7: (CCL::FCOMP-FORM (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (CCL::%DEFTYPE 'TYPE (NFUNCTION TYPE (LAMBDA # # #)) NIL)) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :NOT-COMPILE-TIME)
8: (CCL::FCOMP-FORM-LIST ((EVAL-WHEN (:COMPILE-TOPLEVEL) (CCL::NOTE-TYPE-INFO 'TYPE 'CCL::MACRO #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D>)) ..)) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :NOT-COMPILE-T..
9: (CCL::FCOMP-FORM (PROGN (EVAL-WHEN (:COMPILE-TOPLEVEL) (CCL::NOTE-TYPE-INFO 'TYPE 'CCL::MACRO #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D>)) ..) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :NOT-COMPILE-T..
10: (CCL::FCOMP-FORM (DEFTYPE TYPE () 'STRING) #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :NOT-COMPILE-TIME)
11: (CCL::FCOMP-READ-LOOP "/usr/home/duncan/common-lisp/aws-sdk-lisp/services/s3.lisp" "/usr/home/duncan/common-lisp/aws-sdk-lisp/services/s3.lisp" 0 #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D> :NOT-COMPIL..
12: (CCL::FCOMP-FILE "/usr/home/duncan/common-lisp/aws-sdk-lisp/services/s3.lisp" "/usr/home/duncan/common-lisp/aws-sdk-lisp/services/s3.lisp" 0 #<CCL::LEXICAL-ENVIRONMENT #x3020036FAF9D>)
System details:
This DEFPACKAGE form generates potentially noncoforming code for the various services:
aws-sdk-lisp/generator/service.lisp
Lines 21 to 25 in 7d3d0d2
As the standard says:
:use
The arguments to :use set the packages that the package named by package-name will inherit from. If :use is not supplied, it defaults to the same implementation-dependent value as the :use argument to make-package.
To ensure that no packages are used, you have to do something like:
(defpackage ,package-name
(:use))
http://www.lispworks.com/documentation/HyperSpec/Body/m_defpkg.htm#defpackage
This actually causes issues on lispworks.
It looks as if the specs are a few years old. Where can we obtain the latest specs and how is the SDK regenerated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.