Skip to content

add_policy_statement

add_policy_statement(
    arn: VeniceGlobalArn,
    statement_id: StatementId,
    effect: StatementEffect,
    action: StatementActionList,
    principal: StatementPrincipalList,
    *,
    config_overrides: Optional[EntityResolutionClientConfig] = None,
    condition: Optional[StatementCondition] = None,
) -> AddPolicyStatementOutput

Adds a policy statement object. To retrieve a list of existing policy statements, use the GetPolicy API.

Parameters:

  • arn (VeniceGlobalArn) –

    The Amazon Resource Name (ARN) of the resource that will be accessed by the principal.

  • statement_id (StatementId) –

    A statement identifier that differentiates the statement from others in the same policy.

  • effect (StatementEffect) –

    Determines whether the permissions specified in the policy are to be allowed (Allow) or denied (Deny).

    If you set the value of the effect parameter to Deny for the AddPolicyStatement operation, you must also set the value of the effect parameter in the policy to Deny for the PutPolicy operation.

  • action (StatementActionList) –

    The action that the principal can use on the resource.

    For example, entityresolution:GetIdMappingJob, entityresolution:GetMatchingJob.

  • principal (StatementPrincipalList) –

    The Amazon Web Services service or Amazon Web Services account that can access the resource defined as ARN.

  • condition (Optional[StatementCondition], default: None ) –

    A set of condition keys that you can use in key policies.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request couldn't be processed because of conflict in the current state of the resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Entity Resolution service.

  • ResourceNotFoundException –

    The resource couldn't be found.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by Entity Resolution.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_entityresolution/_services/entity_resolution.py
def add_policy_statement(
    self,
    arn: "capo_entityresolution.types.venice_global_arn.VeniceGlobalArn",
    statement_id: "capo_entityresolution.types.statement_id.StatementId",
    effect: "capo_entityresolution.types.statement_effect.StatementEffect",
    action: "capo_entityresolution.types.statement_action_list.StatementActionList",
    principal: "capo_entityresolution.types.statement_principal_list.StatementPrincipalList",
    *,
    config_overrides: Optional[EntityResolutionClientConfig] = None,
    condition: Optional[
        "capo_entityresolution.types.statement_condition.StatementCondition"
    ] = None,
) -> "capo_entityresolution.types.add_policy_statement_output.AddPolicyStatementOutput":
    """<p>Adds a policy statement object. To retrieve a list of existing policy statements, use the <code>GetPolicy</code> API.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the resource that will be accessed by the principal.</p>
        statement_id: <p>A statement identifier that differentiates the statement from others in the same policy.</p>
        effect: <p>Determines whether the permissions specified in the policy are to be allowed (<code>Allow</code>) or denied (<code>Deny</code>).</p> <important> <p> If you set the value of the <code>effect</code> parameter to <code>Deny</code> for the <code>AddPolicyStatement</code> operation, you must also set the value of the <code>effect</code> parameter in the <code>policy</code> to <code>Deny</code> for the <code>PutPolicy</code> operation.</p> </important>
        action: <p>The action that the principal can use on the resource. </p> <p>For example, <code>entityresolution:GetIdMappingJob</code>, <code>entityresolution:GetMatchingJob</code>.</p>
        principal: <p>The Amazon Web Services service or Amazon Web Services account that can access the resource defined as ARN.</p>
        condition: <p>A set of condition keys that you can use in key policies.</p>

    Raises:
        capo_entityresolution.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. </p>
        capo_entityresolution.errors.conflict_exception.ConflictException: <p>The request couldn't be processed because of conflict in the current state of the resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc. </p>
        capo_entityresolution.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Entity Resolution service. </p>
        capo_entityresolution.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource couldn't be found. </p>
        capo_entityresolution.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
        capo_entityresolution.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by Entity Resolution. </p>
        capo_entityresolution.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_entityresolution.types.add_policy_statement_input.AddPolicyStatementInput]",
    ) -> OperationResponse[
        "capo_entityresolution.types.add_policy_statement_output.AddPolicyStatementOutput"
    ]:
        import capo_entityresolution._operations.aws_venice_service.add_policy_statement

        output, http_response = (
            capo_entityresolution._operations.aws_venice_service.add_policy_statement.add_policy_statement(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AddPolicyStatement")
    )
    input_: capo_entityresolution.types.add_policy_statement_input.AddPolicyStatementInput = {
        "arn": arn,
        "statement_id": statement_id,
        "effect": effect,
        "action": action,
        "principal": principal,
    }
    if condition is not None:
        input_["condition"] = condition

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