abundant-window-12532
03/07/2022, 11:45 AMCalling [toString] on an [Output<T>] is not supported. To get the value of an Output<T> as an Output<string> consider either: 1: o.apply(v => `prefix${v}suffix`) 2: pulumi.interpolate `prefix${v}suffix` See <https://pulumi.io/help/outputs> for more details. This function may throw in a future version of @pulumi/pulumi.
Rather than the expected valueechoing-dinner-19531
03/07/2022, 12:01 PMabundant-window-12532
03/07/2022, 12:09 PMexport async function manageRedisCache(config) {
try {
const subnetGroup = new aws.elasticache.SubnetGroup(config.name, {
name: config.name,
subnetIds: config.subnetIds,
description: `Subnet group for ${config.name} Cache Cluster`,
tags: {
Name: config.name,
},
});
const redisInstance = await new aws.elasticache.Cluster(config.name, {
engine: "redis",
nodeType: config.size,
numCacheNodes: 1,
subnetGroupName: subnetGroup.name,
securityGroupIds: config.securityGroupIds,
securityGroupNames: config.securityGroupNames,
tags: {
Name: config.name,
},
});
return {
instance: redisInstance,
data: {
address: redisInstance.clusterAddress.apply((v) => v),
port: redisInstance.port.apply((v) => v) as unknown as string,
},
};
} catch (e) {
throw e;
}
}
I'm then passing the value from the function into a function to create my Fargate services
echoing-dinner-19531
03/07/2022, 12:15 PMOutput<string>
to just string
except via resources (and they will just return more outputs)abundant-window-12532
03/07/2022, 12:15 PMechoing-dinner-19531
03/07/2022, 12:15 PMOutput<string>
billowy-army-68599
03/07/2022, 4:51 PMclusterAddress
, only memcached based ones.
You need redisInstance.cacheNodes[0].address
which is an array
You don't need to do an apply
if you're just returning an Output
example:
https://github.com/jaxxstorm/brig.gs/blob/main/index.ts#L55abundant-window-12532
03/08/2022, 2:37 PM