We have a Cloudfront distribution in front of some AWS buckets, set up by another member of my team.
I have some node.js code for [email protected] to rewrite requests.
My question is how do I deploy it to Cloudfront for those buckets, using the aws command-line tool?
I think, it would require
- request perms to assume a role;
- deploy the function somewhere that it can be used (as opposed to just my account);
- create the role/trust relationship;
- create the behaviour in Cloudfront;
- and associate the function with a Viewer Request event.
I have not found any coherent documentation or examples of how to do all of this, let alone using the aws tool.
As it is, I cannot see the Cloudfront or S3 buckets when I log in via the web site, though I can list the s3 bucket contents via command-line. (I am unsure how to access the Cloudfront via command line).