<a id="aws-policy"></a>

# aws-policy

## aws-policy assignments-list

**Usage**

```none
  usage: symp aws-policy assignments-list
[-f {adaptive_table,csv,json,table,value,yaml}]
                                          [-c COLUMN] [--max-width <integer>]
                                          [--fit-width] [--print-empty]
                                          [--noindent]
                                          [--quote {all,minimal,none,nonnumeric}]
                                          [-m [NAME=VALUE [NAME=VALUE ...]]]
                                          [--sort-column SORT_COLUMN]
```

**Description**

Lists the assignments of aws-policies to users, groups and IAM roles.

**Returns**

Returns list: List of assignments - The entities and their policies

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
```

## aws-policy create

**Usage**

```none
  usage: symp aws-policy create
[-f {adaptive_table,json,shell,table,value,yaml}]
                                [-c COLUMN] [--max-width <integer>]
                                [--fit-width] [--print-empty] [--noindent]
                                [--prefix PREFIX]
                                [-m [NAME=VALUE [NAME=VALUE ...]]]
                                [--description DESCRIPTION]
                                [--scope-id SCOPE_ID]
                                name policy_document scope_type
```

**Description**

Creates a new AWS policy.

**Returns**

Returns dict: A structure containing details about the new policy

**Mandatory**

```none
positional arguments:
  name                  The friendly name of the policy
  policy_document       The JSON policy document for the new policy
                        Should be of the following format: '{"Statement": [{"Action": [<actions>], "Effect": "Allow", "Resource": ["*"]}]}'
  scope_type            The scope in which the policy will be available, can be one of: public, domain, project
```

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
  --description DESCRIPTION
                        A friendly description of the policy
  --scope-id SCOPE_ID   If scope_type is project or domain: scope_id should be the project-id or the domain-id, with the logged in scope as default
                        If scope_type is public: scope_id should not have a value
```

## aws-policy get

**Usage**

```none
  usage: symp aws-policy get
[-f {adaptive_table,json,shell,table,value,yaml}]
                             [-c COLUMN] [--max-width <integer>] [--fit-width]
                             [--print-empty] [--noindent] [--prefix PREFIX]
                             [-m [NAME=VALUE [NAME=VALUE ...]]]
                             policy_id
```

**Description**

Retrieves information about the specified AWS policy.

**Returns**

Returns dict: A structure containing details about the policy

**Mandatory**

```none
positional arguments:
  policy_id             The ID of the policy
```

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
```

## aws-policy get-entities

**Usage**

```none
  usage: symp aws-policy get-entities
[-f {adaptive_table,json,shell,table,value,yaml}]
                                      [-c COLUMN] [--max-width <integer>]
                                      [--fit-width] [--print-empty] [--noindent]
                                      [--prefix PREFIX]
                                      [-m [NAME=VALUE [NAME=VALUE ...]]]
                                      policy_id
```

**Description**

Lists all users, groups, and roles that the specified AWS policy is attached to.

**Returns**

Returns dict: Entities that the policy is attached to

**Mandatory**

```none
positional arguments:
  policy_id             The ID of the policy
```

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
```

## aws-policy list

**Usage**

```none
  usage: symp aws-policy list
[-f {adaptive_table,csv,json,table,value,yaml}]
                              [-c COLUMN] [--max-width <integer>] [--fit-width]
                              [--print-empty] [--noindent]
                              [--quote {all,minimal,none,nonnumeric}]
                              [-m [NAME=VALUE [NAME=VALUE ...]]]
                              [--sort-column SORT_COLUMN] [--name NAME]
                              [--with-document] [--scope-type SCOPE_TYPE]
                              [--scope-id SCOPE_ID]
```

**Description**

Lists all the AWS policies that are available.

**Returns**

Returns list: List of policies

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
  --name NAME           Show only the policy with the given name
  --with-document       Whether to include the policy document or not
  --scope-type SCOPE_TYPE
                        Show only the policies with the specified scope,
                        can be one of: public, domain, project
  --scope-id SCOPE_ID   If scope_type is project or domain:
                        scope_id should be the project-id or the domain-id, with the logged in scope as default
                        If scope_type is public: scope_id should not have a value
                        if scope_type is None: scope_id will be checked for the domain-id or the project-id
```

## aws-policy remove

**Usage**

```none
  usage: symp aws-policy remove
[-f {adaptive_table,json,shell,table,value,yaml}]
                                [-c COLUMN] [--max-width <integer>]
                                [--fit-width] [--print-empty] [--noindent]
                                [--prefix PREFIX]
                                [-m [NAME=VALUE [NAME=VALUE ...]]]
                                policy_id
```

**Description**

Deletes the specified AWS policy.
Before you can delete an AWS policy, you must first detach the policy from all users, groups, and roles that it is attached to.

**Mandatory**

```none
positional arguments:
  policy_id             The ID of the policy to delete
```

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
```

## aws-policy update

**Usage**

```none
  usage: symp aws-policy update
[-f {adaptive_table,json,shell,table,value,yaml}]
                                [-c COLUMN] [--max-width <integer>]
                                [--fit-width] [--print-empty] [--noindent]
                                [--prefix PREFIX]
                                [-m [NAME=VALUE [NAME=VALUE ...]]] [--name NAME]
                                [--policy-document POLICY_DOCUMENT]
                                [--description DESCRIPTION]
                                policy_id
```

**Description**

Updates the specified AWS policy.

**Mandatory**

```none
positional arguments:
  policy_id             The ID of the policy to delete
```

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
  --name NAME           The name of the policy
  --policy-document POLICY_DOCUMENT
                        The JSON policy document for the new policy
                        Should be of the following format: '{"Statement": [{"Action": [<actions>], "Effect": "Allow", "Resource": ["*"]}]}'
  --description DESCRIPTION
                        A friendly description of the policy
```

## aws-policy validate

**Usage**

```none
  usage: symp aws-policy validate
[-f {adaptive_table,json,shell,table,value,yaml}]
                                  [-c COLUMN] [--max-width <integer>]
                                  [--fit-width] [--print-empty] [--noindent]
                                  [--prefix PREFIX]
                                  [-m [NAME=VALUE [NAME=VALUE ...]]]
                                  policy_document
```

**Description**

Validate a policy document without creating a policy.

**Returns**

Returns dict: Whether the validation was successful, and the errors if there are any

**Mandatory**

```none
positional arguments:
  policy_document       A policy document to be validated
```

**Optional**

```none
optional arguments:
  -h, --help            show this help message and exit
```
