-
Notifications
You must be signed in to change notification settings - Fork 1
/
AWS_SMPS.php
58 lines (49 loc) · 1.88 KB
/
AWS_SMPS.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use Aws\Ssm\SsmClient;
class AWS_SMPS {
public const VERSION = '2.0.5';
public const STRING = 'String';
public const STRING_LIST = 'StringList';
public const SECURE_STRING = 'SecureString';
public function __construct(string $region = null, string $profile = null, string $version = 'latest') {
$this->client = new SsmClient([
'version' => $version,
'region' => $region,
'profile' => $profile
]);
}
public function put(string $type, string $name, string $value, string $description = null, array $tags = []) {
return $this->client->putParameter([
'Overwrite' => true,
'Type' => $type,
'Name' => $name,
'Value' => $value,
'Description' => $description,
'Tags' => $tags
]);
}
public function get(array $parameters, bool $withDecryption = true) {
return $this->client->getParameters([
'Names' => $parameters,
'WithDecryption' => $withDecryption
]);
}
public function getPath(string $path, bool $recursive = true, bool $withDecryption = true) {
return $this->client->getParametersByPath([
'Path' => $path,
'Recursive' => $recursive,
'WithDecryption' => $withDecryption
]);
}
public function list(array $filters = []) {
return $this->client->describeParameters([
'Filters' => $filters
]);
}
public function delete(array $parameters) {
return $this->client->deleteParameters([
'Names' => $parameters
]);
}
}