Skip to content

create_deployment async

create_deployment(
    app_name: AppName,
    environment_name: EnvironmentName,
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    source_config: Optional[DeploymentSourceConfigRequest] = None,
    description: Optional[Description] = None,
    tags: Optional[TagMap] = None,
    branch_arn: Optional[BranchArn] = None,
    publishable_key_action: Optional[PublishableKeyAction] = None,
) -> CreateDeploymentResponse

Creates a deployment for an environment of a Gen 3 app.

Parameters:

  • app_name (AppName) –

    The name of the app.

  • environment_name (EnvironmentName) –

    The name of the environment.

  • source_config (Optional[DeploymentSourceConfigRequest], default: None ) –

    The source to deploy.

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

    The description of the deployment.

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

    The tags to apply to the resource.

  • branch_arn (Optional[BranchArn], default: None ) –

    The Amazon Resource Name (ARN) of the branch to deploy to. This applies only to an app with a backend. The branch must belong to the same app and environment. In the Production environment, it must be the production branch. If you omit this, Amplify chooses the branch and creates it if it doesn't exist.

  • publishable_key_action (Optional[PublishableKeyAction], default: None ) –

    Specifies what the deployment does with the branch's publishable key, for an app with a backend. CREATE_NEW creates a new key that this deployment and later deployments use. The previous key stays active until you revoke it with RevokeApiKey. REUSE, the default, uses the branch's current key.

Raises:

Source code in docs_src/capo_amplifygen3/_services/async_amplify_gen3.py
async def create_deployment(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    environment_name: "capo_amplifygen3.types.environment_name.EnvironmentName",
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    source_config: Optional[
        "capo_amplifygen3.types.deployment_source_config_request.DeploymentSourceConfigRequest"
    ] = None,
    description: Optional["capo_amplifygen3.types.description.Description"] = None,
    tags: Optional["capo_amplifygen3.types.tag_map.TagMap"] = None,
    branch_arn: Optional["capo_amplifygen3.types.branch_arn.BranchArn"] = None,
    publishable_key_action: Optional[
        "capo_amplifygen3.types.publishable_key_action.PublishableKeyAction"
    ] = None,
) -> "capo_amplifygen3.types.create_deployment_response.CreateDeploymentResponse":
    """<p>Creates a deployment for an environment of a Gen 3 app.</p>

    Args:
        app_name: <p>The name of the app.</p>
        environment_name: <p>The name of the environment.</p>
        source_config: <p>The source to deploy.</p>
        description: <p>The description of the deployment.</p>
        tags: <p>The tags to apply to the resource.</p>
        branch_arn: <p>The Amazon Resource Name (ARN) of the branch to deploy to. This applies only to an app with a backend. The branch must belong to the same app and environment. In the Production environment, it must be the production branch. If you omit this, Amplify chooses the branch and creates it if it doesn't exist.</p>
        publishable_key_action: <p>Specifies what the deployment does with the branch's publishable key, for an app with a backend. CREATE_NEW creates a new key that this deployment and later deployments use. The previous key stays active until you revoke it with RevokeApiKey. REUSE, the default, uses the branch's current key.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.role_not_assumable_exception.RoleNotAssumableException: <p>The specified IAM role cannot be assumed. Verify the role and its trust policy, and try again.</p>
        capo_amplifygen3.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota for your account.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifygen3.types.create_deployment_request.CreateDeploymentRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifygen3.types.create_deployment_response.CreateDeploymentResponse"
    ]:
        import capo_amplifygen3._operations.omega.create_deployment

        (
            output,
            http_response,
        ) = await capo_amplifygen3._operations.omega.create_deployment.async_create_deployment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDeployment")
    )
    input_: capo_amplifygen3.types.create_deployment_request.CreateDeploymentRequest = {
        "app_name": app_name,
        "environment_name": environment_name,
    }
    if source_config is not None:
        input_["source_config"] = source_config
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if branch_arn is not None:
        input_["branch_arn"] = branch_arn
    if publishable_key_action is not None:
        input_["publishable_key_action"] = publishable_key_action

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