average-tiger-58107
05/21/2022, 1:13 AMFor example:
yaml
config:
namespace:service:
- name: my-service
secrets:
- name: SECRET_NAME
value:
secure: ...
...
typescript
interface ServiceConfig {
name: string;
secrets: Secret[];
}
interface Secret {
name: string;
value: pulumi.Output<string>;
}
// Secret values appear to be read as secrets but docs suggest specifically using secret getters, making below seem like a bad idea
const serviceConfig = new pulumi.Config().requireObject<ServiceConfig>("service");
// All values will be read as secrets which I think would work fine but not optimal
const secretServiceConfig = new pulumi.Config().requireSecretObject<ServiceConfig>("service")
Ultimately I would like to be able to recursively unpack config values, using secret and non-secret getters respectively. I have tried a few approaches but can't seem to get anything to work. Is this a crazy configuration structure in the first place? I like this approach because it allows me to dynamically supply configuration values to my container's runtime environment without modifying the typescript codeNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by