https://pulumi.com logo
#pulumiverse
Title
# pulumiverse
c

cuddly-engineer-30016

03/27/2024, 6:55 AM
Another question, I am creating resources using the YAML runner and if I have my Pulumi.stack.yaml file with the following config
Copy code
config:
  grafana-cloud:azureClientId: something
  grafana-cloud:azureClientSecret:
    secure: somesecret
  grafana-cloud:azureTenantId: someotherthing
and I try to use them in my resource like so
Copy code
resources:
...
  azureadSsoSettings:
    type: grafana:SsoSettings
    properties:
      providerName: azuread
      oauth2Settings:
        name: Microsoft
        enabled: true
        apiUrl: <https://graph.microsoft.com>
        clientId: ${azureClientId}
        clientSecret: ${azureClientSecret}
        scopes: openid email profile
        authUrl: <https://login.microsoftonline.com/${azureTenantId}/oauth2/v2.0/authorize>
        tokenUrl: <https://login.microsoftonline.com/${azureTenantId}/oauth2/v2.0/token>
        allowSignUp: true
        usePkce: true
        useRefreshToken: true
The VSCode linter is screaming at me saying that variables
azureClientId
etc aren't defined. But the yaml actually works and the config values are correctly replaced as expected. If i create a variables section like
Copy code
variables:
  azureClientId: ${azureClientId}
  azureClientSecret: ${azureClientSecret}
  azureTenantId: ${azureTenantId}
the linter stops screaming and this too continues to work. Is using the config values via variables the best practice or is this a linter plugin bug and I can continue using the config values directly in my resources. I am using the Pulumi Yaml linter in VSCode (https://github.com/pulumi/pulumi-lsp) EDIT: nvm, its an issue with the LSP server https://github.com/pulumi/pulumi-lsp/issues/76