

# AnalyzeAccess

Returns the effective access of a principal on a resource, and the Lake Formation permissions and row-level security policies that contributed to it.

## Request Syntax
<a name="API_AnalyzeAccess_RequestSyntax"></a>

```
POST /AnalyzeAccess HTTP/1.1
Content-type: application/json

{
   "ContextAttributes": [ 
      { 
         "Key": "{{string}}",
         "ProviderType": "{{string}}",
         "Value": "{{string}}"
      }
   ],
   "Groups": [ "{{string}}" ],
   "Principal": { 
      "DataLakePrincipalIdentifier": "{{string}}"
   },
   "Resource": { 
      "AnyResource": { 
         "CatalogId": "{{string}}",
         "ResourceType": "{{string}}"
      },
      "Catalog": { 
         "Id": "{{string}}"
      },
      "Database": { 
         "CatalogId": "{{string}}",
         "Name": "{{string}}"
      },
      "DataCellsFilter": { 
         "DatabaseName": "{{string}}",
         "Name": "{{string}}",
         "TableCatalogId": "{{string}}",
         "TableName": "{{string}}"
      },
      "DataLocation": { 
         "CatalogId": "{{string}}",
         "ResourceArn": "{{string}}"
      },
      "LFTag": { 
         "CatalogId": "{{string}}",
         "TagKey": "{{string}}",
         "TagValues": [ "{{string}}" ]
      },
      "LFTagExpression": { 
         "CatalogId": "{{string}}",
         "Name": "{{string}}"
      },
      "LFTagPolicy": { 
         "CatalogId": "{{string}}",
         "Expression": [ 
            { 
               "TagKey": "{{string}}",
               "TagValues": [ "{{string}}" ]
            }
         ],
         "ExpressionName": "{{string}}",
         "ResourceType": "{{string}}"
      },
      "RLSPolicy": { 
         "CatalogId": "{{string}}",
         "Name": "{{string}}"
      },
      "Table": { 
         "CatalogId": "{{string}}",
         "DatabaseName": "{{string}}",
         "Name": "{{string}}",
         "TableWildcard": { 
         }
      },
      "TableWithColumns": { 
         "CatalogId": "{{string}}",
         "ColumnNames": [ "{{string}}" ],
         "ColumnWildcard": { 
            "ExcludedColumnNames": [ "{{string}}" ]
         },
         "DatabaseName": "{{string}}",
         "Name": "{{string}}"
      },
      "UserDefinedFunction": { 
         "CatalogId": "{{string}}",
         "DatabaseName": "{{string}}",
         "Name": "{{string}}",
         "UserDefinedFunctionWildcard": { 
         }
      }
   }
}
```

## URI Request Parameters
<a name="API_AnalyzeAccess_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_AnalyzeAccess_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [ContextAttributes](#API_AnalyzeAccess_RequestSyntax) **   <a name="lakeformation-AnalyzeAccess-request-ContextAttributes"></a>
Attributes that override the principal's attributes for the analysis. You can specify up to 50 attributes. If you don't specify any, the analysis uses the principal's existing attributes.  
Type: Array of [ContextAttribute](API_ContextAttribute.md) objects  
Array Members: Maximum number of 50 items.  
Required: No

 ** [Groups](#API_AnalyzeAccess_RequestSyntax) **   <a name="lakeformation-AnalyzeAccess-request-Groups"></a>
For an IAM Identity Center principal, the Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that its session uses. Only one role is supported.  
Type: Array of strings  
Array Members: Fixed number of 1 item.  
Required: No

 ** [Principal](#API_AnalyzeAccess_RequestSyntax) **   <a name="lakeformation-AnalyzeAccess-request-Principal"></a>
The principal whose access to analyze.  
Type: [DataLakePrincipal](API_DataLakePrincipal.md) object  
Required: Yes

 ** [Resource](#API_AnalyzeAccess_RequestSyntax) **   <a name="lakeformation-AnalyzeAccess-request-Resource"></a>
The resource on which to analyze access.  
Type: [Resource](API_Resource.md) object  
Required: Yes

## Response Syntax
<a name="API_AnalyzeAccess_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "AccessDecision": { 
      "AuthorizedActions": [ "string" ],
      "ContributingGrants": [ 
         { 
            "Actions": [ "string" ],
            "Condition": { 
               "Expression": "string"
            },
            "IssuingSource": "string",
            "Principal": { 
               "DataLakePrincipalIdentifier": "string"
            },
            "Resource": { 
               "AnyResource": { 
                  "CatalogId": "string",
                  "ResourceType": "string"
               },
               "Catalog": { 
                  "Id": "string"
               },
               "Database": { 
                  "CatalogId": "string",
                  "Name": "string"
               },
               "DataCellsFilter": { 
                  "DatabaseName": "string",
                  "Name": "string",
                  "TableCatalogId": "string",
                  "TableName": "string"
               },
               "DataLocation": { 
                  "CatalogId": "string",
                  "ResourceArn": "string"
               },
               "LFTag": { 
                  "CatalogId": "string",
                  "TagKey": "string",
                  "TagValues": [ "string" ]
               },
               "LFTagExpression": { 
                  "CatalogId": "string",
                  "Name": "string"
               },
               "LFTagPolicy": { 
                  "CatalogId": "string",
                  "Expression": [ 
                     { 
                        "TagKey": "string",
                        "TagValues": [ "string" ]
                     }
                  ],
                  "ExpressionName": "string",
                  "ResourceType": "string"
               },
               "RLSPolicy": { 
                  "CatalogId": "string",
                  "Name": "string"
               },
               "Table": { 
                  "CatalogId": "string",
                  "DatabaseName": "string",
                  "Name": "string",
                  "TableWildcard": { 
                  }
               },
               "TableWithColumns": { 
                  "CatalogId": "string",
                  "ColumnNames": [ "string" ],
                  "ColumnWildcard": { 
                     "ExcludedColumnNames": [ "string" ]
                  },
                  "DatabaseName": "string",
                  "Name": "string"
               },
               "UserDefinedFunction": { 
                  "CatalogId": "string",
                  "DatabaseName": "string",
                  "Name": "string",
                  "UserDefinedFunctionWildcard": { 
                  }
               }
            }
         }
      ],
      "ContributingRLSPolicies": [ 
         { 
            "Condition": { 
               "Expression": "string"
            },
            "IssuingSource": "string",
            "PolicyName": "string",
            "Principal": { 
               "DataLakePrincipalIdentifier": "string"
            },
            "Resource": { 
               "AnyResource": { 
                  "CatalogId": "string",
                  "ResourceType": "string"
               },
               "Catalog": { 
                  "Id": "string"
               },
               "Database": { 
                  "CatalogId": "string",
                  "Name": "string"
               },
               "DataCellsFilter": { 
                  "DatabaseName": "string",
                  "Name": "string",
                  "TableCatalogId": "string",
                  "TableName": "string"
               },
               "DataLocation": { 
                  "CatalogId": "string",
                  "ResourceArn": "string"
               },
               "LFTag": { 
                  "CatalogId": "string",
                  "TagKey": "string",
                  "TagValues": [ "string" ]
               },
               "LFTagExpression": { 
                  "CatalogId": "string",
                  "Name": "string"
               },
               "LFTagPolicy": { 
                  "CatalogId": "string",
                  "Expression": [ 
                     { 
                        "TagKey": "string",
                        "TagValues": [ "string" ]
                     }
                  ],
                  "ExpressionName": "string",
                  "ResourceType": "string"
               },
               "RLSPolicy": { 
                  "CatalogId": "string",
                  "Name": "string"
               },
               "Table": { 
                  "CatalogId": "string",
                  "DatabaseName": "string",
                  "Name": "string",
                  "TableWildcard": { 
                  }
               },
               "TableWithColumns": { 
                  "CatalogId": "string",
                  "ColumnNames": [ "string" ],
                  "ColumnWildcard": { 
                     "ExcludedColumnNames": [ "string" ]
                  },
                  "DatabaseName": "string",
                  "Name": "string"
               },
               "UserDefinedFunction": { 
                  "CatalogId": "string",
                  "DatabaseName": "string",
                  "Name": "string",
                  "UserDefinedFunctionWildcard": { 
                  }
               }
            }
         }
      ],
      "Principal": { 
         "DataLakePrincipalIdentifier": "string"
      },
      "SelectActionDetails": { 
         "AuthorizedColumns": [ "string" ],
         "CellFilters": [ 
            { 
               "ColumnName": "string",
               "RowFilterExpression": "string"
            }
         ],
         "RowFilter": { 
            "AllRowsWildcard": { 
            },
            "FilterExpression": "string"
         }
      }
   }
}
```

## Response Elements
<a name="API_AnalyzeAccess_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [AccessDecision](#API_AnalyzeAccess_ResponseSyntax) **   <a name="lakeformation-AnalyzeAccess-response-AccessDecision"></a>
The principal's access on the resource.  
Type: [AccessDecision](API_AccessDecision.md) object

## Errors
<a name="API_AnalyzeAccess_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
Access to a resource was denied.    
 ** Message **   
A message describing the problem.
HTTP Status Code: 403

 ** EntityNotFoundException **   
A specified entity does not exist.    
 ** Message **   
A message describing the problem.
HTTP Status Code: 400

 ** FederationSourceException **   
A generic exception encapsulating exceptions from the federation source that are not actionable by query engines.    
 ** FederationSourceErrorCode **   
The error code that the federation source returned, such as `AccessDeniedException` or `ThrottlingException`.  
 ** Message **   
A message describing the problem.
HTTP Status Code: 400

 ** FederationSourceRetryableException **   
The federation source failed. This failure might be temporary. Retry the request.    
 ** Message **   
The error message that the federation source returned, which describes why the request failed.
HTTP Status Code: 400

 ** GlueEncryptionException **   
An encryption operation failed.    
 ** Message **   
A message describing the problem.
HTTP Status Code: 400

 ** InternalServiceException **   
An internal service error occurred.    
 ** Message **   
A message describing the problem.
HTTP Status Code: 500

 ** InvalidInputException **   
The input provided was not valid.    
 ** Message **   
A message describing the problem.
HTTP Status Code: 400

 ** OperationTimeoutException **   
The operation timed out.    
 ** Message **   
A message describing the problem.
HTTP Status Code: 400

## See Also
<a name="API_AnalyzeAccess_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/lakeformation-2017-03-31/AnalyzeAccess) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lakeformation-2017-03-31/AnalyzeAccess) 