Skip to content

Commit

Permalink
fix(docs): add session policy and policy arn usage documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarneyjr committed Dec 11, 2024
1 parent a5f579f commit a8c3e78
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions docs/general/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ usage: awsume [-h] [-v] [-r] [-s] [-u] [-a] [-k] [-o] [-l [more]]
[--refresh-autocomplete] [--role-arn role_arn]
[--source-profile source_profile] [--external-id external_id]
[--mfa-token mfa_token] [--region region]
[--session-name session_name] [--role-duration role_duration]
[--with-saml | --with-web-identity]
[--session-name session_name] [--session-policy session_policy]
[--session-policy-arns session_policy_arns [session_policy_arns...]]
[--role-duration role_duration] [--with-saml | --with-web-identity]
[--credentials-file credentials_file] [--config-file config_file]
[--config [option [option ...]]] [--info] [--debug]
[profile_name]
Expand All @@ -36,6 +37,8 @@ optional arguments:
--mfa-token mfa_token Your mfa token
--region region The region you want to awsume into
--session-name session_name Set a custom role session name
--session-policy session_policy Custom session policy JSON
--session-policy-arns [arns ...] List of policy ARNs
--role-duration role_duration Seconds to get role creds for
--with-saml Use saml (requires plugin)
--with-web-identity Use web identity (requires plugin)
Expand Down Expand Up @@ -139,6 +142,23 @@ You can target a specific region to awsume with the `--region` flag. This basica
You can supply your own session name to the `assume_role` call with the `--session-name` flag.
## Session Policy, Policy ARNs
You can define your own session policy for a given `awsume` session.
You can do this by specifying the policy JSON or a list of policy ARNs.
Specifying policy JSON:
```sh
$ awsume myprofile --session-policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:*","Resource":"*"}]}'
```
Specifying policy ARNs:
```sh
$ awsume myprofile --session-policy-arns 'arn:aws:iam::aws:policy/job-function/Billing'
```
## Role Duration
You can also supply a custom role duration (up to 43200) for the number of seconds to request role credentials for with the `--role-duration` flag.
Expand Down

0 comments on commit a8c3e78

Please sign in to comment.