Browse Source

Add context and architecture diagrams (#2999)

* Add context and architecture diagrams

* lint

* Update diagrams

* Add source for diagrams, link context diagram
pull/3005/head
kosiakkatrina 2 days ago committed by GitHub
parent
commit
3b291a9b92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 111
      docs/diagrams.md
  2. BIN
      docs/images/architecture_diagram.png
  3. BIN
      docs/images/context_diagram.png
  4. 3
      docs/infrastructure.md

111
docs/diagrams.md

@ -0,0 +1,111 @@
---
title: PlanUML source for diagrams
---
{% plantuml %}
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v19.0/dist
!include AWSPuml/AWSCommon.puml
!include AWSPuml/Groups/VPC.puml
!include AWSPuml/Groups/GenericOrange.puml
!include AWSPuml/Storage/SimpleStorageService.puml
!include AWSPuml/AWSSimplified.puml
!include AWSPuml/Groups/PublicSubnet.puml
!include AWSPuml/Groups/PrivateSubnet.puml
!include AWSPuml/Containers/ElasticContainerService.puml
!include AWSPuml/Database/RDS.puml
!include AWSPuml/Database/ElastiCacheElastiCacheforRedis.puml
!include AWSPuml/NetworkingContentDelivery/CloudFront.puml
!include AWSPuml/NetworkingContentDelivery/ElasticLoadBalancingApplicationLoadBalancer.puml
!include AWSPuml/Containers/ElasticContainerRegistry.puml
!include AWSPuml/Groups/AWSAccount.puml
' External Systems
actor User
' Main System: Meta Environment
AWSAccountGroup(meta, "Meta Environment") {
ElasticContainerRegistry(ecr, "ECR (Elastic Container Registry) - Shared between environments", "ECR (Elastic Container Registry)","")
}
VPCGroup(vpc) {
PublicSubnetGroup(public_subnet, "Public subnet") {
ElasticLoadBalancingApplicationLoadBalancer(loadBalancer, "Load Balancer", "Load Balancer", "")
}
PrivateSubnetGroup(private_subnet, "Private subnet") {
GenericOrangeGroup(fargateTasks, "ECS Fargate Tasks") {
ElasticContainerService(App, "App", "Container", "")
ElasticContainerService(Sidekiq, "Sidekiq", "Container", "")
ElasticContainerService(AdHocTasks, "Ad-hoc Tasks", "Container", "")
}
RDS(rdsDatabase, "RDS", "RDS","")
ElastiCacheElastiCacheforRedis(redis, "ElastiCache for Redis", "Redis","")
}
}
' Networking
SimpleStorageService(bulkUpload, "Bulk Upload", "Bulk upload bucket", "")
SimpleStorageService(cdsExport, "CDS Export", "CDS export bucket", "")
SimpleStorageService(collectionResources, "Collection resources", "Collection resources bucket", "")
CloudFront(cloudFront, "CloudFront", "CloudFront", "")
' Relationships
User --> [cloudFront] : Interacts with
[loadBalancer] --> [fargateTasks] : Routes traffic to
[ecr] --> [fargateTasks] : Pulls Docker images from
[cloudFront] --> [loadBalancer] : Routes traffic to
[fargateTasks] --> [bulkUpload] : Uploads data to
[fargateTasks] --> [cdsExport] : Exports data to
[fargateTasks] --> [collectionResources] : Reads/writes data to
[fargateTasks] --> [rdsDatabase] : Writes data to
[fargateTasks] --> [redis] : Caches data in
{% endplantuml %}
---
{% plantuml %}
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v19.0/dist
!include AWSPuml/AWSCommon.puml
!include AWSPuml/Storage/SimpleStorageService.puml
!include AWSPuml/Groups/GenericOrange.puml
!define SPRITESURL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/sprites
!define IMAGESSURL https://raw.githubusercontent.com/plantuml-stdlib/gilbarbara-plantuml-sprites/v1.1/pngs
!includeurl SPRITESURL/sentry.puml
!includeurl SPRITESURL/google-analytics.puml
!include AWSPuml/Containers/ElasticContainerService.puml
!include AWSPuml/AWSSimplified.puml
skinparam actorPadding 15
skinparam packagePadding 20
skinparam componentPadding 20
skinparam rectanglePadding 20
rectangle "<img:IMAGESSURL/google-analytics.png>" as ga
rectangle "<img:IMAGESSURL/sentry.png>" as sentry
rectangle "GOV.UK Notify" as notify
rectangle "OS Places API" as osapi
rectangle "CDS Ingest Pipeline" as cds
actor "End Users" as Users
actor "Support Users" as SupportUsers
' Main System: Application Package
package "Application" {
ElasticContainerService(App, "App", "Container", "")
SimpleStorageService(cdsExport, "CDS Export", "CDS export bucket", "")
}
' Relationships and interactions
Users --> [App] : Provides data, downloads CSVs
SupportUsers --> [App] : Support tasks, file downloads
[App] --> [notify] : Email notifications
[App] --> [sentry] : Alerts
[App] --> [osapi] : Address lookup
[cds] --> [cdsExport] : Downloads data for processing
[App] --> [ga] : Sends analytics data to Google Analytics
{% endplantuml %}

BIN
docs/images/architecture_diagram.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

BIN
docs/images/context_diagram.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

3
docs/infrastructure.md

@ -118,3 +118,6 @@ Things to watch out for when destroying/creating infra:
- After destroying the db, you’ll need to make sure the ad hoc ECS task which seeds the database gets run in order to set up the database correctly. - After destroying the db, you’ll need to make sure the ad hoc ECS task which seeds the database gets run in order to set up the database correctly.
- SNS - SNS
- When creating an email subscription in an environment, Terraform will look up the email to use as the subscription endpoint from Secrets Manager. If you haven’t already created this (e.g. by running terraform apply -target="module.monitoring" -var="create_secrets_first=true") then this will lead to the subscription creation erroring, because it can’t retrieve the value of the secret (because it doesn’t exist yet). If this happens, remember you’ll need to go to Secrets Manager in the console and enter the desired email (as plaintext, no quotation marks or anything else required) as the value of the secret (which is most likely called MONITORING_EMAIL). Then run another apply with Terraform and this time it should succeed. - When creating an email subscription in an environment, Terraform will look up the email to use as the subscription endpoint from Secrets Manager. If you haven’t already created this (e.g. by running terraform apply -target="module.monitoring" -var="create_secrets_first=true") then this will lead to the subscription creation erroring, because it can’t retrieve the value of the secret (because it doesn’t exist yet). If this happens, remember you’ll need to go to Secrets Manager in the console and enter the desired email (as plaintext, no quotation marks or anything else required) as the value of the secret (which is most likely called MONITORING_EMAIL). Then run another apply with Terraform and this time it should succeed.
![Architecture Diagram](https://raw.githubusercontent.com/communitiesuk/submit-social-housing-lettings-and-sales-data/main/docs/images/architecture_diagram.png)
![Context Diagram](https://raw.githubusercontent.com/communitiesuk/submit-social-housing-lettings-and-sales-data/main/docs/images/context_diagram.png)

Loading…
Cancel
Save