...
Pick a name. It should follow the convention:
frontend-app-XXX
.We have a GitHub template repository to help bootstrap your new application.
If you have permission to create new repositories:
Click the "Use this template" button.
Put in your chosen micro-frontend application name.
Make sure to create it in the edX organization.
If you do not have permission to create a new repository:
Get someone to do the above steps for you. You can read through How to request a new GitHub Repo to find a way to get someone to help you.
Do a find and replace in your new repository to replace frontend-template-application with frontend-app-XXX.
Similarly, there's an example module which demonstrates a basic module. Feel free to rename the "example" directory or delete it.
Add a link to your new repo to Frontend Repos.
If you are replacing an existing legacy frontend, update MFE Rewrite Status accordingly.
...
Setup Automated Deployment
...
In edx/terraform, create two files:
plans/edx/prod-frontends/frontend-app-XXXXX.tf
Code Block variable "frontend_app_XXXXX_hostname" { type = string description = "Hostname of the frontend-app-XXXXX used for bucket naming and routing" } module "frontend_app_XXXXX_frontend" { source = "../../../modules/frontends/frontend" cloudflare_record_name = "XXXXX" route53_zone_id = var.route53_zone_id_edx_org frontend_hostname = var.frontend_app_XXXXX_hostname internal_frontend_hostname = "${var.environment}-XXXXX.edx.org" aws_region = var.aws_region deployer_user = aws_iam_user.frontend_deployer_user.arn cloudflare_zone_id = var.cloudflare_zone_id_edx_org cdn_type = "cloudflare" }
plans/edx/stage-frontends/frontend-app-XXXXX.tfCode Block variable "frontend_app_XXXXX_hostname" { type = string description = "Hostname of the frontend-app-XXXXX used for bucket naming and routing" } module "frontend_app_XXXXX_frontend" { source = "../../../modules/frontends/frontend" cloudflare_record_name = "XXXXX.stage" route53_zone_id = var.route53_zone_id_edx_org frontend_hostname = var.frontend_app_XXXXX_hostname internal_frontend_hostname = "${var.environment}-XXXXX.edx.org" aws_region = var.aws_region deployer_user = aws_iam_user.frontend_deployer_user.arn cloudflare_zone_id = var.cloudflare_zone_id_edx_org cdn_type = "cloudflare" }
Note the only difference between the stage plan and the prod plan is the
cloudflare_record_name
. For examples, see the existingplans/edx/prod-frontends/frontend-app-*
configurations.Add variables for your application for stage and prod:
plans/edx/prod-frontends/terraform.tfvars
Code Block ... # frontend-app-XXXXX frontend_app_XXXXX_hostname = "YYYYY.edx.org"
plans/edx/stage-frontends/terraform.tfvarsCode Block ... # frontend-app-XXXXX frontend_app_XXXXX_hostname = "YYYYY.stage.edx.org"
Optional for edge deployment
...