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

steep-printer-55468

11/27/2019, 6:43 PM
abbreviated config:
Copy code
const parameter = new aws.ssm.Parameter("SECRET", {
    type: "SecureString",
    value: config.requireSecret("myPulumiSecret"),
});

const service = new awsx.ecs.FargateService("service", {
    cluster,
    desiredCount: 2,
    taskDefinitionArgs: {
        container: {
            secrets: [{
                name: parameter.name,
                valueFrom: parameter.arn, // FAILS, Type 'Output<string>' is not assignable to type 'string'.
            }],
        },
    }
});
t

tall-librarian-49374

11/27/2019, 7:20 PM
Looks a bit nasty, but should work:
Copy code
secrets: pulumi.all([parameter.name, parameter.arn])
                .apply(([name, valueFrom]) => [{ name, valueFrom }])
s

steep-printer-55468

11/27/2019, 7:35 PM
perfect, it does!
thank you 😄
t

tall-librarian-49374

11/27/2019, 7:49 PM
I'm curious to know why those values are strings cc @lemon-spoon-91807
l

lemon-spoon-91807

11/27/2019, 8:53 PM
In Container? Because we haven't properly input-ized it
Is just a bug in the TS typings
In js it should work
t

tall-librarian-49374

11/27/2019, 9:18 PM
> we haven't properly input-ized it why?
l

lemon-spoon-91807

11/27/2019, 9:31 PM
Because no one did it :-D
It's hand written
And likely was written in 5 min two years ago :-)
s

steep-printer-55468

11/27/2019, 10:17 PM
I am sympathetic to these challenges 😂
it's a great tool, thanks for answering my question and then sharing this discussion 🙂
l

lemon-spoon-91807

11/27/2019, 10:18 PM
absolutely!
note: you should be able to workaround this currently by writing:
valueFrom: <any>parameter.arn
it's basically telling TS to stop checking things
(it will also mask real mistakes if you make them)
but it will at least unblock you until we fix the TS typings for this type
s

steep-printer-55468

11/27/2019, 10:19 PM
thanks, good tip
I don't mind the extra work for type safety though 🙂
l

lemon-spoon-91807

11/27/2019, 10:20 PM
would you be willing to file an issue on us so this doesn't get lost?
i can do it too, just harder from phone
s

steep-printer-55468

11/27/2019, 10:23 PM
I can indeed
I'll paste here shortly