-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.php
34 lines (27 loc) · 1.16 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php declare(strict_types=1);
require __DIR__ . '/AWS_SMPS.php';
try {
$profile = getenv('AWS_PROFILE') ?: '';
# Demo using PHP 8.0 named arguments. Order does not matter
$smps = new AWS_SMPS(profile: $profile, region: 'us-east-2');
$smps->put(AWS_SMPS::STRING, 'foo-string', 'bar', 'test string parameter');
$smps->put(AWS_SMPS::STRING_LIST, 'foo-string-list', 'a,b,c,d', 'test string list parameter');
$smps->put(AWS_SMPS::SECURE_STRING, 'foo-secure-string', 'secret', 'test secure string parameter');
$smps->put(AWS_SMPS::SECURE_STRING, '/p/foo-secure-string', 'secret', 'test path secure string parameter');
$parameters = $smps->get([
'foo-string',
'foo-string-list',
'foo-secure-string',
'/p/foo-secure-string'
]);
$pathParameter = $smps->getPath('/p');
$listAllParameters = $smps->list();
$smps->delete([
'foo-string',
'foo-string-list',
'foo-secure-string',
'/p/foo-secure-string'
]);
} catch(Exception $ex) {
echo "error: " . $ex->getMessage();
}