Skip to content

Commit

Permalink
Typo, service name, and consistency updates
Browse files Browse the repository at this point in the history
Corrected service names, fixed various typos, and used consistent indenting for all sample commands and snippets to make them easier to copy.
Clarified where to place custom resources in CDK project.
  • Loading branch information
stevejroberts authored and ashovlin committed Nov 28, 2022
1 parent 85cd503 commit 92ba3c5
Show file tree
Hide file tree
Showing 23 changed files with 470 additions and 401 deletions.
3 changes: 2 additions & 1 deletion site/content/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ Material for MkDocs is a theme for MkDocs, a static site generator geared toward
```
pip install mkdocs-material
```

For, other installation options [see here](https://squidfunk.github.io/mkdocs-material/getting-started/)

### Deploying to a Local Server
MkDocs comes with a built-in dev-server that lets you preview your documentation as you work on it.
MkDocs comes with a built-in dev-server that lets you preview your documentation as you work on it.

From the root of the project repository, run the following command:
```
Expand Down
17 changes: 10 additions & 7 deletions site/content/docs/cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ You can use AWS Deploy Tool when developing your app using any Continuous Deploy

To turn off the interactive features, use the `-s (--silent)` switch. This will ensure the tool never prompts for any questions that could block an automated process.

dotnet aws deploy --silent
```
dotnet aws deploy --silent
```

### Creating a deployment settings file

Expand Down Expand Up @@ -38,21 +40,23 @@ Here's an example of a web application with the following directory structure:
┗ MyWebApplication.sln

To perform a deployment and also persist the deployment configuration to a JSON file, use the following command:

```
dotnet aws deploy --project-path MyWebApplication/MyWebApplication/MyWebApplication.csproj --save-settings deploymentsettings.json
```

This will create a JSON file at `MyWebApplication/MyWebApplication/deploymentsettings.json` with the following structure:
```

```json
{
"AWSProfile": <AWS_PROFILE>
"AWSRegion": <AWS_REGION>,
"ApplicationName": <APPLICATION_NAME>,
"RecipeId": <RECIPE_ID>
"Settings": <JSON_BLOB>
}
```

* _**AWSProfile**_: The name of the AWS profile that was used during deployment.

* _**AWSRegion**_: The name of the AWS region where the deployed application is hosted.
Expand Down Expand Up @@ -89,7 +93,6 @@ dotnet aws deploy --project-path <PROJECT_PATH> --apply <SETTINGS_FILE_PATH>

To deploy the application with the above directory structure in CI/CD pipeline without any prompts, use the following command:

dotnet aws deploy --silent --project-path MyWebApplication/MyWebApplication/MyWebApplication.csproj --apply deploymentsettings.json



```
dotnet aws deploy --silent --project-path MyWebApplication/MyWebApplication/MyWebApplication.csproj --apply deploymentsettings.json
```
11 changes: 8 additions & 3 deletions site/content/docs/commands/delete.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# delete-deployment command

### Usage
dotnet aws delete-deployment - Tears down the application stack.

`dotnet aws delete-deployment` - Tears down the application stack.

### Synopsis
dotnet aws delete-deployment <APPLICATION-NAME> [-d|--diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [-?|-h|--help]

```
dotnet aws delete-deployment <APPLICATION-NAME> [-d|--diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [-?|-h|--help]
```
### Description
Tears down the application stack.

### Examples

dotnet aws delete-deployment MY_APPLICATION --region us-west-2
```
dotnet aws delete-deployment MY_APPLICATION --region us-west-2
```
21 changes: 15 additions & 6 deletions site/content/docs/commands/deploy.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# deploy command

### Usage
dotnet aws deploy - Inspect, build, and deploy the .NET project to AWS using the chosen AWS compute.


`dotnet aws deploy` - Inspect, build, and deploy the .NET project to AWS using the chosen AWS compute.

### Synopsis
dotnet aws deploy [-d|—-diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [--project-path <PROJECT-PATH>] [[--save-settings|--save-all-settings] <SETTINGS-FILE-PATH>] [--application-name <CLOUD-APPLICATION-NAME>] [--apply <PATH-TO-DEPLOYMENT-SETTINGS>] [--deployment-project <CDK-DEPLOYMENT-PROJECT-PATH>] [-?|-h|--help]

```
dotnet aws deploy [-d|—-diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [--project-path <PROJECT-PATH>] [[--save-settings|--save-all-settings] <SETTINGS-FILE-PATH>] [--application-name <CLOUD-APPLICATION-NAME>] [--apply <PATH-TO-DEPLOYMENT-SETTINGS>] [--deployment-project <CDK-DEPLOYMENT-PROJECT-PATH>] [-?|-h|--help]
```

### Description
Inspects the project and recommends AWS compute that is most suited to the type of deployed application. Then builds the project, generates a deployment CDK project to provision the required infrastructure, and deploys the .NET project to AWS using the chosen AWS compute.
Expand All @@ -13,10 +18,14 @@ Inspects the project and recommends AWS compute that is most suited to the type

Deploying HelloWorld

dotnet new web -n HelloWorld -f net6.0
cd HelloWorld
dotnet aws deploy
```
dotnet new web -n HelloWorld -f net6.0
cd HelloWorld
dotnet aws deploy
```

Deploying application to a non-default profile

dotnet aws deploy --profile myCustomProfile --region us-east1
```
dotnet aws deploy --profile myCustomProfile --region us-east1
```
13 changes: 9 additions & 4 deletions site/content/docs/commands/list.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# list-deployments command

### Usage
dotnet aws list-deployments - Lists available cloud applications that were deployed using AWS Deploy Tool

`dotnet aws list-deployments` - Lists available cloud applications that were deployed using AWS Deploy Tool

### Synopsis
dotnet new list-deployments [-d|--diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [-?|-h|--help]

```
dotnet new list-deployments [-d|--diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [-?|-h|--help]
```

### Description
Lists available cloud applications that were deployed using AWS Deploy Tool.

### Examples

dotnet aws list-deployments --region us-west-2

```
dotnet aws list-deployments --region us-west-2
```
13 changes: 9 additions & 4 deletions site/content/docs/commands/project.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# deployment-project generate command

### Usage
dotnet aws deployment-project - Generates and saves the deployment CDK project in the user provided location.

`dotnet aws deployment-project` - Generates and saves the deployment CDK project in the user provided location.

### Synopsis
dotnet aws deployment-project generate [-d|--diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [--project-path <PROJECT-PATH>] [--project-display-name <DISPLAY-NAME>]

```
dotnet aws deployment-project generate [-d|--diagnostics] [-s|--silent] [--profile <PROFILE>] [--region <REGION>] [--project-path <PROJECT-PATH>] [--project-display-name <DISPLAY-NAME>]
```

### Description
Generates and saves the [deployment CDK project](../deployment-projects/index.md) in a user provided directory path without proceeding with a deployment. Allows user to customize the CDK project before deploying the application.
Expand All @@ -16,5 +20,6 @@ Generates and saves the [deployment CDK project](../deployment-projects/index.md

This example creates a deployment project from the .NET project in the current directory. The deployment project will be saved to a sibling directory called CustomDeploymentProject. The name _"Team custom deployment project"_ will be displayed in the list of the available deployment options.

dotnet aws deployment-project generate --output ../CustomDeploymentProject --project-display-name "Team custom deployment project"

```
dotnet aws deployment-project generate --output ../CustomDeploymentProject --project-display-name "Team custom deployment project"
```
10 changes: 7 additions & 3 deletions site/content/docs/commands/server-mode.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# server-mode command

### Usage
dotnet aws server-mode - Launches the tool in a server mode for integrations with IDE, for example Visual Studio.

`dotnet aws server-mode` - Launches the tool in a server mode for integrations with IDE, for example Visual Studio.

### Synopsis
dotnet aws server-mode [-d|--diagnostics] [-s|--silent] [-?|-h|--help] [--port <PORT>] [--parent-pid <PARENT-PID>] [--unsecure-mode]

```
dotnet aws server-mode [-d|--diagnostics] [-s|--silent] [-?|-h|--help] [--port <PORT>] [--parent-pid <PARENT-PID>] [--unsecure-mode]
```

### Description
Starts the tool in the server mode to provide integration with IDEs, for example Visual Studio. This tool is not intended for the end user usage unless you are writing a custom integration into an IDE.
Starts the tool in the server mode to provide integration with IDEs, for example Visual Studio. This tool is not intended for end user usage unless you are writing a custom integration into an IDE.

### Examples
```
Expand Down
14 changes: 7 additions & 7 deletions site/content/docs/deployment-projects/cdk-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ The following links are useful resources to learn more about AWS CDK and how to

The layout of the generated CDK project puts all the code that was used to create the AWS resources defined in the starting recipe in a directory called **Generated**.

![Catagories in AWS Toolkit for Visual Studio](../../assets/images/deployment-project-file-layout.png)
![Categories in AWS Toolkit for Visual Studio](../../assets/images/deployment-project-file-layout.png)

It is recommended to not modify the code in the `Generated` directory to make it easier to merge future changes from the starting recipe into your custom deployment project. If you do not intend to update your custom deployment project from the original built-in recipe you may modify the code or rearrange the directory layout.

If you choose to not modify the `Generated` code it is recommended to customize the CDK project starting from the `AppStack` class. Here is the constructor of `AppStack`.

```
```csharp
internal AppStack(Construct scope, IDeployToolStackProps<Configuration> props)
: base(scope, props.StackName, props)
{
Expand All @@ -45,13 +45,15 @@ internal AppStack(Construct scope, IDeployToolStackProps<Configuration> props)
}
```

The `var generatedRecipe = new Recipe(this, props.RecipeProps);` line of code creates all of the AWS resources from the `Generated` directory. Your customizations could create new AWS resources via CDK constructs before or after this line. Typically you would create new resources before this line if you want those resources to be connected to the resources defined in the `Recipe` type. If you need to create new resources that are connected to the resources defined in the `Recipe` then create them after this line. The instance of `Recipe` has public properties for all of the resources that were created in the `Recipe`.
The `var generatedRecipe = new Recipe(this, props.RecipeProps);` statement creates all of the AWS resources specified in the CDK code in the `Generated` directory. Your customizations can create additional custom AWS resources from CDK constructs either before or after this statement.

If you have custom resources you want to connect to resources generated by the recipe, create your custom resource before the statement. For example, you might want to set an environment variable in a container definition to the name of a custom DynamoDB table. In that scenario, your custom table should be created before the statement. However, if you want to connect a custom resource to a resource created by the recipe, create the custom resource after the statement. An example might be connecting a custom Amazon CloudFront distribution to an Application Load Balancer created in a recipe. Custom resources that have no connection to the resources created by the recipe can be added before, or after, the statement.

In this constructor a callback method called `CustomizeCDKProps` is setup. This callback method is called right before any constructs are created from the `Recipe`. This allows modifying the construct's property object before it is passed into the construct.

The example below shows the `CustomizeCDKProps` callback that checks to see if the resource being created is the Beanstalk Environment. If it is, cast the property object to the appropriate property object and then make whatever customizations are needed.

```
```csharp
private void CustomizeCDKProps(CustomizePropsEventArgs<Recipe> evnt)
{
if (string.Equals(evnt.ResourceLogicalName, nameof(evnt.Construct.BeanstalkEnvironment)))
Expand All @@ -72,7 +74,7 @@ With the configuration read from the deploy tool, the CDK environment is set to

The other major difference from normal CDK projects is the call to `CDKRecipeSetup.RegisterStack`. This is required to stamp the CloudFormation stack with the recipe id that created the stack. Future redeployments can only update existing stacks that were created by the original recipe. It also serializes the settings collected from the deploy tool into the metadata for the CloudFormation stack so redeployments can use the previous settings used for deployment.

```
```csharp
public static void Main(string[] args)
{
var app = new App();
Expand Down Expand Up @@ -105,5 +107,3 @@ The option settings that are defined in the [recipe file](recipe-file.md) are pa
When you add new settings to the recipe file, you also need to add the `Id` of the new settings to the `Configuration` object. If you added an `Object` setting with a collection of child settings, first create a new type representing that entire `Object`. For reach child setting id, add a property on the new type. Finally, add a new property on `Configuration` for your new type with the property name being the id of the `Object` setting.

The `Configuration` object follows the same `Generated` directory pattern described above. Custom settings should be added to the partial `Configuration.cs` file outside of the `Generated` directory.


18 changes: 9 additions & 9 deletions site/content/docs/deployment-projects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

### What is a deployment recipe?

The tool provides intelligent deployment recommendations that are tailored to your specific .NET application. The recommendation rules are defined in the `deployment recipes`. These recipes let you configure a pre-defined set of AWS resources related to your application such as IAM roles, virtual private clouds, load balancers, and other.
The tool provides intelligent deployment recommendations that are tailored to your specific .NET application. The recommendation rules are defined in the `deployment recipes`. These recipes let you configure a pre-defined set of AWS resources related to your application such as IAM roles, virtual private clouds, load balancers, and more.

There is a built-in recipe for [each supported project type](../support.md). All recipe definitions are available [on GitHub](https://github.com/aws/aws-dotnet-deploy/tree/main/src/AWS.Deploy.Recipes/RecipeDefinitions).

### What is a deployment project?

What if your application uses additional AWS resources that are not included in the built-in recipe, such as DynamoDB tables or SQS queues? In this case, you can extend one of the existing recipes and create a custom `deployment project` to manage additional AWS resources and services.
What if your application uses additional AWS resources that are not included in the built-in recipe, such as Amazon DynamoDB tables or Amazon SQS queues? In this case, you can extend one of the existing recipes and create a custom `deployment project` to manage additional AWS resources and services.

Once you create and customize your deployment project, it will be displayed alongside the built-in recipes as a custom deployment option.

Expand All @@ -24,25 +24,25 @@ Once you create and customize your deployment project, it will be displayed alon

A deployment project consists of two parts. For details, refer to the full reference guides below.

* [Recipe file](./recipe-file.md) - a JSON configuration file that drives the deployment experience.
* [Recipe file](./recipe-file.md) - a JSON configuration file that drives the deployment experience.
* [.NET CDK project](./cdk-project.md) - a C# project that uses the [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) to define the infrastructure that will be created.

### Creating a deployment project

To create a custom deployment project, run this command in the directory of the .NET project you wish to deploy. See [`deployment-project` command](../commands/project.md) for more details.

dotnet aws deployment-project generate --output <output-directory> --project-display-name <display-name>
```
dotnet aws deployment-project generate --output <output-directory> --project-display-name <display-name>
```

The list of built-in recipes that are compatible with your .NET project will be displayed. Select the recipe that you will use to customize, and a deployment project will be created in the `--output` directory.
The list of built-in recipes that are compatible with your .NET project will be displayed. Select the recipe that you want to customize, and a deployment project will be created in the `--output` directory.

> Note: It is important to add your deployment projects to source control. If your deployment project has been deleted, you will not be able to re-deploy your application to the same CloudFormation stack.
Now you can begin customizing the deployment project. See our [step-by-step tutorial](../../tutorials/custom-project.md) for a step-by-step instructions.
Now you can begin customizing the deployment project. See our [step-by-step tutorial](../../tutorials/custom-project.md) for instructions.

### Searching for deployment projects

When you run the `dotnet aws deploy` command, the tool searches for deployment projects anywhere underneath the solution (.sln) directory of project you are deploying. It also ensures that each deployment project iscompatible with the .NET project being deployed.
When you run the `dotnet aws deploy` command, the tool searches for deployment projects anywhere underneath the solution (.sln) directory of project you are deploying. It also ensures that each deployment project is compatible with the .NET project being deployed.

To point to a deployment project that is outside the solution directory, use the `--deployment-project` switch to pass in the path of the deployment project to use. This is common when sharing deployment projects across multiple solutions.


Loading

0 comments on commit 92ba3c5

Please sign in to comment.