# cloud-toolkit
Standardizes the setup of aws, datadog and other things

## Available functions
### parameter store
| function   | parameters                              | description                                                                    |
|------------|-----------------------------------------|--------------------------------------------------------------------------------|
| getSecret  | parameter<br/>defaultValue (optional)   | Retrieves a single secret from parameter store by providing the path           |
| getSecrets | parameters<br/>defaultValues (optional) | Retrieves multiple secrets from parameter store by providing an array of paths |

### ses
| function | parameters | description                                    |
|----------|------------|------------------------------------------------|
| sendMail | options    | Sends an email via SES or provided SMTP config |

### lambda
| function     | parameters                 | description                                          |
|--------------|----------------------------|------------------------------------------------------|
| invokeLambda | invocationType<br/>payload | Invokes set lambda with invocations type and payload |

### dynamodb
| function        | parameters                           | description                                              |
|-----------------|--------------------------------------|----------------------------------------------------------|
| batchWriteItems | table<br/>items                      | Creates multiple item in a defined table                 |
| deleteItem      | table<br/>key<br/>options (optional) | Deletes database item from defined table by given key    |
| getItem         | table<br/>key<br/>options (optional) | Returns item from Database by defined table and key      |
| putItem         | table<br/>key                        | Creates one item in defined table                        |
| queryTable      | table<br/>options (optional)         | Returns result items of query                            |
| scanTable       | table<br/>options (optional)         | Returns result items of scan                             |
| updateItem      | table<br/>key<br/>options (optional) | Updates item in database by provided table and given key |

### sqs
| function        | parameters                                                                      | description                                              |
|-----------------|---------------------------------------------------------------------------------|----------------------------------------------------------|
| deleteQueueItem | queueUrl<br/>receiptHandle                                                      | Deletes item from queue                                  |
| getQueueItems   | queueUrl<br/>maxNumberOfMessages (optional)                                     | Retrieves items from queue                               |
| getQueueUrl     | queueName                                                                       | Returns queue url which is needed for all other requests |
| sendMessage     | queueUrl<br/>message<br/>messageAttributes(optional)<br/>messageDelay(optional) | Creates an item in the queue                             |

### logger
A winston instance will be created with default log levels https://github.com/winstonjs/winston?tab=readme-ov-file#logging