Skip to content
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

add helm release addon non-sensitive outputs #700

Merged
merged 11 commits into from
Jul 8, 2022
Merged

add helm release addon non-sensitive outputs #700

merged 11 commits into from
Jul 8, 2022

Conversation

FernandoMiguel
Copy link
Contributor

What does this PR do?

add helm_addons outpus

Motivation

So practitioners can add outputs to modules

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I have added a new example under examples to support my PR
  • Yes, I have created another PR for add-ons under add-ons repo (if applicable)
  • Yes, I have updated the docs for this feature
  • Yes, I ran pre-commit run -a with this PR

Note: Not all the PRs required examples and docs except a new pattern or add-on added.

For Moderators

  • E2E Test successfully complete before merge?

Signed-off-by: Fernando Miguel <github@FernandoMiguel.net>
@FernandoMiguel FernandoMiguel temporarily deployed to EKS Blueprints Test June 28, 2022 16:15 Inactive
Copy link
Contributor

@askulkarni2 askulkarni2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FernandoMiguel interesting PR. Would you be able to add some more details in the motivation? What is the use-case for being able to consume these outputs? Maybe an code example would help.

Also the CI check is failing. Running pre-commit run terraform_docs should fix that.

@FernandoMiguel
Copy link
Contributor Author

@askulkarni2 I was looking to get the version of the charts installed, and also looking for newer versions that I could upgrade to.
For now, I submitted this just for the helm addon module, and if it accepted I'll open a PR adding outputs to the addons themselves.

I also have a single liner that does what this does, but without descriptions, and also includes the sets and value files, if the team prefers that.
output "helm_release_external_dns" { value = try({ for k, v in helm_release.external-dns : k => (k != "repository_password" ? v : null) }, null) }

if you can provide me with further instructions on the pre-commit command, I can try that tomorrow.

@bryantbiggs
Copy link
Contributor

instead of adding all outputs, would it be possible to only export the outputs that are needed? we could also do a single full export like:

output "helm_release" {
  description = "Attributes of Helm release created"
  value       = helm_release.addon
}

@FernandoMiguel
Copy link
Contributor Author

instead of adding all outputs, would it be possible to only export the outputs that are needed? we could also do a single full export like:

output "helm_release" {
  description = "Attributes of Helm release created"
  value       = helm_release.addon
}

The password attribute is sensitive and would block the all output downstream.

Signed-off-by: Fernando Miguel <github@FernandoMiguel.net>
Signed-off-by: Fernando Miguel <github@FernandoMiguel.net>
Signed-off-by: Fernando Miguel <github@FernandoMiguel.net>
@FernandoMiguel
Copy link
Contributor Author

Pls review.
Thank you.

description = "Describes the desired status of a chart in a kubernetes cluster."
value = try(
{
for k, v in helm_release.addon : k => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the value here would be:

value = try({ for k, v in helm_release.addon : k => v if k != "repository_password" }, {})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either works in my testing.
I tend to go with not setting explicitly anything, hence null.
But not all providers handle that well.
I'm fine following your existing style, if you prefer.

@bryantbiggs
Copy link
Contributor

see comment above and it looks like there are CI failures to address (pre-commit)

@bryantbiggs bryantbiggs temporarily deployed to EKS Blueprints Test July 8, 2022 20:07 Inactive
@bryantbiggs bryantbiggs merged commit 4d99fd7 into aws-ia:main Jul 8, 2022
@FernandoMiguel FernandoMiguel deleted the add-addons-outputs branch July 11, 2022 09:23
@FernandoMiguel
Copy link
Contributor Author

thank you for picking up this @bryantbiggs
I was away from the computer part of last week.

allamand pushed a commit to allamand/terraform-aws-eks-blueprints that referenced this pull request Dec 15, 2022
Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants