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

feat: avm/res/cache/redis: add support for AKV secrets export #4138

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JeffreyCA
Copy link

Description

Closes #4137

Add support for AKV secrets export by introducing a new secretsExportConfiguration input param as per https://azure.github.io/Azure-Verified-Modules/specs/bcp/res/interfaces/#secrets-export.

In addition to the primary and secondary access key, I also added support for connection strings in the form rediss://..., which is supported by most Redis clients:

Secret key name Secret value
secretsExportConfiguration.primaryAccessKeyName Primary access key
secretsExportConfiguration.primaryConnectionStringName TLS-enabled primary connection string in Redis URI form: rediss://:<primaryaccesskey>@<hostname>:6380
secretsExportConfiguration.secondaryAccessKeyName Secondary access key
secretsExportConfiguration.secondaryConnectionStringName TLS-enabled secondary connection string in Redis URI form: rediss://:<secondaryaccesskey>@<hostname>:6380

Usage example:

module redis 'br/public:avm/res/cache/redis:<version>' = {
  name: 'redisDeployment'
  params: {
    // Required parameters
    name: 'kvref'
    // Non-required parameters
    location: '<location>'
    secretsExportConfiguration: {
      keyVaultResourceId: '<keyVaultResourceId>'
      primaryAccessKeyName: 'custom-primaryAccessKey-name'
      primaryConnectionStringName: 'custom-primaryConnectionString-name'
      secondaryAccessKeyName: 'custom-secondaryAccessKey-name'
      secondaryConnectionStringName: 'custom-secondaryConnectionString-name'
    }
  }
}

Pipeline Reference

Ran the kv-secrets E2E test locally and passed:

image

Pipeline

Type of Change

  • Update to CI Environment or utilities (Non-module affecting changes)
  • Azure Verified Module updates:
    • Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in version.json:
      • Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description.
      • The bug was found by the module author, and no one has opened an issue to report it yet.
    • Feature update backwards compatible feature updates, and I have bumped the MINOR version in version.json.
    • Breaking changes and I have bumped the MAJOR version in version.json.
    • Update to documentation

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • I have run Set-AVMModule locally to generate the supporting module files.
  • My corresponding pipelines / checks run clean and green without any errors or warnings

@JeffreyCA JeffreyCA requested review from a team as code owners January 9, 2025 18:32
@avm-team-linter avm-team-linter bot added the Needs: Module Owner 📣 This module needs an owner to develop or maintain it label Jan 9, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 Maintainers need to triage still label Jan 9, 2025

Important

The "Needs: Triage 🔍" label must be removed once the triage process is complete!

Tip

For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue label Jan 9, 2025

Important

If this is a module-related PR, being submitted by the sole owner of the module, the AVM core team must review and approve it (as module owners can't approve their own PRs).

To indicate this PR needs the core team''s attention, apply the "Needs: Core Team 🧞" label!

The core team will only review and approve PRs that have this label applied!

AlexanderSehr
AlexanderSehr previously approved these changes Jan 9, 2025
Copy link
Contributor

@AlexanderSehr AlexanderSehr left a comment

Choose a reason for hiding this comment

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

Great work @JeffreyCA, much appreciated 💪

@JeffreyCA
Copy link
Author

Great work @JeffreyCA, much appreciated 💪

Thanks for the review, do I need any other approvals?

@AlexanderSehr
Copy link
Contributor

Great work @JeffreyCA, much appreciated 💪

Thanks for the review, do I need any other approvals?

Now that you mention it. Actually yes - @hundredacres, could you give it a look? From where I'm standing it looks good :) Your review & approval would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Module Owner 📣 This module needs an owner to develop or maintain it Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AVM Module Issue]: avm/res/cache/redis - Add support for AKV secrets export
2 participants