Skip to content

create_cluster_security_group async

create_cluster_security_group(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    cluster_security_group_name: Optional[String] = None,
    description: Optional[String] = None,
    tags: Optional[TagList] = None,
) -> CreateClusterSecurityGroupResult

Creates a new Amazon Redshift security group. You use security groups to control access to non-VPC clusters.

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 for the security group. Amazon Redshift stores the value as a lowercase string.

    Constraints:

    • Must contain no more than 255 alphanumeric characters or hyphens.

    • Must not be "Default".

    • Must be unique for all security groups that are created by your Amazon Web Services account.

    Example: examplesecuritygroup

  • description (Optional[String], default: None ) –

    A description for the security group.

  • tags (Optional[TagList], default: None ) –

    A list of tag instances.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def create_cluster_security_group(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    cluster_security_group_name: Optional[
        "capo_redshift.types.string.String"
    ] = None,
    description: Optional["capo_redshift.types.string.String"] = None,
    tags: Optional["capo_redshift.types.tag_list.TagList"] = None,
) -> "capo_redshift.types.create_cluster_security_group_result.CreateClusterSecurityGroupResult":
    """<p>Creates a new Amazon Redshift security group. You use security groups to control access to non-VPC clusters.</p> <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 for the security group. Amazon Redshift stores the value as a lowercase string.</p> <p>Constraints:</p> <ul> <li> <p>Must contain no more than 255 alphanumeric characters or hyphens.</p> </li> <li> <p>Must not be "Default".</p> </li> <li> <p>Must be unique for all security groups that are created by your Amazon Web Services account.</p> </li> </ul> <p>Example: <code>examplesecuritygroup</code> </p>
        description: <p>A description for the security group.</p>
        tags: <p>A list of tag instances.</p>

    Raises:
        capo_redshift.errors.cluster_security_group_already_exists_fault.ClusterSecurityGroupAlreadyExistsFault: <p>A cluster security group with the same name already exists.</p>
        capo_redshift.errors.cluster_security_group_quota_exceeded_fault.ClusterSecurityGroupQuotaExceededFault: <p>The request would result in the user exceeding the allowed number of cluster security groups. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>. </p>
        capo_redshift.errors.invalid_tag_fault.InvalidTagFault: <p>The tag is invalid.</p>
        capo_redshift.errors.tag_limit_exceeded_fault.TagLimitExceededFault: <p>You have exceeded the number of tags allowed.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.create_cluster_security_group_message.CreateClusterSecurityGroupMessage]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.create_cluster_security_group_result.CreateClusterSecurityGroupResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.create_cluster_security_group

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.create_cluster_security_group.async_create_cluster_security_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateClusterSecurityGroup")
    )
    input_: capo_redshift.types.create_cluster_security_group_message.CreateClusterSecurityGroupMessage = {}
    if cluster_security_group_name is not None:
        input_["cluster_security_group_name"] = cluster_security_group_name
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output