CDCgov / prime-devops

Apache License 2.0
4 stars 2 forks source link

App Insights connection string is hard coded #36

Closed ronaldheft-gov closed 3 years ago

ronaldheft-gov commented 3 years ago

Occasionally, App Insights connection string may change. During the 4/15 incident, the string changed from:

InstrumentationKey=[omitted];IngestionEndpoint=https://eastus-1.in.applicationinsights.azure.com/

to:

InstrumentationKey=[omitted];IngestionEndpoint=https://eastus-5.in.applicationinsights.azure.com/

In our Terraform config this string is hard-coded (this is repeated in each environment): https://github.com/CDCgov/prime-simplereport/blob/main/ops/prod/api.tf#L21

We should not be hard-coding this value. It is available via an attribute: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/application_insights#connection_string

This ticket involves updating the connection string in each environment to use the outputted attribute.

jdorothy commented 3 years ago

Fixed in linked MR