Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize env files in app-config to make it clearer what needs to be configured #726

Open
rocketnova opened this issue Aug 8, 2024 · 5 comments
Labels
scope: operations Platform operations. Does not affect projects type: devex Developer experience

Comments

@rocketnova
Copy link
Contributor

Currently, the env files in /infra/app/app-config look like this:

module "dev_config" {
source = "./env-config"
project_name = local.project_name
app_name = local.app_name
default_region = module.project_config.default_region
environment = "dev"
network_name = "dev"
domain_name = null
enable_https = false
has_database = local.has_database
has_incident_management_service = local.has_incident_management_service
# Enable and configure identity provider.
enable_identity_provider = local.enable_identity_provider
# Support local development against the dev instance.
extra_identity_provider_callback_urls = ["http://localhost"]
extra_identity_provider_logout_urls = ["http://localhost"]
# Enables ECS Exec access for debugging or jump access.
# See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html
# Defaults to `false`. Uncomment the next line to enable.
# enable_command_execution = true
}

As we add more features, we should consider how to make it clearer to the project admin what values they need to set and what values they should leave alone.

@rocketnova
Copy link
Contributor Author

@lorenyu @coilysiren @doshitan Maybe something like this?

module "dev_config" {
  source = "./env-config"

  ######################################################################
  # Configuration for this environment.
  ######################################################################
  domain_name  = "platform-test-dev.navateam.com"
  enable_https = true

  # Enables ECS Exec access for debugging or jump access.
  # See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html
  # Defaults to `false`. Uncomment the next line to enable.
  # enable_command_execution = true

  ######################################################################
  # Sensible defaults.
  ######################################################################
  environment  = "dev"
  network_name = "dev"

  # If enable_identity_provider is `true`, you can change these values to modify the
  # urls that AWS Cognito will redirect to on login and logout.
  # Support local development against the dev instance.
  extra_identity_provider_callback_urls = ["http://localhost"]
  extra_identity_provider_logout_urls   = ["http://localhost"]

  ######################################################################
  # Do not modify.
  ######################################################################
  # To change this value, update /infra/project-config/main.tf.
  default_region = module.project_config.default_region

  # To change these values, update /infra/app/app-config/main.tf.
  project_name                    = local.project_name
  app_name                        = local.app_name
  has_database                    = local.has_database
  has_incident_management_service = local.has_incident_management_service
  enable_identity_provider        = local.enable_identity_provider
  enable_notifications            = local.enable_notifications
}

@rocketnova rocketnova added type: devex Developer experience scope: operations Platform operations. Does not affect projects labels Aug 8, 2024
@lorenyu
Copy link
Contributor

lorenyu commented Aug 9, 2024

Nice insight, this seems like a good direction

@coilysiren
Copy link
Contributor

coilysiren commented Aug 9, 2024

Configuration for this environment. => Configuration unique to this environment.

Sensible defaults => Sensible defaults, you likely won't need to change these

^ some low pri wording suggestions

EDIT: actually I don't like my own suggestions all that much 😆

otherwise, looking great! ✨

@rocketnova
Copy link
Contributor Author

EDIT: actually I don't like my own suggestions all that much 😆

I think they are also good! I don't feel strongly about the exact wording, so perhaps we can ask a content strategist. I think the gist of it is:

  • change these!
  • you probably won't need to change these
  • do not change these

@rocketnova
Copy link
Contributor Author

I haven't thought a lot about this, but it's probably worth considering whether there's a way for us to separate the "do not change these" into a separate file from the rest of them. Perhaps by rethinking the relationships between project-config, app-config, and dev-config.

That might re-architect a lot more stuff and would definitely be a separate issue. I think the easy first step is to just re-organize the existing file without directly impacting those relationships.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: operations Platform operations. Does not affect projects type: devex Developer experience
Projects
None yet
Development

No branches or pull requests

3 participants