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

[Question] How to create dynamic content based on a variable #4111

Open
WTPascoe opened this issue Jan 10, 2024 · 0 comments
Open

[Question] How to create dynamic content based on a variable #4111

WTPascoe opened this issue Jan 10, 2024 · 0 comments
Labels
question Further information is requested

Comments

@WTPascoe
Copy link

What is the right approach or tooling to create dynamic content based on a variable?

In my example, in a dev environment, we want to use a region-specific KMS key for something, but in prod, we need this to be a global key. This isn't as simple as changing part of the key path. The key information in the non-prod (regional config) falls under spec.replication.userManaged.replicas[]

In prod, this configuration is under spec.replication.auto

Regional example

spec:
  replication:
    userManaged:
      replicas:
      - location: europe-west2
        customerManagedEncryption:
          kmsKeyRef:
            external: projects/GCP_PROJECT_ID/locations/europe-west-2/keyRings/env-secretmanager-kmskeyring/cryptoKeys/env-secretmanager-kmskey # kpt-set: projects/${project-id}/locations/europe-west2/keyRings/${env}-secretmanager-kmskeyring/cryptoKeys/${secret-env}-secretmanager-kmskey

Global example

spec:
  replication:
    automatic: true
    auto:
      customerManagedEncryption:
        kmsKeyRef:
          external: projects/GCP_PROJECT_ID/locations/global/keyRings/env-secretmanager-kmskeyring/cryptoKeys/env-secretmanager-kmskey # kpt-set: projects/${project-id}/locations/global/keyRings/${env}-secretmanager-kmskeyring/cryptoKeys/${secret-env}-secretmanager-kmskey
@WTPascoe WTPascoe added the question Further information is requested label Jan 10, 2024
@github-project-automation github-project-automation bot moved this to Backlog in kpt Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant