This message was deleted.
s
This message was deleted.
v
Then when I read the docs there is a
aws.ecs.Cluster.get('cluster_name', 'arn:...')
But then I get the
error reading ECS Cluster: InvalidParameterException: Unsupported resource type: cluster
b
it's not the arn you need for this, it's the cluster name. You want something like:
const cluster = aws.ecs.Cluster.get("name", "cluster_name");
v
Ok, it does work. But when I do it, I get an
aws.ecs.Cluster
when I need a
awsx.ecs.Cluster
I want to get the cluster to create another FargateService
b
you shouldn't need a specific object to create the service, you could just use the
ClusterArn
on either object
v
can you provide some example?
when I try
Copy code
new awsx.ecs.FargateService('name', {
  cluster: awsx.ecs.Cluster.getDefault({id: 'arn:...', urn: 'urn:...'}),
  ...
});
I get an UNKNOWN: missing required URN
b
Do you actually want the default cluster or do you want the cluster specified by the ID?
v
I want a cluster specified by the id
not the default
But I have no idea how to get a
awsx.ecs.Cluster
by the id and
aws.ecs.Cluster
wont work
and the reason is because the type is
FargateServiceArgs.cluster: awsx.ecs.Cluster
b
shouldn't it be:
Copy code
var cluster = ...;
new awsx.ecs.FargateService('name', {
   cluster: cluster.Arn,
   ...
});
or am I not understanding that fargate service parameter? I'm surprised that it needs the entire object that's silly. You can always make you fargate service using the core API and not
awsx
.
b
It does need the entire object. Reason being is that awsx is supposed to create clusters and services etc with best practices. If you want to do more complicated you're going to need to use the base provider
v
Thanks a lot guys
the solution is a little strange for me, but is the follow:
Copy code
const cluster = aws.ecs.Cluster.get(...)
new awsx.ecs.FargateService('name', {
   cluster: new aws.ecs.Cluster('clustar_name', {cluster: cluster}),
   ...
});
201 Views