-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update core and dotnet infra docs (#569)
* update azure infra docs * add aws infra docs * fix: linting
- Loading branch information
1 parent
0281e68
commit 8ae2c2a
Showing
15 changed files
with
305 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
id: core_infrastructure_aws | ||
title: AWS Core Infrastructure | ||
sidebar_label: Core Infrastructure | ||
description: How to bootstrap the Azure tenant | ||
keywords: | ||
- github actions | ||
- workload | ||
- pipeline | ||
- pipeline template | ||
- resources | ||
--- | ||
|
||
import HideNavigation from "../../../src/components/HideNavigation/HideNavigation"; | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
||
The core infrastructure is the foundation for all other Ensono Stacks Workloads. As, in most cases, this will be the first part of Ensono Stacks that you deploy we will also cover bootstrapping your AWS tenant. | ||
|
||
## Resources Provisioned | ||
|
||
Both the diagram and resource list below are for a single environment. By default, the pipeline template will create two environments (nonprod and prod). | ||
|
||
### Diagram | ||
|
||
<img alt="AWS Core Infrastructure" src={useBaseUrl('img/aws_core_infrastructure.png')} /> | ||
|
||
### Resource List | ||
|
||
| Resource | Description | | ||
| --------------------- | --------------------------------------------------- | | ||
| Virtual Private Cloud | Fundamental building block for the network | | ||
| Public Subnet | Dedicated subnet required for Network Load Balancer | | ||
| Network Load Balancer | Web traffic load balancer | | ||
| Private Subnet | Subnet used by the EKS cluster | | ||
| EKS | Amazon Elastic Kubernetes Service | | ||
| Route 53 | Hosted service for DNS domain | | ||
| IAM | Identity and access management | | ||
| KMS | Cryptographic keys and secrets management service | | ||
|
||
## Deploying | ||
|
||
### Bootstrap the AWS tenant | ||
|
||
This process only needs to be run once on an administrators workstation. | ||
|
||
The administrator will need the permissions that allow them to: | ||
|
||
1. Create an IAM User for use with Terraform. This will require permissions to read and create all the core resources. | ||
- Make note of the Access Key ID and Secret Access Key | ||
2. Create an [S3 Bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) for storing Terraform state. | ||
- Take note of the S3 bucket name. | ||
3. Create a [DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/getting-started-step-1.html) table for locking Terraform state. | ||
|
||
### Pipelines | ||
|
||
The following pipelines are currently supported for automating the deployment: | ||
|
||
- [GitHub Actions](./pipelines/github_actions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
id: github_actions | ||
title: GitHub Actions Pipeline | ||
sidebar_label: GitHub Actions | ||
description: How do you set up a pipeline in GitHub Actions | ||
keywords: | ||
- workload | ||
- pipeline | ||
- github actions | ||
- pipeline template | ||
--- | ||
|
||
import HideNavigation from "../../../../src/components/HideNavigation/HideNavigation"; | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
||
The pipeline will automate provisioning and updating the core infrastructure in AWS. This page assumes you have already completed the steps on the [core infrastructure page](../core_infrastructure.md). | ||
|
||
The AWS infrastructure source code can be found [here](https://github.com/Ensono/stacks-infrastructure-eks). | ||
|
||
## Pipeline Diagram | ||
|
||
### Feature branch -> Non-Prod sequence | ||
|
||
<img alt="AWS Core - GitHub Actions Pipeline" src={useBaseUrl('img/core_pipeline_nonprod.png')} /> | ||
|
||
### Main branch -> Prod sequence | ||
|
||
<img alt="AWS Core - GitHub Actions Pipeline" src={useBaseUrl('img/core_pipeline_prod.png')} /> | ||
|
||
## Setting up GitHub Actions | ||
|
||
### Environment Secrets | ||
|
||
Environment secrets will need creating for storing some sensitive variables to be used by the pipeline. Instructions for creating a environment secrets can be found [here](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment#environment-secrets). | ||
|
||
Add the following secrets: | ||
|
||
| Variable Name | Description | Required for | | ||
| ------------------------ | ------------------------------------------------- | -------------------------- | | ||
| AWS_ACCESS_KEY_ID | AWS IAM User Access Key ID | AWS Authentication | | ||
| AWS_ACCOUNT_ID | AWS Account ID | AWS Authentication | | ||
| AWS_SECRET_ACCESS_KEY | AWS IAM User Secret Access Key | AWS Authentication | | ||
| AWS_TF_STATE_BUCKET | S3 Bucket name for Terraform state | Terraform State Management | | ||
| AWS_TF_STATE_DYNAMOTABLE | DynamoDB Table name for Terraform state | Terraform State Management | | ||
| AWS_TF_STATE_ENCRYPTION | Encrypt Terraform state. `true` or `false` | Terraform State Management | | ||
| AWS_TF_STATE_KEY | Unique name for this applications Terraform state | Terraform State Management | | ||
| AWS_TF_STATE_REGION | AWS region | Terraform State Management | | ||
|
||
### Update pipeline template placeholders | ||
|
||
Where possible, the Stacks CLI will have populated the correct values in the pipeline environment file `.github/workflows/infrastructure.env`. We very much recommend that you go through the whole `.github/workflows` directory to make sure that values are correct for your project. Once you are happy with the template, commit the changes to your repository. | ||
|
||
### Create the pipeline | ||
|
||
Stacks generates the GitHub Actions workflow file in the directory expected by GitHub Actions, `.github/workflows`. Committing this file to the `main` branch of a GitHub repository will "create" the pipeline. Instructions for viewing the results can be found [here](https://docs.github.com/en/actions/writing-workflows/quickstart#viewing-your-workflow-results) | ||
|
||
<HideNavigation next /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
docs/workloads/azure/backend/netcore/infrastructure_aws_netcore.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
id: infrastructure_aws_netcore | ||
title: .NET - AWS Infrastructure | ||
sidebar_label: AWS Infrastructure | ||
description: High level design of the reference implementation of the .NET Ensono Stacks REST API with CQRS. | ||
keywords: | ||
- .net | ||
- rest api | ||
- cqrs | ||
- pipeline | ||
- aws | ||
- elastic container registry | ||
- elastic kubernetes service | ||
- dynamodb | ||
- deployment | ||
--- | ||
|
||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
||
## Overview | ||
|
||
This page present the high level design of the reference implementation of the .NET Ensono Stacks REST API with CQRS. | ||
|
||
<!-- **This page assumes that the core infrastructure has already been provisioned. Instructions and additional information on the core infrastructure can be found [here](../../../../infrastructure/aws/core_infrastructure.md)** --> | ||
|
||
Both the diagram and resource list below are for a single environment. | ||
|
||
### Diagram | ||
|
||
<img alt="AWS .NET API Infrastructure" src={useBaseUrl('img/aws_rest_api_infrastructure.png')} /> | ||
|
||
### Resource List | ||
|
||
| Resource | Description | | ||
| ---------------------- | ---------------------------------------------------------------------------------------------------- | | ||
| EKS **\*** | Amazon Elastic Kubernetes Service | | ||
| Public DNS Record | DNS record pointing Ingress (via application load balancer **\*** and internal load balancer **\***) | | ||
| ECR **\*** | Elastic Container Registry | | ||
| Namespace: `{env}-api` | Kubernetes namespace for the environment | | ||
| Ingress | Kubernetes Ingress to handle routing to Service | | ||
| Service | Kubernetes Service to handle routing to Deployment Pods | | ||
| Deployment | Kubernetes Deployment for managing Pods | | ||
| DynamoDB | Amazon managed NoSQL database | | ||
|
||
**\*** _Resource is created by the core infrastructure deployment._ | ||
|
||
## Deploying | ||
|
||
All infrastructure is deployed using [Terraform](https://www.terraform.io/) that is included with the generated code. | ||
|
||
### Pipelines | ||
|
||
The following pipelines are currently supported for automating the deployment: | ||
|
||
- [GitHub Action](./pipeline_gha_netcore.md) |
Oops, something went wrong.