delete_security_group
async
¶
delete_security_group(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
group_id: Optional[SecurityGroupId] = None,
group_name: Optional[SecurityGroupName] = None,
dry_run: Optional[Boolean] = None,
) -> DeleteSecurityGroupResult
Deletes a security group.
If you attempt to delete a security group that is associated with an instance or network interface, is referenced by another security group in the same VPC, or has a VPC association, the operation fails with DependencyViolation.
Parameters:
-
group_id(Optional[SecurityGroupId], default:None) –The ID of the security group.
-
group_name(Optional[SecurityGroupName], default:None) –[Default VPC] The name of the security group. You can specify either the security group name or the security group ID. For security groups in a nondefault VPC, you must specify the security group ID.
-
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 isUnauthorizedOperation.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To delete a security group This example deletes the specified security group.
Source code in docs_src/capo_ec2/_services/async_ec2.py
18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 | |