Skip to content

put_attribute_mapping

put_attribute_mapping(
    profile_id: ProfileIdentifier,
    certificate_field: CertificateField,
    mapping_rules: MappingRules,
    *,
    config_overrides: Optional[RolesAnywhereClientConfig] = None,
) -> PutAttributeMappingResponse

Put an entry in the attribute mapping rules that will be enforced by a given profile. A mapping specifies a certificate field and one or more specifiers that have contextual meanings.

Parameters:

  • profile_id (ProfileIdentifier) –

    The profile to act on. You can specify one of the following:

    • The profile ID.

    • The profile ARN.

    • The alias ARN of the profile.

    An ARN must be for a profile in your account and Region.

  • certificate_field (CertificateField) –

    Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.

  • mapping_rules (MappingRules) –

    A list of mapping entries for every supported specifier or sub-field.

Raises:

Examples:

PutAttributeMapping - Adds a custom attribute mapping rule

>>> client.put_attribute_mapping(profile_id='00000000-0000-0000-0000-000000000000', mapping_rules=[{'specifier': 'CN'}], certificate_field='x509Subject')
Source code in docs_src/capo_rolesanywhere/_services/roles_anywhere.py
def put_attribute_mapping(
    self,
    profile_id: "capo_rolesanywhere.types.profile_identifier.ProfileIdentifier",
    certificate_field: "capo_rolesanywhere.types.certificate_field.CertificateField",
    mapping_rules: "capo_rolesanywhere.types.mapping_rules.MappingRules",
    *,
    config_overrides: Optional[RolesAnywhereClientConfig] = None,
) -> "capo_rolesanywhere.types.put_attribute_mapping_response.PutAttributeMappingResponse":
    """<p>Put an entry in the attribute mapping rules that will be enforced by a given profile. A mapping specifies a certificate field and one or more specifiers that have contextual meanings.</p>

    Args:
        profile_id: <p>The profile to act on. You can specify one of the following:</p> <ul> <li> <p>The profile ID.</p> </li> <li> <p>The profile ARN.</p> </li> <li> <p>The alias ARN of the profile.</p> </li> </ul> <p>An ARN must be for a profile in your account and Region.</p>
        certificate_field: <p>Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.</p>
        mapping_rules: <p>A list of mapping entries for every supported specifier or sub-field.</p>

    Raises:
        capo_rolesanywhere.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_rolesanywhere.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_rolesanywhere.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed due to a temporary failure of the service.</p>
        capo_rolesanywhere.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
        capo_rolesanywhere.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        PutAttributeMapping - Adds a custom attribute mapping rule

        >>> client.put_attribute_mapping(profile_id='00000000-0000-0000-0000-000000000000', mapping_rules=[{'specifier': 'CN'}], certificate_field='x509Subject')
    """

    def _handler(
        req: "OperationRequest[capo_rolesanywhere.types.put_attribute_mapping_request.PutAttributeMappingRequest]",
    ) -> OperationResponse[
        "capo_rolesanywhere.types.put_attribute_mapping_response.PutAttributeMappingResponse"
    ]:
        import capo_rolesanywhere._operations.roles_anywhere.put_attribute_mapping

        output, http_response = (
            capo_rolesanywhere._operations.roles_anywhere.put_attribute_mapping.put_attribute_mapping(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutAttributeMapping")
    )
    input_: capo_rolesanywhere.types.put_attribute_mapping_request.PutAttributeMappingRequest = {
        "profile_id": profile_id,
        "certificate_field": certificate_field,
        "mapping_rules": mapping_rules,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output