https://pulumi.com logo
Title
t

thankful-coat-47937

05/25/2022, 5:05 PM
hi, i have a
const cluster = aws.ecs.getClusterOutput({ clusterName: infraRef.getOutput("clusterName") });
which is a
pulumi.output<aws.ecs.GetClusterResult>
How do i convert this into a
awsx.ecs.Cluster
?
o

orange-policeman-59119

05/25/2022, 7:12 PM
Outputs are a core part of how Pulumi works, you should be able to get properties off of that cluster if you need them, see: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#lifting
l

little-cartoon-10569

05/25/2022, 8:49 PM
Do you mean
aws.ecs.Cluster
? I cant find an awsx version. Do you have a link to the docs for it? To create a read-only Cluster from a GetClusterResult, you have to create a new Cluster using the same ID. Cluster has a static
get
method: https://www.pulumi.com/registry/packages/aws/api-docs/ecs/cluster/#look-up
If what you really want is to manage the Cluster in the normal Pulumi manner, you should import the Cluster, instead.
You can do that using the
import
opt when constructing the Cluster, or by using the import CL (https://www.pulumi.com/registry/packages/aws/api-docs/ecs/cluster/#import)