An open API service indexing awesome lists of open source software.

https://github.com/aligent/serverless-access-roles-generator


https://github.com/aligent/serverless-access-roles-generator

serverless

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# Serverless Access Roles Generator

A [Serverless framework](https://www.serverless.com) plugin for:

- Generate access roles for exported services (generated by [serverless-export-resources](https://github.com/aligent/serverless-export-resources) plugin).
- Collect and export the result to a specific file.

## Serverless configuration

The plugin is configured within the `serverless.yaml` by providing configuration values as the example below

```yaml
custom:
accessRolesGenerator:
principalAccountId: principal_aws_account_id
principalRoleName: principal_role_name
externalId: ${self:service}-${self:provider.stage}
```

### Variables

| Variable | Usage |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| principalAccountId | Principal Account Id that is used to generate access role. |
| principalRoleName | Principal Role Name that is used to generate access role. |
| externalId | A string to identify the app. Can be a random string. |
| exportPrefix | A string to filter the exported services. Default to `aser`. If provided, make sure it match the configuration in `serverless-export-resources` plugin |
| outDir | Destination folder for exporting services' arn, description, and role. Default to `dist/data` |
| outFilename | Name of the file that services will be exported to. Default to `service-outputs.json` |

## References:

- For more information about principal account & role name, check this [AWS document](https://aws.amazon.com/blogs/security/how-to-use-trust-policies-with-iam-roles/)
- More information about `externalId`, check this [AWS document](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)