@dsmrt/axiom-aws-sdk 0.0.5 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<picture>
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset="../images/axiom-dark-mode.svg">
|
|
3
|
+
<source media="(prefers-color-scheme: light)" srcset="../images/axiom-light-mode.svg">
|
|
4
|
+
<img alt="Axiom logo" src="./images/axiom-light-mode.svg">
|
|
5
|
+
</picture>
|
|
6
|
+
|
|
7
|
+
# Axiom - AWS SDK
|
|
8
|
+
|
|
9
|
+
> An AWS focused config manager
|
|
10
|
+
|
|
11
|
+
This package focuses on AWS api calls while using the axiom cli
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
- Secret management with SSM Parameters (secure strings)
|
|
15
|
+
|
|
16
|
+
## Getting Started
|
|
17
|
+
|
|
18
|
+
### Install the CLI
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @dsmrt/axiom-aws-sdk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### AWS SDK Usage
|
|
25
|
+
|
|
26
|
+
#### AWS IAM Permissions
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
# to use this, you need to give the lambda function permission to the
|
|
30
|
+
# ** CloudFormation Example **
|
|
31
|
+
Resources:
|
|
32
|
+
LambdaPolicies:
|
|
33
|
+
Type: AWS::IAM::Policy
|
|
34
|
+
Properties:
|
|
35
|
+
PolicyName: LambdaRole
|
|
36
|
+
PolicyDocument:
|
|
37
|
+
Statement:
|
|
38
|
+
- Effect: Allow
|
|
39
|
+
Action:
|
|
40
|
+
- "ssm:GetParameters"
|
|
41
|
+
- "ssm:GetParametersByPath"
|
|
42
|
+
Resource: !Sub 'arn:aws:ssm:*:*:parameter/${PARAMETER_PATH}/*'
|
|
43
|
+
# OR
|
|
44
|
+
Resources:
|
|
45
|
+
LambdaPolicies:
|
|
46
|
+
Type: AWS::IAM::Policy
|
|
47
|
+
Properties:
|
|
48
|
+
PolicyName: LambdaRole
|
|
49
|
+
PolicyDocument:
|
|
50
|
+
Statement:
|
|
51
|
+
- Effect: Allow
|
|
52
|
+
Action:
|
|
53
|
+
- "ssm:PutParameter" # you'll need this to put the parameters as well
|
|
54
|
+
- "ssm:GetParameters"
|
|
55
|
+
- "ssm:GetParametersByPath"
|
|
56
|
+
Resource:
|
|
57
|
+
- ${name1}
|
|
58
|
+
- ${name2}
|
|
59
|
+
- ${name3
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### AWS SDK Examples
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { ParameterCollection } from "@dsmrt/axiom-aws-sdk";
|
|
66
|
+
import { SSMClient, Parameter } from "@aws-sdk/client-ssm";
|
|
67
|
+
|
|
68
|
+
const collection = new ParameterCollection(
|
|
69
|
+
`/my-app/dev/`,
|
|
70
|
+
new SSMClient({
|
|
71
|
+
region: "us-east-1",
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const params = await collection.get();
|
|
76
|
+
|
|
77
|
+
params.forEach((parameter: Parameter) => {
|
|
78
|
+
console.log(parameter.Name)
|
|
79
|
+
console.log(parameter.Value)
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Acknowledgements
|
|
84
|
+
|
|
85
|
+
- [Nate Iler](https://github.com/nateiler)
|
|
86
|
+
- [Flipbox Digital](https://www.flipboxdigital.com)
|
|
87
|
+
- [Go Mondo](https://www.flipboxdigital.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsmrt/axiom-aws-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "AWS sdk library for working with axiom cli",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"lint:fix": "eslint ./src/ --ext .ts --fix",
|
|
44
44
|
"test": "vitest run --coverage -c ./vitest.config.ts",
|
|
45
45
|
"watch": "vitest watch --coverage -c ./vitest.config.ts",
|
|
46
|
-
"build": "tsc -d -p ./tsconfig.json"
|
|
46
|
+
"build": "tsc -d -p ./tsconfig.json",
|
|
47
|
+
"version:patch": "pnpm version patch"
|
|
47
48
|
}
|
|
48
49
|
}
|