sparse-intern-71089
03/07/2022, 11:45 AMechoing-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
abundant-window-12532
03/07/2022, 12:10 PMechoing-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
clusterAddress
, 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