feat: Remove dead code for managing CDNs (DBTP-2774)#1388
Conversation
Dependency Review✅ No vulnerabilities or OpenSSF Scorecard issues found.Scanned FilesNone |
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
b67d0a6 to
5ee2b55
Compare
Signed-off-by: DBT pre-commit check
|
Your PR has commits that are missing the Signed-off-by trailer. This is likely due to the pre-commit hook not being configured on your local machine. The usual fix for this issue is to run |
|
Is there any benefit/drawbacks for |
|
@alimbada if we flip the default value for Once this PR has been released to all apps I think it'll be safe to change the default - or just ignore the value of managed_ingress entirely. |
Addresses https://uktrade.atlassian.net/browse/DBTP-2774
Motivation
All CDNs for all apps are now managed by platform-public-ingress. However platform-tools still has the capability to manage CDNs, and there's a risk that this codepath can still be activated if a developer team does not include
managed_ingress: truein the definition of an ALB or S3 static site extension.What this PR does
This PR removes the terraform code for managing CDNs.
In its place, it adds an assertion that
managed_ingress: trueis present for all ALBs and S3 static site extensions. This assertion is implemented as a precondition on anull_resource, and takes effect atterraform plantime.Impact
For ALB/S3 extensions that are already marked with
managed_ingress: true(which, right now, is all of them), there is no change in behaviour.For extensions that don't have this setting, the natural behaviour would be for terraform to plan to destroy the CDNs because they're no longer present in the configuration. However, the newly added assertion will fail, meaning that the plan stage as a whole will fail and cannot lead to terraform actually destroying CDNs.
Testing
Tested a
terraform planof the environment terraform for all apps/envs; confirmed this doesn't break anything or introduce any changes we don't expect.Example of an assertion failure
Follow-ups
Future PRs will introduce a deprecation warning for
managed_ingress(along with many other platform-config.yml options that now become redundant), and ultimately remove this option from schema.Checklist:
Title:
feat: Add new feature (DBTP-1234)orchore: Correct typo (off-ticket)Description:
Tasks:
Reviewer Checklist