question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent import behavior with `aws.ecs.Cluster`

See original GitHub issue

When importing an existing cluster from my infrastructure, the only way to successfully do so has been using the name as the import key. For example if I have a cluster called MyCluster the construction of the cluster would look like this:

const existingCluster = new aws.ecs.Cluster(
            'pulumi-resource-name',
            {
                name: 'MyCluster'
            },
            {
                import: 'MyCluster',
                parent: this,
                protect: true
            }
        );

I am then putting this cluster in a crosswalk Cluster.

However, every time after importing the cluster this way, Pulumi tries to replace the cluster when a service is added to it. To fix this (after creating the stack), I changed the import key to be import: arnForMyCluster. Now when I got to deploy a new stack, that import statement is failing with the message.

Preview failed: refreshing urn:pulumi:staging::loop-lxp::loop-lxp:ecs:cluster$aws:ecs/cluster:Cluster::loop-lxp-cluster-existing-resource: error reading ECS Cluster (arn:aws:ecs:us-east-1:**account_id**:cluster/arn:aws:ecs:us-east-1:**account_id**::cluster/Loop): InvalidParameterException: Unsupported resource type: cluster

In opening this issue, I ultimately have two questions.

  1. What is the correct way to import a cluster? Is it with the cluster name or its arn?
  2. If it is with the cluster name, how can I keep that import statement with the cluster name consistent so new stack can be made, but not have pulumi try to recreate the cluster on every service change. I understand that might be a better issue to open up in crosswalk, but considering that its the non crosswalk import that is failing and being replaced, I figured I would start here.

Thanks for your assistance!

Package/runtime versions:

"node": 12.8.1,
"@pulumi/aws": "^2.0.0",
"@pulumi/awsx": "^0.20.0",
"@pulumi/pulumi": "^2.0.0",
"aws-sdk": "^2.667.0",
"typescript": "3.8.3"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gunarcommented, Apr 28, 2021

You can import an existing ECS Cluster into Crosswalk:

const cluster = new awsx.ecs.Cluster("cluster", {
  cluster: networking.getOutput("clusterName"),
});

Here’s the full snippet:

// networking/index.ts
export const clusterName = cluster.cluster.name;

// application/index.ts
const env = pulumi.getStack();
const networking = new pulumi.StackReference(`…/networking/${env}`);
const cluster = new awsx.ecs.Cluster("cluster", {
  cluster: networking.getOutput("clusterName"),
});
0reactions
lukehobancommented, Mar 18, 2022

I believe the questions raised here have been addressed. We also now support pulumi import which can be used in these cases. If there area any issues you are still seeing, please do open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot common errors with API calls in Amazon ECS
This error occurs when the ECS service that's being updated isn't active. Verify that the ECS service that's being updated is present in...
Read more >
Terraform Gotchas And How We Work Around Them - Heap
A few examples from the AWS world: an EC2 instance is a resource with attributes like the machine type, boot image, availability zone,...
Read more >
Technical Notes 101 - QRadar 101 - IBM
This script performs a version check on all managed hosts' ECS and ECS_INGRESS. ... This behavior normally indicates a CEP that's being imported...
Read more >
Configure SSL for External HTTP Traffic to and from Tableau ...
Additional configuration information for Tableau Server cluster environments · Configure the external load balancer for SSL passthrough. · Make sure the SSL ...
Read more >
Best practices for building containers | Cloud Architecture Center
While this behavior is usually a good thing that makes builds go ... that you can use to enforce the use of security...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found