dd1c0ef6f41d14068c87882255b82528897b524e
wiki/info/landscape/aws-automation.md
| ... | ... | @@ -251,12 +251,70 @@ User input flow example: |
| 251 | 251 | |
| 252 | 252 | <img style="float: right" src="https://photos-4.dropbox.com/t/2/AAA8lXNig-MSsQhRmhyIYOD1sgi59kfQr8NDqs5bPRenQA/12/379951689/png/32x32/1/_/1/2/image3.PNG/EJmPwIIDGL0ZIAcoBw/fF8VkVypSPKmR_NttUndnjGFJKkEk_ILuOF19hHAVbg?preserve_transparency=1&size=1600x1200&size_mode=3" /> |
| 253 | 253 | |
| 254 | -Translation comment (1): If the parameter for the region was not passed ($region_param is empty) then the user has to do the input by himself after being prompted. The default value equals to $default_region. The value is found inside the file ~/aws-automation/config and was sourced at the start of the script. The input is required because the variable NOT_OPTIONAL was passed. The input is shown ($SHOW_INPUT). |
|
| 254 | +Translation comment (1): |
|
| 255 | 255 | |
| 256 | -Translation comment (2): The user input is assigned to the global variable region. |
|
| 256 | +If the parameter for the region was not passed ($region_param is empty) then the user has to do the input by himself after being prompted. The default value equals to $default_region. The value is found inside the file ~/aws-automation/config and was sourced at the start of the script. The input is required because the variable NOT_OPTIONAL was passed. The input is shown ($SHOW_INPUT). |
|
| 257 | + |
|
| 258 | +Translation comment (2): |
|
| 259 | + |
|
| 260 | +The user input is assigned to the global variable region. |
|
| 261 | + |
|
| 262 | + |
|
| 263 | +If the input variable is not a text but a type of resource from AWS (e.g. load balancer) the following mechanism will take effect: |
|
| 257 | 264 | |
| 258 | 265 | <img style="float: right" src="https://photos-6.dropbox.com/t/2/AADRrPHFrAKtSKzuWZTPrcZbfuW_vB0tUp8nan8iJ0Zzcg/12/379951689/png/32x32/1/_/1/2/image4.PNG/EJmPwIIDGL0ZIAcoBw/LMRyG1oabKBs0d_vv7rPwDpTEY4lzGIHqBfV2rNU5hY?preserve_transparency=1&size=1600x1200&size_mode=3" /> |
| 259 | 266 | |
| 267 | +Translation comment (1): |
|
| 268 | + |
|
| 269 | +Fills the variable RESOURCE_MAP with all available resources of type of the parameter. Keys are the ids and values are the names of the resources. The name of a resources equals to the value of a tag with key "name". |
|
| 270 | + |
|
| 271 | +Translation comment (2): |
|
| 272 | + |
|
| 273 | +Likewise. |
|
| 274 | + |
|
| 275 | +Translation comment (3): |
|
| 276 | + |
|
| 277 | +Displays all resources to the user. Assigns the selected resource id to the variable load balancer. |
|
| 278 | + |
|
| 279 | + |
|
| 280 | +### Error handling |
|
| 281 | + |
|
| 282 | +To inform the user about problems during script execution, return values of some commands (e.g. aws, curl or ssh) will be tested for validity. The logic is encapsulated in the wrapper functions (e.g. aws_wrapper, curl_wrapper or ssh_wrapper) inside the file functions_wrapper.sh. |
|
| 283 | + |
|
| 284 | +### Configuration management |
|
| 285 | + |
|
| 286 | +At the first start of the script, the following files are created: |
|
| 287 | + |
|
| 288 | +- ~/aws-automation/config |
|
| 289 | +- ~/aws-automation/config-[region] |
|
| 290 | + |
|
| 291 | +The file ~/aws-automation/config contains all user variables that are region independent. |
|
| 292 | + |
|
| 293 | +<pre> |
|
| 294 | +default_region= |
|
| 295 | +default_server_startup_notify= |
|
| 296 | +default_build_complete_notify= |
|
| 297 | +</pre> |
|
| 298 | + |
|
| 299 | +The file ~/aws-automation/config-[region] contains all user variables for that specific region. |
|
| 300 | + |
|
| 301 | +<pre> |
|
| 302 | +default_instance_type= |
|
| 303 | +default_ssh_user= |
|
| 304 | +default_key_name= |
|
| 305 | +default_key_fi le= |
|
| 306 | +default_mongodb_host= |
|
| 307 | +default_mongodb_port= |
|
| 308 | +default_new_admin_password= |
|
| 309 | +</pre> |
|
| 310 | + |
|
| 311 | +The user can assign values to that variable that are then used as default proposals. |
|
| 312 | + |
|
| 313 | +### Scenarios |
|
| 314 | + |
|
| 315 | + |
|
| 316 | + |
|
| 317 | + |
|
| 260 | 318 | |
| 261 | 319 | |
| 262 | 320 |