Skip to content

Commit

Permalink
Merge pull request #629 from aws/dev
Browse files Browse the repository at this point in the history
chore: release 0.48
  • Loading branch information
philasmar authored Jun 23, 2022
2 parents 8125cac + 5e69f8f commit 5b78eca
Show file tree
Hide file tree
Showing 140 changed files with 4,069 additions and 370 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To take advantage of this library you’ll need:
* Note: You need to make sure to add the appropriate CloudFormation permissions to your credentials's profile / assumed role.
* For SSO, please visit the [.NET SDK Reference Guide](https://docs.aws.amazon.com/sdkref/latest/guide/access-sso.html).
* [.NET Core 3.1](https://dotnet.microsoft.com/download) or later
* [Node.js 10.3](https://nodejs.org/en/download/) or later
* [Node.js 14](https://nodejs.org/en/download/) or later
* The [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) is used by this tool to create the AWS infrastructure to run applications. The CDK requires Node.js to function. This dependency is needed for deployments that are CDK based. If you will be using deployments that are not CDK based, you are not required to have this dependency.
* (optional) [Docker](https://docs.docker.com/get-docker/)
* Used when deploying to a container based service like Amazon Elastic Container Service (Amazon ECS)
Expand Down
3 changes: 1 addition & 2 deletions buildtools/ci.buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
nodejs: 14
commands:
# install .NET SDK
- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 5.0
- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0
- export PATH="$PATH:$HOME/.dotnet"
pre_build:
Expand Down
2 changes: 1 addition & 1 deletion buildtools/ci.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Resources:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
ImagePullCredentialsType: CODEBUILD
Image: aws/codebuild/amazonlinux2-x86_64-standard:3.0
Image: aws/codebuild/standard:5.0
EnvironmentVariables:
- Name: TEST_RUNNER_ROLE_ARN
Type: PLAINTEXT
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ nav:
- Pre-requisites: docs/getting-started/pre-requisites.md
- How to install: docs/getting-started/installation.md
- Set up Credentials: docs/getting-started/setup-creds.md
- Set up custom workspace: docs/getting-started/custom-workspace.md
- Deploy "Hello World": docs/getting-started/run-tool.md
- Support matrix: docs/support.md
# - Supported deployments:
Expand Down Expand Up @@ -51,9 +52,9 @@ nav:
# - Listing Deployments: docs/tutorials/list-deployments.md
# - Deleting Deployment: docs/tutorials/delete-deployment.md
- Troubleshooting Guide:
- troubleshooting-guide/index.md
- Missing Dependencies: troubleshooting-guide/missing-dependencies.md
- Docker Issues: troubleshooting-guide/docker-issues.md
- Other Issues: troubleshooting-guide/other-issues.md
- Contributing to the project: contributing.md
- FAQs: faq.md

Expand Down
11 changes: 11 additions & 0 deletions site/content/docs/getting-started/custom-workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The default workspace used by AWS.Deploy.Tools is `$USERPROFILE/.aws-dotnet-deploy` on Windows and `$USER/.aws-dotnet-deploy` on Unix based OS. This workspace is used to create the CDK project and any other temporary files used by the tool.

You can override the default workspace by the setting the `AWS_DOTNET_DEPLOYTOOL_WORKSPACE` environment variable.

It must satisfy the following constraints:

* It must point to a valid directory that exists on the disk.
* The directory path must not have any whitespace characters in it.

**Setting up a custom workspace is optional for most users.** However, on Windows OS, if the `$USERPROFILE` path contains a whitespace character then the deployment will fail.
In that case, users are required to set up a custom workspace that satisfies the above constraints.
10 changes: 5 additions & 5 deletions site/content/docs/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ The table below provides a matrix of supported .NET application types and AWS Co

| | .NET Console App | ASP.NET Core | Blazor WebAssembly |
| :--- | :----: | :---: | :---: |
| Amazon Elastic Container Service (ECS) service| X | X | |
| Amazon Elastic Container Service (ECS) task | X | X | |
| AWS App Runner | | X | |
| AWS Elastic Beanstalk | | X | |
| Amazon Elastic Container Service (ECS) service (Linux)| X | X | |
| Amazon Elastic Container Service (ECS) task (Linux) | X | X | |
| AWS App Runner (Linux) | | X | |
| AWS Elastic Beanstalk (Linux and Windows) | | X | |
| Amazon S3 & Amazon CloudFront | | | X |


Expand All @@ -33,7 +33,7 @@ The table below provides a matrix of supported .NET application types and AWS Co

### AWS Elastic Beanstalk

* Supports deployments of ASP.NET Core applications to AWS Elastic Beanstalk on Linux.
* Supports deployments of ASP.NET Core applications to AWS Elastic Beanstalk on Linux and Windows.
* Recommended if you want to deploy your application directly to EC2 hosts.

[**AWS Elastic Beanstalk**](https://aws.amazon.com/elasticbeanstalk/) is an easy-to-use service for deploying and scaling web applications and services. AWS Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring.
Expand Down
3 changes: 3 additions & 0 deletions site/content/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Yes. The AWS Deploy Tool saves your deployment settings, including the environme

#### *FAQ: Can I choose a different AWS service to deploy my application?*
The AWS Deploy Tool will show you all compute service options available to deploy your application, and will recommend a default with information about why it was chosen. The other compute service options will be shown with an explanation of their differences. If the selected compute option does not match your need, you can select a different compute service.

#### *FAQ: I have an application that has dependency on Windows technology, Can I use the AWS Deploy Tool to deploy it to AWS?*
ASP.NET Core applications can be deployed to AWS Elastic Beanstalk picking the "ASP.NET Core App to AWS Elastic Beanstalk on Windows" recommendation. The deployment experience is very similar the "ASP.NET Core App to AWS Elastic Beanstalk on Linux" recommendation with additional settings for configuring the Internet Information Services (IIS) resource path and web site.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Other Issues
# General Issues
This section of the troubleshooting guide explains how to determine, diagnose, and fix common issues you might encounter during the deployment process.

## Invalid project path provided
Expand Down Expand Up @@ -61,4 +61,10 @@ AWS.Deploy.Tools, internally uses a variety of different services to host your .
**Resolution**: You can refer to the official AWS documentation on IAM policies:

* See [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_managed-policies.html) for a tutorial on how to create customer managed IAM policies.
* See [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_policies.html) for troubleshooting IAM policies.
* See [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_policies.html) for troubleshooting IAM policies.

## Deployment failure due to whitespace character in USERPROFILE path

**Why is this happening**: This happens due to a know issue with the AWS Cloud Development Kit (CDK). The CDK is used to AWS.Deploy.Tools under the covers and it cannot cannot access the `$TEMP` directory inside the `$USERPROFILE` path if it contains a whitespace character.

**Resolution**: See [here](../../docs/getting-started/custom-workspace) for guidance on setting a custom workspace that will be used by AWS.Deploy.tools.
2 changes: 2 additions & 0 deletions src/AWS.Deploy.CLI/AWS.Deploy.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1570;1591;ASP0000</NoWarn>
<RollForward>Major</RollForward>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -41,6 +42,7 @@

<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<None Include="..\..\README.md" Pack="true" PackagePath="" />
</ItemGroup>

<Import Project="..\AWS.Deploy.Constants\AWS.Deploy.Constants.projitems" Label="Shared" />
Expand Down
13 changes: 11 additions & 2 deletions src/AWS.Deploy.CLI/Commands/CommandFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class CommandFactory : ICommandFactory
private readonly IOptionSettingHandler _optionSettingHandler;
private readonly IValidatorFactory _validatorFactory;
private readonly IRecipeHandler _recipeHandler;
private readonly IDeployToolWorkspaceMetadata _deployToolWorkspaceMetadata;

public CommandFactory(
IServiceProvider serviceProvider,
Expand Down Expand Up @@ -105,7 +106,9 @@ public CommandFactory(
IAWSServiceHandler awsServiceHandler,
IOptionSettingHandler optionSettingHandler,
IValidatorFactory validatorFactory,
IRecipeHandler recipeHandler)
IRecipeHandler recipeHandler,
IDeployToolWorkspaceMetadata deployToolWorkspaceMetadata
)
{
_serviceProvider = serviceProvider;
_toolInteractiveService = toolInteractiveService;
Expand Down Expand Up @@ -134,6 +137,7 @@ public CommandFactory(
_optionSettingHandler = optionSettingHandler;
_validatorFactory = validatorFactory;
_recipeHandler = recipeHandler;
_deployToolWorkspaceMetadata = deployToolWorkspaceMetadata;
}

public Command BuildRootCommand()
Expand Down Expand Up @@ -236,7 +240,8 @@ private Command BuildDeployCommand()
_awsServiceHandler,
_optionSettingHandler,
_validatorFactory,
_recipeHandler);
_recipeHandler,
_deployToolWorkspaceMetadata);

var deploymentProjectPath = input.DeploymentProject ?? string.Empty;
if (!string.IsNullOrEmpty(deploymentProjectPath))
Expand All @@ -258,6 +263,10 @@ private Command BuildDeployCommand()
_toolInteractiveService.WriteErrorLine(e.Message);
}

_toolInteractiveService.WriteErrorLine(string.Empty);
_toolInteractiveService.WriteErrorLine("For more information, please visit our troubleshooting guide https://aws.github.io/aws-dotnet-deploy/troubleshooting-guide/.");
_toolInteractiveService.WriteErrorLine("If you are still unable to solve this issue and believe this is an issue with the tooling, please cut a ticket https://github.com/aws/aws-dotnet-deploy/issues/new/choose.");

// bail out with an non-zero return code.
return CommandReturnCodes.USER_ERROR;
}
Expand Down
8 changes: 6 additions & 2 deletions src/AWS.Deploy.CLI/Commands/DeployCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class DeployCommand
private readonly IOptionSettingHandler _optionSettingHandler;
private readonly IValidatorFactory _validatorFactory;
private readonly IRecipeHandler _recipeHandler;
private readonly IDeployToolWorkspaceMetadata _deployToolWorkspaceMetadata;

public DeployCommand(
IServiceProvider serviceProvider,
Expand All @@ -79,7 +80,8 @@ public DeployCommand(
IAWSServiceHandler awsServiceHandler,
IOptionSettingHandler optionSettingHandler,
IValidatorFactory validatorFactory,
IRecipeHandler recipeHandler)
IRecipeHandler recipeHandler,
IDeployToolWorkspaceMetadata deployToolWorkspaceMetadata)
{
_serviceProvider = serviceProvider;
_toolInteractiveService = toolInteractiveService;
Expand All @@ -105,6 +107,7 @@ public DeployCommand(
_optionSettingHandler = optionSettingHandler;
_validatorFactory = validatorFactory;
_recipeHandler = recipeHandler;
_deployToolWorkspaceMetadata = deployToolWorkspaceMetadata;
}

public async Task ExecuteAsync(string applicationName, string deploymentProjectPath, UserDeploymentSettings? userDeploymentSettings = null)
Expand Down Expand Up @@ -170,7 +173,8 @@ private void DisplayOutputResources(List<DisplayedResourceItem> displayedResourc
_fileManager,
_directoryManager,
_awsServiceHandler,
_optionSettingHandler);
_optionSettingHandler,
_deployToolWorkspaceMetadata);

// Determine what recommendations are possible for the project.
var recommendations = await GenerateDeploymentRecommendations(orchestrator, deploymentProjectPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ private async Task<List<ApplicationDescription>> GetData()
return await _awsResourceQueryer.ListOfElasticBeanstalkApplications();
}

public async Task<List<TypeHintResource>?> GetResources(Recommendation recommendation, OptionSettingItem optionSetting)
public async Task<TypeHintResourceTable> GetResources(Recommendation recommendation, OptionSettingItem optionSetting)
{
var applications = await GetData();
return applications.Select(x => new TypeHintResource(x.ApplicationName, x.ApplicationName)).ToList();

var resourceTable = new TypeHintResourceTable
{
Rows = applications.Select(x => new TypeHintResource(x.ApplicationName, x.ApplicationName)).ToList()
};

return resourceTable;
}

public async Task<object> Execute(Recommendation recommendation, OptionSettingItem optionSetting)
Expand All @@ -47,7 +53,7 @@ public async Task<object> Execute(Recommendation recommendation, OptionSettingIt
idSelector: app => app.ApplicationName,
displaySelector: app => app.ApplicationName,
defaultSelector: app => app.ApplicationName.Equals(currentTypeHintResponse?.ApplicationName),
defaultNewName: currentTypeHintResponse.ApplicationName ?? String.Empty)
defaultNewName: currentTypeHintResponse?.ApplicationName ?? string.Empty)
{
AskNewName = true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ private async Task<List<EnvironmentDescription>> GetData(Recommendation recommen
return await _awsResourceQueryer.ListOfElasticBeanstalkEnvironments(applicationName);
}

public async Task<List<TypeHintResource>?> GetResources(Recommendation recommendation, OptionSettingItem optionSetting)
public async Task<TypeHintResourceTable> GetResources(Recommendation recommendation, OptionSettingItem optionSetting)
{
var environments = await GetData(recommendation, optionSetting);
return environments.Select(x => new TypeHintResource(x.EnvironmentName, x.EnvironmentName)).ToList();

var resourceTable = new TypeHintResourceTable
{
Rows = environments.Select(x => new TypeHintResource(x.EnvironmentName, x.EnvironmentName)).ToList()
};

return resourceTable;
}

public async Task<object> Execute(Recommendation recommendation, OptionSettingItem optionSetting)
Expand All @@ -50,7 +56,7 @@ public async Task<object> Execute(Recommendation recommendation, OptionSettingIt
idSelector: env => env.EnvironmentName,
displaySelector: env => env.EnvironmentName,
defaultSelector: app => app.EnvironmentName.Equals(currentTypeHintResponse?.EnvironmentName),
defaultNewName: currentTypeHintResponse.EnvironmentName)
defaultNewName: currentTypeHintResponse?.EnvironmentName ?? string.Empty)
{
AskNewName = true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public DockerBuildArgsCommand(IConsoleUtilities consoleUtilities, IOptionSetting
_optionSettingHandler = optionSettingHandler;
}

public Task<List<TypeHintResource>?> GetResources(Recommendation recommendation, OptionSettingItem optionSetting) => Task.FromResult<List<TypeHintResource>?>(null);
public Task<TypeHintResourceTable> GetResources(Recommendation recommendation, OptionSettingItem optionSetting) => Task.FromResult(new TypeHintResourceTable());

public Task<object> Execute(Recommendation recommendation, OptionSettingItem optionSetting)
{
var settingValue = _consoleUtilities
.AskUserForValue(
string.Empty,
_optionSettingHandler.GetOptionSettingValue<string>(recommendation, optionSetting),
_optionSettingHandler.GetOptionSettingValue<string>(recommendation, optionSetting) ?? string.Empty,
allowEmpty: true,
resetValue: _optionSettingHandler.GetOptionSettingDefaultValue<string>(recommendation, optionSetting) ?? "",
validators: async buildArgs => await ValidateBuildArgs(buildArgs, recommendation, optionSetting))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public DockerExecutionDirectoryCommand(IConsoleUtilities consoleUtilities, IDire
_optionSettingHandler = optionSettingHandler;
}

public Task<List<TypeHintResource>?> GetResources(Recommendation recommendation, OptionSettingItem optionSetting) => Task.FromResult<List<TypeHintResource>?>(null);
public Task<TypeHintResourceTable> GetResources(Recommendation recommendation, OptionSettingItem optionSetting) => Task.FromResult(new TypeHintResourceTable());

public Task<object> Execute(Recommendation recommendation, OptionSettingItem optionSetting)
{
var settingValue = _consoleUtilities
.AskUserForValue(
string.Empty,
_optionSettingHandler.GetOptionSettingValue<string>(recommendation, optionSetting),
_optionSettingHandler.GetOptionSettingValue<string>(recommendation, optionSetting) ?? string.Empty,
allowEmpty: true,
resetValue: _optionSettingHandler.GetOptionSettingDefaultValue<string>(recommendation, optionSetting) ?? "",
validators: async executionDirectory => await ValidateExecutionDirectory(executionDirectory, recommendation, optionSetting));
Expand Down
Loading

0 comments on commit 5b78eca

Please sign in to comment.