:doc:`EC2 <../../ec2>` / Client / disassociate_security_group_vpc

*******************************
disassociate_security_group_vpc
*******************************



.. py:method:: EC2.Client.disassociate_security_group_vpc(**kwargs)

  

  Disassociates a security group from a VPC. You cannot disassociate the security group if any Elastic network interfaces in the associated VPC are still associated with the security group. Note that the disassociation is asynchronous and you can check the status of the request with `DescribeSecurityGroupVpcAssociations <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupVpcAssociations.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSecurityGroupVpc>`_  


  **Request Syntax**
  ::

    response = client.disassociate_security_group_vpc(
        GroupId='string',
        VpcId='string',
        DryRun=True|False
    )
    
  :type GroupId: string
  :param GroupId: **[REQUIRED]** 

    A security group ID.

    

  
  :type VpcId: string
  :param VpcId: **[REQUIRED]** 

    A VPC ID.

    

  
  :type DryRun: boolean
  :param DryRun: 

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

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'State': 'associating'|'associated'|'association-failed'|'disassociating'|'disassociated'|'disassociation-failed'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **State** *(string) --* 

        The state of the disassociation.

        
  