https://pulumi.com logo
#general
Title
# general
b

brief-pillow-16455

03/31/2023, 3:28 PM
Hello everyone i am facing a problem to use Output<string>
Copy code
let configmapcontents = fs.readFileSync(
        path.join(__dirname, 'nginx.conf'),
        { encoding: 'utf-8',},
        );
configmapcontents = args.serverName.apply(sn => configmapcontents.toString().replace(/server_name/g,`${sn}`))
Copy code
Here args.serverName is of type Output<string> but replace function of typescript expects a string

How to work around this?
b

billowy-army-68599

03/31/2023, 3:35 PM
build the configmapcontents inside the apply:
Copy code
args.ServerName.apply(sn => 
fs.readFileSync...
4 Views