-
Notifications
You must be signed in to change notification settings - Fork 16
WIP refactor: switch to universal addon #29
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: main
Are you sure you want to change the base?
Conversation
This is first part - replace content by universal addon
All modules are loaded from universal-addon
f90e596
to
8f5dfa0
Compare
main.tf
Outdated
*/ | ||
locals { | ||
addon = { | ||
# TODO: Is the name correct? |
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.
IMHO this should be aws-load-balancer-controller
according to
default = "aws-load-balancer-controller" |
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.
Fixed.
main.tf
Outdated
addon_irsa = { | ||
(local.addon.name) = { | ||
irsa_policy_enabled = var.irsa_policy_enabled != null ? var.irsa_policy_enabled : true | ||
irsa_policy = var.irsa_policy != null ? var.irsa_policy : file("${path.module}/default_irsa_policy.json") |
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.
Regarding using plain JSON file for the policy, I will come to this later. Need to evaluate pros and cons.
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.
As agreed, I'm using policy from aws_iam_policy_document datasource. Defined in default_policy.tf
file. Is it ok to use it that way? Or should I put it somewhere else?
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.
As we discussed we would like to retain EKS Pod Identity support.
default_policy.tf
Outdated
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 would name the file iam.tf
as per our convention.
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.
fixed.
default_policy.tf
Outdated
@@ -0,0 +1,290 @@ | |||
data "aws_iam_policy_document" "default_policy" { |
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.
data "aws_iam_policy_document" "default_policy" { | |
data "aws_iam_policy_document" "this" { # or `controller` |
We tend to name TF resources that are used only once using this
. If there are multiple instances then name it accordingly. In this case this
should work.
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.
Also, we should add a condition using count = var.enabled && var.irsa_policy == null
to prevent unnecessary creation of this when it wont be used after all.
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.
Using this
with condition as suggested.
Hi, sorry for jumping in here — I just noticed that you’ve recently started using Have you heard about While it primarily helps you manage different versions of various tools — like Please take a look and consider using You can also find a more detailed comparison here. |
Description
Replace template addon with universal addon
Type of change
fix
)feat
)refactor
)test
)style
)ci
)docs
)How Has This Been Tested?
TBD
Tasks: