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.

Importing custom resource fails with unknown resource type error

See original GitHub issue

While trying to import a redis custom resource to pulumi I’m getting an unknown resource type error.

Expected behavior

Importing the resource should work

Current behavior

Trying to import the resource via the cli or json file always results in error and failure to import.

Steps to reproduce

  1. Install amaizfinance/redis-operator - download the deploy directory and run kubectl apply -k deploy/
  2. Create an example redis instance - kubectl apply -f https://raw.githubusercontent.com/amaizfinance/redis-operator/master/example/k8s_v1alpha1_redis_cr.yaml
  3. Try to import to pulumi - pulumi import kubernetes:k8s.amaiz.com/v1alpha1:Redis example example

Always throws the same error:

Previewing import (dev):
     Type                                        Name       Plan       Info
     pulumi:pulumi:Stack                         redis-dev             1 error
 =   └─ kubernetes:k8s.amaiz.com/v1alpha1:Redis  example    import     1 error
 
Diagnostics:
  kubernetes:k8s.amaiz.com/v1alpha1:Redis (example):
    error: Preview failed: unknown resource type 'kubernetes:k8s.amaiz.com/v1alpha1:Redis'
 
  pulumi:pulumi:Stack (redis-dev):
    error: preview failed

This seems to happen just on import. While using crd2pulumi and creating a programmatic instance of redis, pulumi is able to create and manage the resource just fine.

pulumi version - v2.23.1 pulumi-kubernetes - 2.8.3 go - 1.16.2

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HagaiBarelcommented, Apr 13, 2021

Can confirm that using that using the import option on the resource allows to import the resource properly to pulumi. Thanks for the help @lblackstone.

I would still love to see it working using the cli but programmatic import is a good solution as well

0reactions
lblackstonecommented, Apr 6, 2021

As far as I know, this isn’t possible currently. I think you could still manually import the resource using the import option on the resource rather than using the pulumi import command. This blog post gives an example of this for a different resource type.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppet : Custom resource creation failed - Server Fault
Show activity on this post. I have tried to create a custom resource type on Puppet which creates a file. However, after adding...
Read more >
CloudFormation template error: Custom Resource is ... - GitHub
Referencing a Custom resource with a custom type in a JSON CloudFormation template shows an error that the resources is an unknown resource...
Read more >
Resolve change set errors in CloudFormation - Amazon AWS
This error is thrown when an existing resource is modified during a resource import operation. During an import operation, create, update, and ...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
Failed to provision resources for stack. A failure occured for CloudFormation resource '<resource-name>' of type 'AWS::Batch::ComputeEnvironment ...
Read more >
Error messages - Resource Manager - Google Cloud
The request failed because it is trying to execute an unknown method or operation. SERVICE_UNAVAILABLE (503). Error code, Description. backendError, A backend ...
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