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

glamorous-waitress-51149

12/12/2019, 11:32 AM
i see I could change it to
config.requireSecret("databasePassword").get()
but docs suggest not to do this
b

broad-dog-22463

12/12/2019, 12:19 PM
@glamorous-waitress-51149 sorry was afk - have a look at this
g

glamorous-waitress-51149

12/12/2019, 12:21 PM
yeah saw that but still no dice
tried
const databasePassword = config.requireSecret("databasePassword").apply(pwd=>pwd);
b

broad-dog-22463

12/12/2019, 12:22 PM
You may need to do it as part of the passing it to the rds instance
g

glamorous-waitress-51149

12/12/2019, 12:22 PM
ok will try that
please hold…. 🙂
nope 😞
b

broad-dog-22463

12/12/2019, 12:23 PM
Mmmhhhhh that’s not good to hear
Let me see what I can find locally
g

glamorous-waitress-51149

12/12/2019, 12:24 PM
cheers
our fault for not checking in a yarn.lock file
today’s builds have gone BOOM
Copy code
{
  "name": "aws-typescript",
  "devDependencies": {
    "@types/node": "12.11.7"
  },
  "dependencies": {
    "@pulumi/aws": "1.14.1",
    "@pulumi/awsx": "0.18.14",
    "@pulumi/pulumi": "1.7.0",
    "@types/mime": "2.0.1",
    "mime": "latest"
  }
}
that’s what we’re using
found a couple of GH issues that relate to typescript but my local version of TS is 2.9.2
and those issues were around later versions
t

tall-librarian-49374

12/12/2019, 3:28 PM
Were you able to solve this? You should be able to assign outputs to inputs directly.
g

glamorous-waitress-51149

12/12/2019, 3:46 PM
I wasn’t, @broad-dog-22463 any luck?
t

tall-librarian-49374

12/12/2019, 3:53 PM
What's the error that you are getting? Your initial code looks fine.
g

glamorous-waitress-51149

12/12/2019, 4:03 PM
I think something has changed in the pulumi libs but the error is this
Copy code
error: Running program '/Users/jonathan/Projects/Profiles/infra' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    index.ts(62,5): error TS2322: Type 'Output<string>' is not assignable to type 'Input<string>'.
      Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
        Types of property 'apply' are incompatible.
          Type '{ <U>(func: (t: string) => Promise<U>): import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/Users/jonathan/Projects/Profiles/infra/nod...' is not assignable to type '{ <U>(func: (t: string) => Promise<U>): import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").OutputInstance<...>):...'.
            Type 'import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").Output<any>'.
              Type 'OutputInstance<any>' is not assignable to type 'Output<any>'.
                Type 'OutputInstance<any>' is not assignable to type 'OutputInstance<any> & LiftedObject<any, string>'.
                  Type 'import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").OutputInstance<any>' is not assignable to type 'import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").OutputInstance<any>'.
                    Types of property 'apply' are incompatible.
                      Type '{ <U>(func: (t: any) => Promise<U>): import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/Users/jonathan/Projects/Profiles/infra/node_modu...' is not assignable to type '{ <U>(func: (t: any) => Promise<U>): import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import(...'.
                        Type 'import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("/Users/jonathan/Projects/Profiles/infra/node_modules/@pulumi/aws/node_modules/@pulumi/pulumi/output").Output<any>'.
                          Type 'OutputInstance<any>' is not assignable to type 'Output<any>'.
                            Type 'OutputInstance<any>' is not assignable to type 'OutputInstance<any> & LiftedObject<any, string>'.
                              Type 'OutputInstance<any>' is not assignable to type 'LiftedObject<any, string>'.
t

tall-librarian-49374

12/12/2019, 4:04 PM
whaaat... trying this locally.
g

glamorous-waitress-51149

12/12/2019, 4:06 PM
its basically broken various resources where we do that today
t

tall-librarian-49374

12/12/2019, 4:06 PM
Type 'OutputInstance<any>
is not assignable to type 'OutputInstance<any>` smells like version conflict
g

glamorous-waitress-51149

12/12/2019, 4:06 PM
my package.json is above
i’ve nuked nodemodules etc
then reinstalled everything
and then get that error on pulumi preview
t

tall-librarian-49374

12/12/2019, 4:12 PM
I copied your package.json, installed clean, and everything is fine
weird
No links or other fishy stuff?
g

glamorous-waitress-51149

12/12/2019, 4:21 PM
hmm, thats odd as our CI server fails too as well as on my machine
you used:??
Copy code
const databasePassword = config.requireSecret("databasePassword")


const cluster = new aws.rds.Cluster("default", {
    masterPassword: databasePassword,
t

tall-librarian-49374

12/12/2019, 4:47 PM
yes
g

glamorous-waitress-51149

12/12/2019, 4:48 PM
wtf
could you send me your simple repro?
w

white-balloon-205

12/12/2019, 6:53 PM
Type 'Output<string>' is not assignable to type 'Input<string>'.
Just opened https://github.com/pulumi/pulumi/issues/3652 which is tracking this. There is a workaround in the issue thread.
g

glamorous-waitress-51149

12/12/2019, 8:03 PM
we found the opposite
nuking node modules and lock files still has the issue
w

white-balloon-205

12/12/2019, 8:17 PM
Does your lock file include two different versions of
@pulumi/pulumi
? I suspect there is one nestled under
@pulumi/aws
in your node_modules based on the error above. I’d be pretty surprised if this happened on a truly fresh NPM install (without lock files).
g

glamorous-waitress-51149

12/13/2019, 9:18 AM
Here’s my lock file. Hopefully it makes more sense to you than me
the package.json for that lock file is this:
Copy code
{
  "name": "aws-typescript",
  "devDependencies": {
    "@types/node": "12.11.7"
  },
  "dependencies": {
    "@pulumi/aws": "1.8.0",
    "@pulumi/awsx": "0.18.13",
    "@pulumi/pulumi": "1.5.2",
    "@types/mime": "2.0.1",
    "mime": "latest"
  }
}
changed pulumi/pulumi to 1.7.0 and that fixed it for now