-
Notifications
You must be signed in to change notification settings - Fork 3
VED-1040: Terraform tidy #1172
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
base: master
Are you sure you want to change the base?
VED-1040: Terraform tidy #1172
Conversation
Also tidy us hard coded aws regions and use vars instead
|
This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket: VED-1040 |
| REDIS_HOST = data.aws_elasticache_cluster.existing_redis.cache_nodes[0].address | ||
| REDIS_PORT = data.aws_elasticache_cluster.existing_redis.cache_nodes[0].port | ||
| REDIS_SYNC_PROC_LAMBDA_NAME = "imms-${var.sub_environment}-redis_sync_lambda" | ||
| REDIS_SYNC_PROC_LAMBDA_NAME = local.redis_sync_lambda_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use this environment variable anywhere? Same probably goes for the SPLUNK_FIREHOSE_NAME.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REDIS_SYNC_PROC_LAMBDA_NAME doesn't appear to be used anywhere in the repo so will delete
I think SPLUNK_FIREHOSE_NAME will be needed as the handler is decorated with the logging decorator
| variable "mesh_mailbox_ids" {} | ||
| variable "mesh_dlq_mailbox_id" {} | ||
| variable "aws_region" { | ||
| default = "eu-west-2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional, probably not needed as is inconsistent with the other directories, unless we wanna apply elsewhere.
But terraform offers variable validation. We are only really ever meant to deploy NHS services into eu-west-2. Any developer could override ultimately (so there is limited value), so it relies on higher-level controls etc. But a simple validation could help to express intent.
https://developer.hashicorp.com/terraform/language/block/variable#validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into this. Sounds like it's worth adding since we're having a tidy 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A note on this, I noticed we have some AWS shield related stuff set to us-east-1. I'm not too clued up on it so is this an exception and it needs to be in us-east-1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad. Forgot about those, yes some of those would be global services for the Cyber Security monitoring which are only available there. I think all the resources we deploy that use the variable are eu-west-2. But if it causes issues just dismiss and merge.
8e63835
|



Summary
This PR:
Since the names of some lambdas have changed this could have unwanted effects. They should be mapped accordingly but we should be careful.
Reviews Required
Review Checklist
ℹ️ This section is to be filled in by the reviewer.