startDeployment method

Future<StartDeploymentResponse> startDeployment({
  1. required String serviceArn,
})

Initiate a manual deployment of the latest commit in a source code repository or the latest image in a source image repository to an App Runner service.

For a source code repository, App Runner retrieves the commit and builds a Docker image. For a source image repository, App Runner retrieves the latest Docker image. In both cases, App Runner then deploys the new image to your service and starts a new container instance.

This is an asynchronous operation. On a successful call, you can use the returned OperationId and the ListOperations call to track the operation's progress.

May throw InternalServiceErrorException. May throw InvalidRequestException. May throw ResourceNotFoundException.

Parameter serviceArn : The Amazon Resource Name (ARN) of the App Runner service that you want to manually deploy to.

Implementation

Future<StartDeploymentResponse> startDeployment({
  required String serviceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AppRunner.StartDeployment'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServiceArn': serviceArn,
    },
  );

  return StartDeploymentResponse.fromJson(jsonResponse.body);
}