aws-iam-data 0.0.2
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/LICENSE +21 -0
- package/README.md +34 -0
- package/data/iam.json +304352 -0
- package/data/metadata.json +22659 -0
- package/package.json +37 -0
- package/src/awsIamData.d.ts +63 -0
- package/src/index.js +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Tobi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# aws-iam-data
|
|
2
|
+
This repository provides AWS IAM data gathered from the official [AWS IAM docs](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html) as a convenient npm package ([aws-iam-data](https://www.npmjs.com/package/aws-iam-data)), that can be used in other OSS projects.
|
|
3
|
+
|
|
4
|
+
The package also includes the [TypeScript interface definitions](src/awsIamData.d.ts).
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
You can install [aws-iam-data](https://www.npmjs.com/package/aws-iam-data) as a dependecy to your Node/TypeScript project via
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i --save aws-iam-data
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
To use it in your own projects, see [examples/index.js](examples/index.js) or the code below:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
const { iamData, metadata } = require('aws-iam-data');
|
|
17
|
+
|
|
18
|
+
// Get overall service count
|
|
19
|
+
console.log(`Contains ${metadata.serviceCount} services!`);
|
|
20
|
+
|
|
21
|
+
// Get EC2 data
|
|
22
|
+
const ec2IamData = iamData.filter(service => service.name === 'Amazon EC2')[0];
|
|
23
|
+
|
|
24
|
+
// Get actions and their access level
|
|
25
|
+
const ec2Actions = ec2IamData.actions.map(action => ({ name: action.name, accessLevel: action.accessLevel }));
|
|
26
|
+
console.log(JSON.stringify(ec2Actions, null, 2));
|
|
27
|
+
|
|
28
|
+
// Get EC2 resource types
|
|
29
|
+
const ec2ResourceTypes = ec2IamData.resourceTypes.map(action => ({ name: action.name, arnPattern: action.arnPattern }));
|
|
30
|
+
console.log(JSON.stringify(ec2ResourceTypes, null, 2));
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Automatic updates
|
|
34
|
+
The CI pipeline will check for AWS IAM docs updates everyday at 4AM, and automatically publish a new patch version if updates are detected.
|