Skip to content

update_ip_restriction

update_ip_restriction(
    aws_account_id: AwsAccountId,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    ip_restriction_rule_map: Optional[IpRestrictionRuleMap] = None,
    vpc_id_restriction_rule_map: Optional[VpcIdRestrictionRuleMap] = None,
    vpc_endpoint_id_restriction_rule_map: Optional[
        VpcEndpointIdRestrictionRuleMap
    ] = None,
    enabled: Optional[NullableBoolean] = None,
) -> UpdateIpRestrictionResponse

Updates the content and status of IP rules. Traffic from a source is allowed when the source satisfies either the IpRestrictionRule, VpcIdRestrictionRule, or VpcEndpointIdRestrictionRule. To use this operation, you must provide the entire map of rules. You can use the DescribeIpRestriction operation to get the current rule map.

Parameters:

  • aws_account_id (AwsAccountId) –

    The ID of the Amazon Web Services account that contains the IP rules.

  • ip_restriction_rule_map (Optional[IpRestrictionRuleMap], default: None ) –

    A map that describes the updated IP rules with CIDR ranges and descriptions.

  • vpc_id_restriction_rule_map (Optional[VpcIdRestrictionRuleMap], default: None ) –

    A map of VPC IDs and their corresponding rules. When you configure this parameter, traffic from all VPC endpoints that are present in the specified VPC is allowed.

  • vpc_endpoint_id_restriction_rule_map (Optional[VpcEndpointIdRestrictionRuleMap], default: None ) –

    A map of allowed VPC endpoint IDs and their corresponding rule descriptions.

  • enabled (Optional[NullableBoolean], default: None ) –

    A value that specifies whether IP rules are turned on.

Raises:

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def update_ip_restriction(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    ip_restriction_rule_map: Optional[
        "capo_quicksight.types.ip_restriction_rule_map.IpRestrictionRuleMap"
    ] = None,
    vpc_id_restriction_rule_map: Optional[
        "capo_quicksight.types.vpc_id_restriction_rule_map.VpcIdRestrictionRuleMap"
    ] = None,
    vpc_endpoint_id_restriction_rule_map: Optional[
        "capo_quicksight.types.vpc_endpoint_id_restriction_rule_map.VpcEndpointIdRestrictionRuleMap"
    ] = None,
    enabled: Optional[
        "capo_quicksight.types.nullable_boolean.NullableBoolean"
    ] = None,
) -> "capo_quicksight.types.update_ip_restriction_response.UpdateIpRestrictionResponse":
    """<p>Updates the content and status of IP rules. Traffic from a source is allowed when the source satisfies either the <code>IpRestrictionRule</code>, <code>VpcIdRestrictionRule</code>, or <code>VpcEndpointIdRestrictionRule</code>. To use this operation, you must provide the entire map of rules. You can use the <code>DescribeIpRestriction</code> operation to get the current rule map.</p>

    Args:
        aws_account_id: <p>The ID of the Amazon Web Services account that contains the IP rules.</p>
        ip_restriction_rule_map: <p>A map that describes the updated IP rules with CIDR ranges and descriptions.</p>
        vpc_id_restriction_rule_map: <p>A map of VPC IDs and their corresponding rules. When you configure this parameter, traffic from all VPC endpoints that are present in the specified VPC is allowed.</p>
        vpc_endpoint_id_restriction_rule_map: <p>A map of allowed VPC endpoint IDs and their corresponding rule descriptions.</p>
        enabled: <p>A value that specifies whether IP rules are turned on.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.update_ip_restriction_request.UpdateIpRestrictionRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.update_ip_restriction_response.UpdateIpRestrictionResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.update_ip_restriction

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.update_ip_restriction.update_ip_restriction(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateIpRestriction")
    )
    input_: capo_quicksight.types.update_ip_restriction_request.UpdateIpRestrictionRequest = {
        "aws_account_id": aws_account_id
    }
    if ip_restriction_rule_map is not None:
        input_["ip_restriction_rule_map"] = ip_restriction_rule_map
    if vpc_id_restriction_rule_map is not None:
        input_["vpc_id_restriction_rule_map"] = vpc_id_restriction_rule_map
    if vpc_endpoint_id_restriction_rule_map is not None:
        input_["vpc_endpoint_id_restriction_rule_map"] = (
            vpc_endpoint_id_restriction_rule_map
        )
    if enabled is not None:
        input_["enabled"] = enabled

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