delete_security_group
¶
delete_security_group(
*,
config_overrides: Optional[EC2ClientConfig] = 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/ec2.py
18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 | |