Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # A simple action to prove it works
- $ cat myaction.php
- <?php
- function main(array $args) : array
- {
- return $args;
- }
- $ bx wsk action update myaction myaction.php
- # Create the PostgreSQL database
- $ bx service create elephantsql turtle mydatabase
- # Create some credentials for the database
- $ bx service key-create mydatabase openwhisk-creds
- # Bind the credentials to the "myaction" action
- $ bx wsk service bind elephantsql myaction --instance mydatabase --keyname openwhisk-creds
- # Run the action to prove it works
- $ bx wsk action invoke myaction -r
- {
- "__bx_creds": {
- "elephantsql": {
- "credentials": "openwhisk-creds",
- "instance": "mydatabase",
- "max_conns": "5",
- "uri": "postgres://******:******@packy-01.db.elephantsql.com:5432/uhbbioqq"
- }
- }
- }
Add Comment
Please, Sign In to add comment