This message was deleted.
# general
s
This message was deleted.
g
Is
config.json
a file you want to write to? Or something else? If it's a file you want to write values to, you need to do the write from within an
apply
. Here's an example in Go - https://gist.github.com/clstokes/7d065009cd048388cd981d37db2c5f48#file-main-go-L37-L67.
m
Tried inside the apply, but it didn’t write the file locally:
Copy code
export const configContent = pulumi.all([cognitoUserPoolClientId, reportsAuthDomain, reportsDomainUrl, cognitoUserPoolId, apiUrl])
  .apply(([userPoolClientId, authDomain, domainUrl, userPoolId, url]) => {
    fs.writeFileSync("./src/scripts/config.json", `{
      "authData": {
        "ClientId": "${userPoolClientId}",
        "AppWebDomain": "${authDomain}",
        "IdentityProvider": "COGNITO",
        "TokenScopesArray": ["email", "openid"],
        "RedirectUriSignIn": "${domainUrl}/dashboard.html",
        "RedirectUriSignOut": "${domainUrl}/",
        "UserPoolId": "${userPoolId}"
      },
      "apiUrl": "${url}"
    }`);
Actually, that might have just been some lag in my IDE redraw
Thanks! 🤦 can’t believe I didn’t try it inside the apply 🙂
👍 1