Skip to content

modify_account_vpc_encryption_control async

modify_account_vpc_encryption_control(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    mode: Optional[AccountVpcEncryptionControlMode] = None,
    internet_gateway: Optional[VpcEncryptionControlExclusionStateInput] = None,
    egress_only_internet_gateway: Optional[
        VpcEncryptionControlExclusionStateInput
    ] = None,
    nat_gateway: Optional[VpcEncryptionControlExclusionStateInput] = None,
    virtual_private_gateway: Optional[VpcEncryptionControlExclusionStateInput] = None,
    vpc_peering: Optional[VpcEncryptionControlExclusionStateInput] = None,
    lambda_: Optional[VpcEncryptionControlExclusionStateInput] = None,
    vpc_lattice: Optional[VpcEncryptionControlExclusionStateInput] = None,
    elastic_file_system: Optional[VpcEncryptionControlExclusionStateInput] = None,
) -> ModifyAccountVpcEncryptionControlResult

Modifies the account-level VPC Encryption Control configuration. This sets the encryption control mode and resource exclusions that apply to the VPCs in your account. VPC Encryption Control enables you to enforce encryption for all data in transit within and between VPCs to meet compliance requirements.

For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.

Parameters:

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_account_vpc_encryption_control(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    mode: Optional[
        "capo_ec2.types.account_vpc_encryption_control_mode.AccountVpcEncryptionControlMode"
    ] = None,
    internet_gateway: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    egress_only_internet_gateway: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    nat_gateway: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    virtual_private_gateway: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    vpc_peering: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    lambda_: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    vpc_lattice: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
    elastic_file_system: Optional[
        "capo_ec2.types.vpc_encryption_control_exclusion_state_input.VpcEncryptionControlExclusionStateInput"
    ] = None,
) -> "capo_ec2.types.modify_account_vpc_encryption_control_result.ModifyAccountVpcEncryptionControlResult":
    """<p>Modifies the account-level VPC Encryption Control configuration. This sets the encryption control mode and resource exclusions that apply to the VPCs in your account. VPC Encryption Control enables you to enforce encryption for all data in transit within and between VPCs to meet compliance requirements.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html">Enforce VPC encryption in transit</a> in the <i>Amazon VPC User Guide</i>.</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>
        mode: <p>The encryption mode for the account encryption control configuration.</p>
        internet_gateway: <p>Specifies whether to exclude internet gateway resource from account-level encryption enforcement.</p>
        egress_only_internet_gateway: <p>Specifies whether to exclude egress-only internet gateway resource from account-level encryption enforcement.</p>
        nat_gateway: <p>Specifies whether to exclude NAT gateway resource from account-level encryption enforcement.</p>
        virtual_private_gateway: <p>Specifies whether to exclude virtual private gateway resource from account-level encryption enforcement.</p>
        vpc_peering: <p>Specifies whether to exclude VPC peering connection resource from account-level encryption enforcement.</p>
        lambda_: <p>Specifies whether to exclude Lambda service from account-level encryption enforcement.</p>
        vpc_lattice: <p>Specifies whether to exclude VPC Lattice service from account-level encryption enforcement.</p>
        elastic_file_system: <p>Specifies whether to exclude Elastic File System service from account-level encryption enforcement.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.modify_account_vpc_encryption_control_request.ModifyAccountVpcEncryptionControlRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_account_vpc_encryption_control_result.ModifyAccountVpcEncryptionControlResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_account_vpc_encryption_control

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.modify_account_vpc_encryption_control.async_modify_account_vpc_encryption_control(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyAccountVpcEncryptionControl")
    )
    input_: capo_ec2.types.modify_account_vpc_encryption_control_request.ModifyAccountVpcEncryptionControlRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if mode is not None:
        input_["mode"] = mode
    if internet_gateway is not None:
        input_["internet_gateway"] = internet_gateway
    if egress_only_internet_gateway is not None:
        input_["egress_only_internet_gateway"] = egress_only_internet_gateway
    if nat_gateway is not None:
        input_["nat_gateway"] = nat_gateway
    if virtual_private_gateway is not None:
        input_["virtual_private_gateway"] = virtual_private_gateway
    if vpc_peering is not None:
        input_["vpc_peering"] = vpc_peering
    if lambda_ is not None:
        input_["lambda"] = lambda_
    if vpc_lattice is not None:
        input_["vpc_lattice"] = vpc_lattice
    if elastic_file_system is not None:
        input_["elastic_file_system"] = elastic_file_system

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output