Skip to content

create_work_group

create_work_group(
    name: WorkGroupName,
    *,
    config_overrides: Optional[AthenaClientConfig] = None,
    configuration: Optional[WorkGroupConfiguration] = None,
    description: Optional[WorkGroupDescriptionString] = None,
    tags: Optional[TagList] = None,
) -> CreateWorkGroupOutput

Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup.

Parameters:

  • name (WorkGroupName) –

    The workgroup name.

  • configuration (Optional[WorkGroupConfiguration], default: None ) –

    Contains configuration information for creating an Athena SQL workgroup or Spark enabled Athena workgroup. Athena SQL workgroup configuration includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with EnforceWorkGroupConfiguration) in the WorkGroupConfiguration override client-side settings. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

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

    The workgroup description.

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

    A list of comma separated tags to add to the workgroup that is created.

Raises:

  • InternalServerException –

    Indicates a platform issue, which may be due to a transient condition or outage.

  • InvalidRequestException –

    Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_athena/_services/athena.py
def create_work_group(
    self,
    name: "capo_athena.types.work_group_name.WorkGroupName",
    *,
    config_overrides: Optional[AthenaClientConfig] = None,
    configuration: Optional[
        "capo_athena.types.work_group_configuration.WorkGroupConfiguration"
    ] = None,
    description: Optional[
        "capo_athena.types.work_group_description_string.WorkGroupDescriptionString"
    ] = None,
    tags: Optional["capo_athena.types.tag_list.TagList"] = None,
) -> "capo_athena.types.create_work_group_output.CreateWorkGroupOutput":
    """<p>Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup.</p>

    Args:
        name: <p>The workgroup name.</p>
        configuration: <p>Contains configuration information for creating an Athena SQL workgroup or Spark enabled Athena workgroup. Athena SQL workgroup configuration includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with <code>EnforceWorkGroupConfiguration</code>) in the <code>WorkGroupConfiguration</code> override client-side settings. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
        description: <p>The workgroup description.</p>
        tags: <p>A list of comma separated tags to add to the workgroup that is created.</p>

    Raises:
        capo_athena.errors.internal_server_exception.InternalServerException: <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
        capo_athena.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_athena.types.create_work_group_input.CreateWorkGroupInput]",
    ) -> OperationResponse[
        "capo_athena.types.create_work_group_output.CreateWorkGroupOutput"
    ]:
        import capo_athena._operations.amazon_athena.create_work_group

        output, http_response = (
            capo_athena._operations.amazon_athena.create_work_group.create_work_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkGroup")
    )
    input_: capo_athena.types.create_work_group_input.CreateWorkGroupInput = {
        "name": name
    }
    if configuration is not None:
        input_["configuration"] = configuration
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output