PHP code example of pflorek / aws-paramstore

1. Go to this page and download the library: Download pflorek/aws-paramstore library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pflorek / aws-paramstore example snippets


use Aws\Ssm\SsmClient;
use PFlorek\AwsParameterStore\ConfigProvider;

// Provide bootstrap options
$options = [
    'prefix' => '/path/with/prefix', // '
];

// Configure AWS Systems Manager Client
$client = new SsmClient([
    'version' => 'latest',
    'region' => 'eu-central-1',
]);
// Or just pass AWS Client options
$client = [
    'version' => 'latest',
    'region' => 'eu-central-1',
];

// Get provided config with active profiles
$environments = ['test'];

// Create AWS Parameter Store Config Provider
$provider = new ConfigProvider($client, $options, $environments);
$config = $provider();

// e.g. returns
//
//array(1) {
//  ["service"]=>
//  array(3) {
//    ["host"]=>
//    string(5) "mysql"
//    ["port"]=>
//    int(3306)
//    ["enabled"]=>
//    bool(true)
//  }
//}