AmplifyGen3 / Client / enable_access_control
enable_access_control¶
- AmplifyGen3.Client.enable_access_control(**kwargs)¶
Enables access control for an environment of a Gen 3 app so that only authorized users can access it.
See also: AWS API Documentation
Request Syntax
response = client.enable_access_control( AppName='string', EnvironmentName='string', Scope='ALL_DEPLOYMENTS'|'NON_ACTIVE_DEPLOYMENTS', Rule={ 'AnyAuthenticatedUser': {} , 'UserClaims': [ { 'Key': 'string', 'Operator': 'EQUALS'|'CONTAINS'|'BEGINS_WITH'|'ENDS_WITH', 'Value': 'string' }, ] }, ClientToken='string' )
- Parameters:
AppName (string) –
[REQUIRED]
The name of the app.
EnvironmentName (string) –
[REQUIRED]
The name of the environment.
Scope (string) – The scope that the access control configuration applies to.
Rule (dict) –
The rule that determines which users are granted access.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
AnyAuthenticatedUser,UserClaims.AnyAuthenticatedUser (dict) –
Admits any user who signs in successfully.
UserClaims (list) –
Admits users whose token claims match the specified conditions.
(dict) –
A condition that a user’s claims must satisfy to be granted access.
Key (string) – [REQUIRED]
The name of the user claim to evaluate.
Operator (string) –
The operator used to compare the claim value.
Value (string) – [REQUIRED]
The value to compare the claim against.
ClientToken (string) – A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
- Return type:
dict
- Returns:
Response Syntax
{ 'Status': 'ENABLING'|'ENABLED'|'ENABLE_FAILED'|'UPDATING'|'UPDATE_FAILED'|'DISABLING'|'DISABLED'|'DISABLE_FAILED', 'StatusReason': 'string' }
Response Structure
(dict) –
Status (string) –
The status of the access control configuration.
StatusReason (string) –
The reason for the status.
Exceptions