Skip to content

create_dev_environment

create_dev_environment(
    space_name: NameString,
    project_name: NameString,
    instance_type: InstanceType,
    persistent_storage: PersistentStorageConfiguration,
    *,
    config_overrides: Optional[CodeCatalystClientConfig] = None,
    repositories: Optional[RepositoriesInput] = None,
    client_token: Optional[ClientToken] = None,
    alias: Optional[str] = None,
    ides: Optional[IdeConfigurationList] = None,
    inactivity_timeout_minutes: Optional[InactivityTimeoutMinutes] = None,
    vpc_connection_name: Optional[NameString] = None,
) -> CreateDevEnvironmentResponse

Creates a Dev Environment in Amazon CodeCatalyst, a cloud-based development environment that you can use to quickly work on the code stored in the source repositories of your project.

When created in the Amazon CodeCatalyst console, by default a Dev Environment is configured to have a 2 core processor, 4GB of RAM, and 16GB of persistent storage. None of these defaults apply to a Dev Environment created programmatically.

Parameters:

  • space_name (NameString) –

    The name of the space.

  • project_name (NameString) –

    The name of the project in the space.

  • repositories (Optional[RepositoriesInput], default: None ) –

    The source repository that contains the branch to clone into the Dev Environment.

  • client_token (Optional[ClientToken], default: None ) –

    A user-specified idempotency token. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.

  • alias (Optional[str], default: None ) –

    The user-defined alias for a Dev Environment.

  • ides (Optional[IdeConfigurationList], default: None ) –

    Information about the integrated development environment (IDE) configured for a Dev Environment.

    An IDE is required to create a Dev Environment. For Dev Environment creation, this field contains configuration information and must be provided.

  • instance_type (InstanceType) –

    The Amazon EC2 instace type to use for the Dev Environment.

  • inactivity_timeout_minutes (Optional[InactivityTimeoutMinutes], default: None ) –

    The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.

  • persistent_storage (PersistentStorageConfiguration) –

    Information about the amount of storage allocated to the Dev Environment.

    By default, a Dev Environment is configured to have 16GB of persistent storage when created from the Amazon CodeCatalyst console, but there is no default when programmatically creating a Dev Environment. Valid values for persistent storage are based on memory sizes in 16GB increments. Valid values are 16, 32, and 64.

  • vpc_connection_name (Optional[NameString], default: None ) –

    The name of the connection that will be used to connect to Amazon VPC, if any.

Raises:

  • AccessDeniedException –

    The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.

  • ConflictException –

    The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.

  • ResourceNotFoundException –

    The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.

  • ServiceQuotaExceededException –

    The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_codecatalyst/_services/code_catalyst.py
def create_dev_environment(
    self,
    space_name: "capo_codecatalyst.types.name_string.NameString",
    project_name: "capo_codecatalyst.types.name_string.NameString",
    instance_type: "capo_codecatalyst.types.instance_type.InstanceType",
    persistent_storage: "capo_codecatalyst.types.persistent_storage_configuration.PersistentStorageConfiguration",
    *,
    config_overrides: Optional[CodeCatalystClientConfig] = None,
    repositories: Optional[
        "capo_codecatalyst.types.repositories_input.RepositoriesInput"
    ] = None,
    client_token: Optional[
        "capo_codecatalyst.types.client_token.ClientToken"
    ] = None,
    alias: Optional[str] = None,
    ides: Optional[
        "capo_codecatalyst.types.ide_configuration_list.IdeConfigurationList"
    ] = None,
    inactivity_timeout_minutes: Optional[
        "capo_codecatalyst.types.inactivity_timeout_minutes.InactivityTimeoutMinutes"
    ] = None,
    vpc_connection_name: Optional[
        "capo_codecatalyst.types.name_string.NameString"
    ] = None,
) -> "capo_codecatalyst.types.create_dev_environment_response.CreateDevEnvironmentResponse":
    """<p>Creates a Dev Environment in Amazon CodeCatalyst, a cloud-based development environment that you can use to quickly work on the code stored in the source repositories of your project. </p> <note> <p>When created in the Amazon CodeCatalyst console, by default a Dev Environment is configured to have a 2 core processor, 4GB of RAM, and 16GB of persistent storage. None of these defaults apply to a Dev Environment created programmatically.</p> </note>

    Args:
        space_name: <p>The name of the space.</p>
        project_name: <p>The name of the project in the space.</p>
        repositories: <p>The source repository that contains the branch to clone into the Dev Environment. </p>
        client_token: <p>A user-specified idempotency token. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.</p>
        alias: <p>The user-defined alias for a Dev Environment.</p>
        ides: <p>Information about the integrated development environment (IDE) configured for a Dev Environment.</p> <note> <p>An IDE is required to create a Dev Environment. For Dev Environment creation, this field contains configuration information and must be provided. </p> </note>
        instance_type: <p>The Amazon EC2 instace type to use for the Dev Environment. </p>
        inactivity_timeout_minutes: <p>The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.</p>
        persistent_storage: <p>Information about the amount of storage allocated to the Dev Environment. </p> <note> <p>By default, a Dev Environment is configured to have 16GB of persistent storage when created from the Amazon CodeCatalyst console, but there is no default when programmatically creating a Dev Environment. Valid values for persistent storage are based on memory sizes in 16GB increments. Valid values are 16, 32, and 64.</p> </note>
        vpc_connection_name: <p>The name of the connection that will be used to connect to Amazon VPC, if any.</p>

    Raises:
        capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
        capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
        capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
        capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
        capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
        capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecatalyst.types.create_dev_environment_request.CreateDevEnvironmentRequest]",
    ) -> OperationResponse[
        "capo_codecatalyst.types.create_dev_environment_response.CreateDevEnvironmentResponse"
    ]:
        import capo_codecatalyst._operations.code_catalyst.create_dev_environment

        output, http_response = (
            capo_codecatalyst._operations.code_catalyst.create_dev_environment.create_dev_environment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDevEnvironment")
    )
    input_: capo_codecatalyst.types.create_dev_environment_request.CreateDevEnvironmentRequest = {
        "space_name": space_name,
        "project_name": project_name,
        "instance_type": instance_type,
        "persistent_storage": persistent_storage,
    }
    if repositories is not None:
        input_["repositories"] = repositories
    if client_token is not None:
        input_["client_token"] = client_token
    if alias is not None:
        input_["alias"] = alias
    if ides is not None:
        input_["ides"] = ides
    if inactivity_timeout_minutes is not None:
        input_["inactivity_timeout_minutes"] = inactivity_timeout_minutes
    if vpc_connection_name is not None:
        input_["vpc_connection_name"] = vpc_connection_name

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