I'm trying to create an `awsx.ecs.FargateTaskDefin...
# typescript
b
I'm trying to create an
awsx.ecs.FargateTaskDefinition
using secrets that contain
Output<string>
however the underlying type -
aws.ecs.Secret
has properties that are
string
only. example code below:
Copy code
const secret = new aws.secretsmanager.Secret("my-secret", {});

const taskDefinition = new awsx.ecs.FargateTaskDefinition("my-task-definition", {
    executionRole: executionRole,
    logGroup: logGroup,
    container: {
        image: "my-image:latest",
        memory: 128,
        cpu: 512,
        portMappings: [{
            protocol: "tcp",
            containerPort: 8080,
        }],
        secrets: [
            { name: "MY_SECRET", valueFrom: secret.arn }
        ]
    }
});
this produces build errors since the
aws.ecs.Secret
type is defined as follows:
Copy code
interface Secret {
    name: string;
    valueFrom: string;
}
and
valueFrom
expects a string and not an
Output<string>
which is returned from
secret.arn
how can i coerce the types to allow this to work?
m
I’ve used
// @ts-ignore
for cases like this.
l
Does that work? I would expect the usual exception about calling
.toString()
on an Output..
b
if I just force a typecast the template appears to work fine, which i didn't expect. I would expect some kind of issues at some point?
💯 1