Skip to content

Commit

Permalink
Merge code freeze branch to Master (#406)
Browse files Browse the repository at this point in the history
* PUB-2245 - Updated README (#398)

* PUB-2182 add terraform_format.yml (#400)

* PUB-2182 add terraform_format.yml

* Automated Change

---------

Co-authored-by: NatashaAlker <[email protected]>

---------

Co-authored-by: ChrisS1512 <[email protected]>
Co-authored-by: Natasha <[email protected]>
Co-authored-by: NatashaAlker <[email protected]>
  • Loading branch information
4 people authored Jan 8, 2024
1 parent 109f970 commit e298944
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 16 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/terraform_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Format terraform files

permissions:
contents: write

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
format:
runs-on: ubuntu-latest
name: Check terraform file are formatted correctly
steps:
- name: Checkout
uses: actions/checkout@v3

- name: terraform fmt
uses: dflook/terraform-fmt@v1

- name: commit format changes to branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated Change
commit_user_name: Terraform format GitHub Actions Bot
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- [Overview](#overview)
- [Features and Functionality](#features-and-functionality)
- [GOV.UK Notify](#gov-uk-notify)
- [GOV.UK Notify](#govuk-notify)
- [Subscription Fulfillment](#subscription-fulfillment)
- [Third Party Publisher](#third-party-publisher)
- [Roles](#roles)
Expand Down Expand Up @@ -267,7 +267,9 @@ The client at runtime is attached as a javaagent, which allows it to send the lo
To connect to app insights a connection string is used. This is configured to read from the KV Secret mounted inside the pod.

It is possible to connect to app insights locally, although somewhat tricky. The easiest way is to get the connection string from azure, set it as an environment variable (APPLICATIONINSIGHTS_CONNECTION_STRING), and add in the javaagent as VM argument. You will also need to remove / comment out the connection string line the config.

## Security & Quality Considerations

We use a few automated tools to ensure quality and security within the service. A few examples can be found below:

- SonarCloud - provides automated code analysis, finding vulnerabilities, bugs and code smells. Quality gates ensure that test coverage, code style and security are maintained where possible.
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/demo.tfvars
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env="demo"
env = "demo"
10 changes: 5 additions & 5 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ locals {
env_long_name = var.env == "sbox" ? "sandbox" : var.env == "stg" ? "staging" : var.env
env_subdomain = local.env_long_name == "prod" ? "" : "${local.env_long_name}."

base_url = "${var.product}-${var.component}.${local.env_subdomain}platform.hmcts.net"
prefix = "${var.product}-ss"
base_url = "${var.product}-${var.component}.${local.env_subdomain}platform.hmcts.net"
prefix = "${var.product}-ss"

apim_name = "sds-api-mgmt-${local.env}"
apim_rg = "ss-${local.env}-network-rg"
apim_name = "sds-api-mgmt-${local.env}"
apim_rg = "ss-${local.env}-network-rg"

deploy_apim = local.env == "stg" || local.env == "demo" || local.env == "test" || local.env == "sbox" || local.env == "prod" ? 1 : 0
deploy_apim = local.env == "stg" || local.env == "demo" || local.env == "test" || local.env == "sbox" || local.env == "prod" ? 1 : 0
}
2 changes: 1 addition & 1 deletion infrastructure/prod.tfvars
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env="prod"
env = "prod"
8 changes: 4 additions & 4 deletions infrastructure/providers.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.83.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.83.0"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/stg.tfvars
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env="stg"
env = "stg"
2 changes: 1 addition & 1 deletion infrastructure/test.tfvars
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env="test"
env = "test"
2 changes: 1 addition & 1 deletion infrastructure/tf-apim-api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
apim_api_name = "${var.product}-${var.component}-api"
api_policy_raw = file("./resources/api-policy/api-policy.xml")
api_policy = replace(replace(local.api_policy_raw, "{TENANT_ID}", data.azurerm_client_config.current.tenant_id)
, "{ENV}", local.env)
, "{ENV}", local.env)
}

module "apim_api" {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/tf-apim-operations.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
basename(operation_policies_file) => {
operation_id = replace(basename(operation_policies_file), ".xml", "")
xml_content = replace(replace(file("${path.module}/${operation_policies_file}"), "{TENANT_ID}", data.azurerm_client_config.current.tenant_id)
, "{ENV}", local.env)
, "{ENV}", local.env)
}
}
}
Expand Down

0 comments on commit e298944

Please sign in to comment.