Deletes an Amazon Redshift security group.
You cannot delete a security group that is associated with any clusters. You cannot delete the default security group.
For information about managing security groups, go to Amazon Redshift Cluster Security Groups in the Amazon Redshift Cluster Management Guide.
Parameters:
-
cluster_security_group_name
(Optional[String], default:
None
)
–
The name of the cluster security group to be deleted.
Raises:
Source code in docs_src/capo_redshift/_services/async_redshift.py
| async def delete_cluster_security_group(
self,
*,
config_overrides: Optional[AsyncRedshiftClientConfig] = None,
cluster_security_group_name: Optional[
"capo_redshift.types.string.String"
] = None,
) -> None:
"""<p>Deletes an Amazon Redshift security group.</p> <note> <p>You cannot delete a security group that is associated with any clusters. You cannot delete the default security group.</p> </note> <p> For information about managing security groups, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html">Amazon Redshift Cluster Security Groups</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>
Args:
cluster_security_group_name: <p>The name of the cluster security group to be deleted.</p>
Raises:
capo_redshift.errors.cluster_security_group_not_found_fault.ClusterSecurityGroupNotFoundFault: <p>The cluster security group name does not refer to an existing cluster security group.</p>
capo_redshift.errors.invalid_cluster_security_group_state_fault.InvalidClusterSecurityGroupStateFault: <p>The state of the cluster security group is not <code>available</code>. </p>
capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_redshift.types.delete_cluster_security_group_message.DeleteClusterSecurityGroupMessage]",
) -> AsyncOperationResponse[None]:
import capo_redshift._operations.redshift_service_version20121201.delete_cluster_security_group
(
output,
http_response,
) = await capo_redshift._operations.redshift_service_version20121201.delete_cluster_security_group.async_delete_cluster_security_group(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteClusterSecurityGroup")
)
input_: capo_redshift.types.delete_cluster_security_group_message.DeleteClusterSecurityGroupMessage = {}
if cluster_security_group_name is not None:
input_["cluster_security_group_name"] = cluster_security_group_name
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|