message: fix(aws-lambda): wait for lambda to be ready right after creation/updating of code
diff: @@ -98,6 +98,9 @@ class AwsLambda extends Component {
  const createResult = await createLambda({ lambda, ...config });
  config.arn = createResult.arn;
  config.hash = createResult.hash;
  +
  + // Wait for Lambda to be in a ready state after creation and before doing anything else
  + await waitUntilReady(this.context, config.name, config.region);
  } else {
  config.arn = prevLambda.arn;
  @@ -108,6 +111,9 @@ class AwsLambda extends Component {
  await updateLambdaCode({ lambda, ...config });
  }
  + // Wait for Lambda to be in a ready state after code updated and before doing anything else
  + await waitUntilReady(this.context, config.name, config.region);
  +
  this.context.status(`Updating`);
  this.context.debug(`Updating ${config.name} lambda config.`);
  @@ -122,9 +128,6 @@ class AwsLambda extends Component {
  await deleteLambda({ lambda, name: this.state.name });
  }
  - // Wait for Lambda to be in a ready state
  - await waitUntilReady(this.context, config.name, config.region);
  -
  this.context.debug(
  `Successfully deployed lambda ${config.name} in the ${config.region} region.`
  );
  