high-holiday-63390
11/25/2021, 11:23 AMconst environment = new aws.elasticbeanstalk.Environment(appName, {
name: appName,
application: application.name,
solutionStackName: solutionStack.name,
settings: devSettings,
})
const instance = aws.ec2.getInstance({
instanceId: environment.instances[0]
}).then(instance => instance.privateDns)
little-cartoon-10569
11/25/2021, 8:16 PMgetInstance
, that looks up instances using the AWS SDK and returns the current state. You could try using aws.ec2.Instance.get()
. It uses Pulumi's outputs to wait for values to be available. I haven't tried it in this use case though...high-holiday-63390
11/26/2021, 1:43 AMlittle-cartoon-10569
11/26/2021, 1:48 AMhigh-holiday-63390
11/26/2021, 1:52 AMif (environment.instances[0].length > 0) {
instance = await aws.ec2.getInstance({
instanceId: environment.instances[0]
})
exports["instance"] = instance.privateDns
}
little-cartoon-10569
11/26/2021, 1:52 AMid
, will there?high-holiday-63390
11/26/2021, 1:53 AMinstances
just ends up being empty. I guess this situation is a special caselittle-cartoon-10569
11/26/2021, 1:54 AMInstance.get()
, it goes into your stack as a read-only resource. And if the id changes, it might count as an update, and mess up your CI comments, etc.high-holiday-63390
11/26/2021, 1:55 AM