Creates an Access Control List. For more information, see Authenticating users with Access Contol Lists (ACLs).
Parameters:
-
acl_name
(String)
–
The name of the Access Control List.
-
user_names
(Optional[UserNameListInput], default:
None
)
–
The list of users that belong to the Access Control List.
-
tags
(Optional[TagList], default:
None
)
–
A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.
Raises:
Source code in docs_src/capo_memorydb/_services/memory_db.py
| def create_acl(
self,
acl_name: "capo_memorydb.types.string.String",
*,
config_overrides: Optional[MemoryDBClientConfig] = None,
user_names: Optional[
"capo_memorydb.types.user_name_list_input.UserNameListInput"
] = None,
tags: Optional["capo_memorydb.types.tag_list.TagList"] = None,
) -> "capo_memorydb.types.create_acl_response.CreateACLResponse":
"""<p>Creates an Access Control List. For more information, see <a href="https://docs.aws.amazon.com/MemoryDB/latest/devguide/clusters.acls.html">Authenticating users with Access Contol Lists (ACLs)</a>.</p>
Args:
acl_name: <p>The name of the Access Control List.</p>
user_names: <p>The list of users that belong to the Access Control List.</p>
tags: <p>A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.</p>
Raises:
capo_memorydb.errors.acl_already_exists_fault.ACLAlreadyExistsFault: <p>An ACL with the specified name already exists.</p>
capo_memorydb.errors.acl_quota_exceeded_fault.ACLQuotaExceededFault: <p>The request cannot be processed because it would exceed the maximum number of ACLs allowed.</p>
capo_memorydb.errors.default_user_required.DefaultUserRequired: <p>A default user is required and must be specified.</p>
capo_memorydb.errors.duplicate_user_name_fault.DuplicateUserNameFault: <p>A user with the specified name already exists.</p>
capo_memorydb.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The specified parameter value is not valid.</p>
capo_memorydb.errors.tag_quota_per_resource_exceeded.TagQuotaPerResourceExceeded: <p>The request cannot be processed because it would exceed the maximum number of tags allowed per resource.</p>
capo_memorydb.errors.user_not_found_fault.UserNotFoundFault: <p>The specified user does not exist.</p>
capo_memorydb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_memorydb.types.create_acl_request.CreateACLRequest]",
) -> OperationResponse[
"capo_memorydb.types.create_acl_response.CreateACLResponse"
]:
import capo_memorydb._operations.amazon_memory_db.create_acl
output, http_response = (
capo_memorydb._operations.amazon_memory_db.create_acl.create_acl(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateACL")
)
input_: capo_memorydb.types.create_acl_request.CreateACLRequest = {
"acl_name": acl_name
}
if user_names is not None:
input_["user_names"] = user_names
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|