chilly-photographer-60932
01/29/2019, 9:08 PMOutput<string>
to string
? One of the function returns an Output<string>
and the other one expects a string
.gentle-diamond-70147
01/29/2019, 9:35 PM.apply(x=>x)
might be the best option or my favorite pulumi.interpolate...
.chilly-photographer-60932
01/29/2019, 9:44 PMOutput<string>
to Input<string>
export async function createAliasRecord(
targetDomain: string,
loadBalancername: Output<string>
): Promise<aws.route53.Record> {
const domainParts = getDomainAndSubdomain(targetDomain);
const hostedZone = await aws.route53.getZone({
name: domainParts.parentDomain
});
return new aws.route53.Record(targetDomain, {
name: domainParts.subdomain,
zoneId: hostedZone.zoneId,
type: "A",
aliases: [
{
name: loadBalancername,
zoneId: getHostedZoneId().then(s => s.id),
evaluateTargetHealth: true
}
]
});
}
loadBalancername
to aliases
name
name
requires Input<string>
gorgeous-egg-16927
01/29/2019, 9:59 PMOutput<string>
into places requiring an Input<String>
chilly-photographer-60932
01/29/2019, 10:00 PMDiagnostics:
aws:route53:Record (<http://xyz.xyz.io|xyz.xyz.io>):
error: aws:route53/record:Record resource '<http://xyz.xyz.io|xyz.xyz.io>' has a problem: "alias.0.name": required field is not set
gentle-diamond-70147
01/29/2019, 10:01 PMcreateAliasRecord(...)
?gorgeous-egg-16927
01/29/2019, 10:01 PMloadBalancername.get()
?orange-tailor-85423
01/29/2019, 10:02 PMchilly-photographer-60932
01/29/2019, 10:02 PMcreateAliasRecord(<http://config.xyz|config.xyz>, xyz);
get
because it errors
error: Error: Cannot call '.get' during update or preview.
To manipulate the value of this Output, use '.apply' instead.
gentle-diamond-70147
01/29/2019, 10:06 PMxyz
in createAliasRecord(<http://config.xyz|config.xyz>, xyz);
?gorgeous-egg-16927
01/29/2019, 10:06 PM/**
* Input is a property input for a resource. It may be a promptly available T, a promise
* for one, or the output from a existing Resource.
*/
export declare type Input<T> = T | Promise<T> | Output<T>;
gentle-diamond-70147
01/29/2019, 10:07 PMorange-tailor-85423
01/29/2019, 10:07 PMchilly-photographer-60932
01/29/2019, 10:07 PMxyz
is Output<String>
gentle-diamond-70147
01/29/2019, 10:09 PMconst xyz = loadbalancer.name;
is further up in your code?chilly-photographer-60932
01/29/2019, 10:11 PMip
instead of name
which was causing the issue.