sparse-intern-71089
11/14/2019, 7:48 PMmelodic-family-5784
11/14/2019, 7:50 PMType 'Output<string>' is not assignable to type 'string'
acceptable-army-69872
11/14/2019, 7:51 PM{ name: 'DD_API_KEY', value: ddAPIKey }
melodic-family-5784
11/14/2019, 7:51 PMmelodic-family-5784
11/14/2019, 7:52 PMmelodic-family-5784
11/14/2019, 7:52 PMmelodic-family-5784
11/14/2019, 7:52 PMacceptable-army-69872
11/14/2019, 7:54 PMmelodic-family-5784
11/14/2019, 7:55 PMacceptable-army-69872
11/14/2019, 7:56 PMtall-librarian-49374
11/14/2019, 8:06 PMOutput<T>
to T
tall-librarian-49374
11/14/2019, 8:07 PMOutput
that ensures the secretnesstall-librarian-49374
11/14/2019, 8:10 PMmelodic-family-5784
11/14/2019, 8:24 PMmelodic-family-5784
11/14/2019, 8:27 PMOutput<string>
without needing to use apply
as well.melodic-family-5784
11/14/2019, 8:33 PMmelodic-family-5784
11/14/2019, 8:33 PMconst ddAPIKey = config.requireSecret("my-api-key");
to
const ddAPIKey = config.require("my-api-key");
and the error went away.tall-librarian-49374
11/14/2019, 8:34 PMmelodic-family-5784
11/14/2019, 8:34 PMddAPIKey
changed from pulumi.Output<string>
to string
tall-librarian-49374
11/14/2019, 8:36 PMI see the error when the code is transpiled.again, your code snippet compiles fine. do you get an error from some further lines?
melodic-family-5784
11/14/2019, 8:36 PMmelodic-family-5784
11/14/2019, 8:37 PMconst ddContainerDefinition: aws.ecs.ContainerDefinition = {
name: 'datadog-statsd',
cpu: 102,
memory: 256,
environment: envVars,
//environment: ddAPIKey.apply(dd => [
// { name: 'ECS_FARGATE', value: 'true' },
// { name: 'DD_API_KEY', value: dd }
//]),
image: 'datadog/agent:latest',
portMappings: [{ containerPort: 8125, protocol: 'udp' }]
};
return ddContainerDefinition;
}
melodic-family-5784
11/14/2019, 8:37 PMtall-librarian-49374
11/14/2019, 8:38 PMmelodic-family-5784
11/14/2019, 8:39 PMtall-librarian-49374
11/14/2019, 8:42 PMconst ddContainerDefinition =
ddAPIKey.apply(apiKey => <aws.ecs.ContainerDefinition>{
name: 'datadog-statsd',
cpu: 102,
memory: 256,
environment: [
{ name: "ECS_FARGATE", value: "true" },
{ name: "DD_API_KEY", value: apiKey },
],
image: 'datadog/agent:latest',
portMappings: [{ containerPort: 8125, protocol: 'udp' }]
});
tall-librarian-49374
11/14/2019, 8:43 PMtall-librarian-49374
11/14/2019, 8:44 PMreturn
I'm guessing it's a function. You could add apiKey
as the function parameter and then requireSecret and apply would move outside the functiontall-librarian-49374
11/14/2019, 8:44 PMmelodic-family-5784
11/14/2019, 8:49 PMmelodic-family-5784
11/14/2019, 8:49 PMmelodic-family-5784
11/14/2019, 8:50 PM