Skip to content

modify_vpc_block_public_access_exclusion

modify_vpc_block_public_access_exclusion(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    exclusion_id: Optional[VpcBlockPublicAccessExclusionId] = None,
    internet_gateway_exclusion_mode: Optional[InternetGatewayExclusionMode] = None,
) -> ModifyVpcBlockPublicAccessExclusionResult

Modify VPC Block Public Access (BPA) exclusions. A VPC BPA exclusion is a mode that can be applied to a single VPC or subnet that exempts it from the account’s BPA mode and will allow bidirectional or egress-only access. You can create BPA exclusions for VPCs and subnets even when BPA is not enabled on the account to ensure that there is no traffic disruption to the exclusions when VPC BPA is turned on.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • exclusion_id (Optional[VpcBlockPublicAccessExclusionId], default: None ) –

    The ID of an exclusion.

  • internet_gateway_exclusion_mode (Optional[InternetGatewayExclusionMode], default: None ) –

    The exclusion mode for internet gateway traffic.

    • allow-bidirectional: Allow all internet traffic to and from the excluded VPCs and subnets.

    • allow-egress: Allow outbound internet traffic from the excluded VPCs and subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only applies when VPC Block Public Access is set to Bidirectional.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def modify_vpc_block_public_access_exclusion(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    exclusion_id: Optional[
        "capo_ec2.types.vpc_block_public_access_exclusion_id.VpcBlockPublicAccessExclusionId"
    ] = None,
    internet_gateway_exclusion_mode: Optional[
        "capo_ec2.types.internet_gateway_exclusion_mode.InternetGatewayExclusionMode"
    ] = None,
) -> "capo_ec2.types.modify_vpc_block_public_access_exclusion_result.ModifyVpcBlockPublicAccessExclusionResult":
    """<p>Modify VPC Block Public Access (BPA) exclusions. A VPC BPA exclusion is a mode that can be applied to a single VPC or subnet that exempts it from the account’s BPA mode and will allow bidirectional or egress-only access. You can create BPA exclusions for VPCs and subnets even when BPA is not enabled on the account to ensure that there is no traffic disruption to the exclusions when VPC BPA is turned on.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        exclusion_id: <p>The ID of an exclusion.</p>
        internet_gateway_exclusion_mode: <p>The exclusion mode for internet gateway traffic.</p> <ul> <li> <p> <code>allow-bidirectional</code>: Allow all internet traffic to and from the excluded VPCs and subnets.</p> </li> <li> <p> <code>allow-egress</code>: Allow outbound internet traffic from the excluded VPCs and subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only applies when VPC Block Public Access is set to Bidirectional.</p> </li> </ul>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.modify_vpc_block_public_access_exclusion_request.ModifyVpcBlockPublicAccessExclusionRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.modify_vpc_block_public_access_exclusion_result.ModifyVpcBlockPublicAccessExclusionResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_vpc_block_public_access_exclusion

        output, http_response = (
            capo_ec2._operations.amazon_ec2.modify_vpc_block_public_access_exclusion.modify_vpc_block_public_access_exclusion(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyVpcBlockPublicAccessExclusion")
    )
    input_: capo_ec2.types.modify_vpc_block_public_access_exclusion_request.ModifyVpcBlockPublicAccessExclusionRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if exclusion_id is not None:
        input_["exclusion_id"] = exclusion_id
    if internet_gateway_exclusion_mode is not None:
        input_["internet_gateway_exclusion_mode"] = internet_gateway_exclusion_mode

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