Skip to content

Commit

Permalink
Merge pull request #442 from aws/dev
Browse files Browse the repository at this point in the history
chore: release 0.33
  • Loading branch information
philasmar authored Feb 3, 2022
2 parents 5eb08cc + ba361b6 commit ad20940
Show file tree
Hide file tree
Showing 92 changed files with 2,318 additions and 372 deletions.
2 changes: 1 addition & 1 deletion src/AWS.Deploy.CLI/AWS.Deploy.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<PackageReference Include="AWSSDK.IdentityManagement" Version="3.7.2.25" />
<PackageReference Include="AWSSDK.CloudFormation" Version="3.7.3.12" />
<PackageReference Include="AWSSDK.CloudFormation" Version="3.7.7.14" />
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.1.35" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.2" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.1.2" />
Expand Down
21 changes: 14 additions & 7 deletions src/AWS.Deploy.CLI/Commands/CommandFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using AWS.Deploy.Common.DeploymentManifest;
using AWS.Deploy.Orchestration.DisplayedResources;
using AWS.Deploy.Orchestration.LocalUserSettings;
using AWS.Deploy.Orchestration.ServiceHandlers;

namespace AWS.Deploy.CLI.Commands
{
Expand All @@ -36,7 +37,7 @@ public class CommandFactory : ICommandFactory
private static readonly Option<string> _optionProfile = new("--profile", "AWS credential profile used to make calls to AWS.");
private static readonly Option<string> _optionRegion = new("--region", "AWS region to deploy the application to. For example, us-west-2.");
private static readonly Option<string> _optionProjectPath = new("--project-path", () => Directory.GetCurrentDirectory(), "Path to the project to deploy.");
private static readonly Option<string> _optionStackName = new("--stack-name", "Name the AWS stack to deploy your application to.");
private static readonly Option<string> _optionApplicationName = new("--application-name", "Name of the cloud application. If you choose to deploy via CloudFormation, this name will be used to identify the CloudFormation stack.");
private static readonly Option<bool> _optionDiagnosticLogging = new(new[] { "-d", "--diagnostics" }, "Enable diagnostic output.");
private static readonly Option<string> _optionApply = new("--apply", "Path to the deployment settings file to be applied.");
private static readonly Option<bool> _optionDisableInteractive = new(new[] { "-s", "--silent" }, "Disable interactivity to deploy without any prompts for user input.");
Expand Down Expand Up @@ -69,6 +70,7 @@ public class CommandFactory : ICommandFactory
private readonly ICustomRecipeLocator _customRecipeLocator;
private readonly ILocalUserSettingsEngine _localUserSettingsEngine;
private readonly ICDKVersionDetector _cdkVersionDetector;
private readonly IAWSServiceHandler _awsServiceHandler;

public CommandFactory(
IToolInteractiveService toolInteractiveService,
Expand All @@ -93,7 +95,8 @@ public CommandFactory(
IDeploymentManifestEngine deploymentManifestEngine,
ICustomRecipeLocator customRecipeLocator,
ILocalUserSettingsEngine localUserSettingsEngine,
ICDKVersionDetector cdkVersionDetector)
ICDKVersionDetector cdkVersionDetector,
IAWSServiceHandler awsServiceHandler)
{
_toolInteractiveService = toolInteractiveService;
_orchestratorInteractiveService = orchestratorInteractiveService;
Expand All @@ -118,6 +121,7 @@ public CommandFactory(
_customRecipeLocator = customRecipeLocator;
_localUserSettingsEngine = localUserSettingsEngine;
_cdkVersionDetector = cdkVersionDetector;
_awsServiceHandler = awsServiceHandler;
}

public Command BuildRootCommand()
Expand Down Expand Up @@ -153,7 +157,7 @@ private Command BuildDeployCommand()
deployCommand.Add(_optionProfile);
deployCommand.Add(_optionRegion);
deployCommand.Add(_optionProjectPath);
deployCommand.Add(_optionStackName);
deployCommand.Add(_optionApplicationName);
deployCommand.Add(_optionApply);
deployCommand.Add(_optionDiagnosticLogging);
deployCommand.Add(_optionDisableInteractive);
Expand Down Expand Up @@ -183,7 +187,7 @@ private Command BuildDeployCommand()
_commandLineWrapper.RegisterAWSContext(awsCredentials, awsRegion);
_awsClientFactory.RegisterAWSContext(awsCredentials, awsRegion);

var callerIdentity = await _awsResourceQueryer.GetCallerIdentity();
var callerIdentity = await _awsResourceQueryer.GetCallerIdentity(awsRegion);

var session = new OrchestratorSession(
projectDefinition,
Expand Down Expand Up @@ -216,15 +220,16 @@ private Command BuildDeployCommand()
_systemCapabilityEvaluator,
session,
_directoryManager,
_fileManager);
_fileManager,
_awsServiceHandler);

var deploymentProjectPath = input.DeploymentProject ?? string.Empty;
if (!string.IsNullOrEmpty(deploymentProjectPath))
{
deploymentProjectPath = Path.GetFullPath(deploymentProjectPath, targetApplicationDirectoryPath);
}

await deploy.ExecuteAsync(input.StackName ?? "", deploymentProjectPath, userDeploymentSettings);
await deploy.ExecuteAsync(input.ApplicationName ?? string.Empty, deploymentProjectPath, userDeploymentSettings);

return CommandReturnCodes.SUCCESS;
}
Expand Down Expand Up @@ -294,7 +299,7 @@ private Command BuildDeleteCommand()
{
var projectDefinition = await _projectParserUtility.Parse(input.ProjectPath ?? string.Empty);

var callerIdentity = await _awsResourceQueryer.GetCallerIdentity();
var callerIdentity = await _awsResourceQueryer.GetCallerIdentity(awsRegion);

session = new OrchestratorSession(
projectDefinition,
Expand Down Expand Up @@ -365,6 +370,8 @@ private Command BuildListCommand()
awsOptions.Region = RegionEndpoint.GetBySystemName(awsRegion);
});

await _awsResourceQueryer.GetCallerIdentity(awsRegion);

var listDeploymentsCommand = new ListDeploymentsCommand(_toolInteractiveService, _deployedApplicationQueryer);

await listDeploymentsCommand.ExecuteAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class DeployCommandHandlerInput
public string? Profile { get; set; }
public string? Region { get; set; }
public string? ProjectPath { get; set; }
public string? StackName { get; set; }
public string? ApplicationName { get; set; }
public string? Apply { get; set; }
public bool Diagnostics { get; set; }
public bool Silent { get; set; }
Expand Down
Loading

0 comments on commit ad20940

Please sign in to comment.