Skip to content

Commit

Permalink
Merge pull request #28850 from ministryofjustice/add-appinsights-tf-t…
Browse files Browse the repository at this point in the history
…o-visits-backend-staging

Add appinsights.tf to fix failing build.
  • Loading branch information
dhirajshettymoj authored Jan 15, 2025
2 parents c0a011c + b1fa967 commit 59d2c71
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
data "aws_ssm_parameter" "application_insights_key" {
# var.environment should be set to one of dev, preprod or prod
# otherwise the key has to be hard-coded e.g. key-preprod if environment set to 'pre-production'.
name = "/application_insights/key-dev"
}

resource "kubernetes_secret" "application-insights" {
metadata {
name = "application-insights"
namespace = var.namespace
}
data = {
APPINSIGHTS_INSTRUMENTATIONKEY = data.aws_ssm_parameter.application_insights_key.value
APPLICATIONINSIGHTS_CONNECTION_STRING = "InstrumentationKey=${data.aws_ssm_parameter.application_insights_key.value}"
}
}

0 comments on commit 59d2c71

Please sign in to comment.