Skip to content

create_configuration async

create_configuration(
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    description: Optional[__string] = None,
    kafka_versions: Optional[__listOf__string] = None,
    name: Optional[__string] = None,
    server_properties: Optional[__blob] = None,
) -> CreateConfigurationResponse

Creates a new MSK configuration.

Parameters:

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

    The description of the configuration.

  • kafka_versions (Optional[__listOf__string], default: None ) –

    The versions of Apache Kafka with which you can use this MSK configuration.

  • name (Optional[__string], default: None ) –

    The name of the configuration.

  • server_properties (Optional[__blob], default: None ) –

    Contents of the server.properties file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of server.properties can be in plaintext.

Raises:

Source code in docs_src/capo_kafka/_services/async_kafka.py
async def create_configuration(
    self,
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    description: Optional["capo_kafka.types.__string.__string"] = None,
    kafka_versions: Optional[
        "capo_kafka.types.__list_of__string.__listOf__string"
    ] = None,
    name: Optional["capo_kafka.types.__string.__string"] = None,
    server_properties: Optional["capo_kafka.types.__blob.__blob"] = None,
) -> "capo_kafka.types.create_configuration_response.CreateConfigurationResponse":
    """<p>Creates a new MSK configuration.</p>

    Args:
        description: <p>The description of the configuration.</p>
        kafka_versions: <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
        name: <p>The name of the configuration.</p>
        server_properties: <p>Contents of the <filename>server.properties</filename> file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of <filename>server.properties</filename> can be in plaintext.</p>

    Raises:
        capo_kafka.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
        capo_kafka.errors.conflict_exception.ConflictException: <p>Returns information about an error.</p>
        capo_kafka.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
        capo_kafka.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
        capo_kafka.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returns information about an error.</p>
        capo_kafka.errors.too_many_requests_exception.TooManyRequestsException: <p>Returns information about an error.</p>
        capo_kafka.errors.unauthorized_exception.UnauthorizedException: <p>Returns information about an error.</p>
        capo_kafka.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kafka.types.create_configuration_request.CreateConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafka.types.create_configuration_response.CreateConfigurationResponse"
    ]:
        import capo_kafka._operations.kafka.create_configuration

        (
            output,
            http_response,
        ) = await capo_kafka._operations.kafka.create_configuration.async_create_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConfiguration")
    )
    input_: capo_kafka.types.create_configuration_request.CreateConfigurationRequest = {}
    if description is not None:
        input_["description"] = description
    if kafka_versions is not None:
        input_["kafka_versions"] = kafka_versions
    if name is not None:
        input_["name"] = name
    if server_properties is not None:
        input_["server_properties"] = server_properties

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