in src/AWS.Deploy.Orchestration/DeploymentCommands/CdkDeploymentCommand.cs [17:55]
public async Task ExecuteAsync(Orchestrator orchestrator, CloudApplication cloudApplication, Recommendation recommendation)
{
if (orchestrator._interactiveService == null)
throw new InvalidOperationException($"{nameof(orchestrator._interactiveService)} is null as part of the orchestartor object");
if (orchestrator._cdkManager == null)
throw new InvalidOperationException($"{nameof(orchestrator._cdkManager)} is null as part of the orchestartor object");
if (orchestrator._cdkProjectHandler == null)
throw new InvalidOperationException($"{nameof(CdkProjectHandler)} is null as part of the orchestartor object");
if (orchestrator._localUserSettingsEngine == null)
throw new InvalidOperationException($"{nameof(orchestrator._localUserSettingsEngine)} is null as part of the orchestartor object");
if (orchestrator._session == null)
throw new InvalidOperationException($"{nameof(orchestrator._session)} is null as part of the orchestartor object");
if (orchestrator._cdkVersionDetector == null)
throw new InvalidOperationException($"{nameof(orchestrator._cdkVersionDetector)} must not be null.");
if (orchestrator._directoryManager == null)
throw new InvalidOperationException($"{nameof(orchestrator._directoryManager)} must not be null.");
if (orchestrator._workspaceMetadata == null)
throw new InvalidOperationException($"{nameof(orchestrator._workspaceMetadata)} must not be null.");
orchestrator._interactiveService.LogSectionStart("Configuring AWS Cloud Development Kit (CDK)",
"Ensure a compatible CDK version is installed and the CDK bootstrap CloudFormation stack has been created. A CDK project to perform the deployment is generated unless an existing deployment project was selected.");
var cdkProject = await orchestrator._cdkProjectHandler.ConfigureCdkProject(orchestrator._session, cloudApplication, recommendation);
var projFiles = orchestrator._directoryManager.GetProjFiles(cdkProject);
var cdkVersion = orchestrator._cdkVersionDetector.Detect(projFiles);
await orchestrator._cdkManager.EnsureCompatibleCDKExists(recommendation.Recipe.PersistedDeploymentProject ? cdkProject : orchestrator._workspaceMetadata.DeployToolWorkspaceDirectoryRoot, cdkVersion);
try
{
await orchestrator._cdkProjectHandler.DeployCdkProject(orchestrator._session, cloudApplication, cdkProject, recommendation);
}
finally
{
orchestrator._cdkProjectHandler.DeleteTemporaryCdkProject(cdkProject);
}
await orchestrator._localUserSettingsEngine.UpdateLastDeployedStack(cloudApplication.Name, orchestrator._session.ProjectDefinition.ProjectName, orchestrator._session.AWSAccountId, orchestrator._session.AWSRegion);
}