Skip to content

validate_security_group_quotas_for_interface

validate_security_group_quotas_for_interface(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    security_group_ids: Optional[SecurityGroupIdList] = None,
    dry_run: Optional[Boolean] = None,
) -> ValidateSecurityGroupQuotasForInterfaceResult

Validates whether the specified security groups can be associated with a single network interface. The operation checks Amazon Virtual Private Cloud (Amazon VPC) quotas. It checks inbound or outbound rules per security group and security groups per network interface. Only authorized Amazon Web Services services can call this operation.

For more information about security group quotas, see Amazon VPC quotas in the Amazon VPC User Guide.

Parameters:

  • security_group_ids (Optional[SecurityGroupIdList], default: None ) –

    The IDs of the security groups to validate for association with a single network interface. You must specify at least one ID, and each ID must be unique. The number of IDs cannot exceed the maximum number of security groups allowed per network interface.

  • 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.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def validate_security_group_quotas_for_interface(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    security_group_ids: Optional[
        "capo_ec2.types.security_group_id_list.SecurityGroupIdList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.validate_security_group_quotas_for_interface_result.ValidateSecurityGroupQuotasForInterfaceResult":
    """<p>Validates whether the specified security groups can be associated with a single network interface. The operation checks Amazon Virtual Private Cloud (Amazon VPC) quotas. It checks inbound or outbound rules per security group and security groups per network interface. Only authorized Amazon Web Services services can call this operation.</p> <p>For more information about security group quotas, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-security-groups">Amazon VPC quotas</a> in the <i>Amazon VPC User Guide</i>.</p>

    Args:
        security_group_ids: <p>The IDs of the security groups to validate for association with a single network interface. You must specify at least one ID, and each ID must be unique. The number of IDs cannot exceed the maximum number of security groups allowed per network interface.</p>
        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>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.validate_security_group_quotas_for_interface_request.ValidateSecurityGroupQuotasForInterfaceRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.validate_security_group_quotas_for_interface_result.ValidateSecurityGroupQuotasForInterfaceResult"
    ]:
        import capo_ec2._operations.amazon_ec2.validate_security_group_quotas_for_interface

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

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ValidateSecurityGroupQuotasForInterface"),
    )
    input_: capo_ec2.types.validate_security_group_quotas_for_interface_request.ValidateSecurityGroupQuotasForInterfaceRequest = {}
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if dry_run is not None:
        input_["dry_run"] = dry_run

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