Skip to content

Commit

Permalink
updated README for get-modernisation-platform-facts role (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
drobinson-moj authored Dec 15, 2023
1 parent 28866f8 commit f303cf2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions ansible/roles/get-modernisation-platform-facts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,26 @@ Note that the `environment_management` secret stored in `modernisation_platform`
is not shared with EC2 instances. So this role relies on a copy being stored
as a SSM parameter `account_ids`.

See nomis for an example of how this parameter is created using the
`baseline` and `baseline_presets` module.
For applications that use baseline module (Nomis, Oasys etc.), the value
is automatically created via the `baseline` module. Otherwise, add terraform
like this

```
resource "aws_ssm_parameter" "account_ids" {
name = "account_ids"
description = "Selected modernisation platform AWS account IDs for use by ansible"
type = "SecureString"
key_id = data.aws_kms_key.general_shared.arn
value = jsonencode({
for key, value in local.environment_management.account_ids :
key => value if contains(["hmpps-oem-${local.environment}"], key)
})
tags = merge(local.tags, {
Name = "account_ids"
})
}
```

Facts are set as follows:
- `account_ids` is a map of account IDs where account name is the key
Expand Down

0 comments on commit f303cf2

Please sign in to comment.