pulumi-aws icon indicating copy to clipboard operation
pulumi-aws copied to clipboard

Unable to import `redshiftserverless` workgroup

Open alexbowers opened this issue 3 years ago • 3 comments

What happened?

I am unable to import the workgroup

Steps to reproduce

Create a redshift serverless workgroup in AWS then try to import it:

pulumi import aws:redshiftserverless/workgroup:Workgroup 'Workgroup Name' 'workgroup name' --protect=false --stack jobilla/xxx

Expected Behavior

Expect the resource to import

Actual Behavior

Error occured:

error: Preview failed: unrecognized resource type (Read): aws:redshiftserverless/workgroup:Workgroup```

### Output of `pulumi about`

_No response_

### Additional context

_No response_

### Contributing

Vote on this issue by adding a 👍 reaction. 
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already). 

alexbowers avatar Sep 07 '22 15:09 alexbowers

I followed up with my code in https://github.com/pulumi/pulumi-aws-native/issues/614 to import the workgroup using the AWS provider and it just worked for me:

pulumi import aws:redshiftserverless/workgroup:Workgroup 'Workgroup Name' 'jobilla' --protect=falsePreviewing import (dev)

View Live: https://app.pulumi.com/vivek/redshift-aws/dev/previews/736256f5-57e4-448a-b885-48d84ab2a0b4

     Type                                 Name              Plan       
 +   pulumi:pulumi:Stack                  redshift-aws-dev  create     
 =   └─ aws:redshiftserverless:Workgroup  Workgroup Name    import     
 
Resources:
    + 1 to create
    = 1 to import
    2 changes

Do you want to perform this import? yes
Importing (dev)

View Live: https://app.pulumi.com/vivek/redshift-aws/dev/updates/1

     Type                                 Name              Status       
 +   pulumi:pulumi:Stack                  redshift-aws-dev  created      
 =   └─ aws:redshiftserverless:Workgroup  Workgroup Name    imported     
 
Resources:
    + 1 created
    = 1 imported
    2 changes

Duration: 3s

Please copy the following code into your Pulumi application. Not doing so
will cause Pulumi to report that an update will happen on the next update command.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const Workgroup_Name = new aws.redshiftserverless.Workgroup("Workgroup Name", {
    baseCapacity: 128,
    configParameters: [
        {
            parameterKey: "datestyle",
            parameterValue: "ISO, MDY",
        },
        {
            parameterKey: "enable_user_activity_logging",
            parameterValue: "true",
        },
        {
            parameterKey: "query_group",
            parameterValue: "default",
        },
        {
            parameterKey: "search_path",
            parameterValue: `$user, public`,
        },
        {
            parameterKey: "max_query_execution_time",
            parameterValue: "14400",
        },
    ],
    namespaceName: "jobilla",
    publiclyAccessible: true,
    securityGroupIds: ["sg-XXX"],
    subnetIds: [
        "subnet-YYY",
        "subnet-ZZZ",
    ],
    workgroupName: "jobilla",
});

What version of the aws provider SDK do you have? I see you didn't post the details of pulumi about.

viveklak avatar Sep 09 '22 18:09 viveklak

CLI
Version      3.39.3
Go Version   go1.19.1
Go Compiler  gc

Plugins
NAME        VERSION
aws         5.11.0
aws-native  0.21.0
docker      3.4.1
eks         0.41.2
kubernetes  3.21.0
nodejs      unknown

Host
OS       darwin
Version  12.5.1
Arch     arm64

This project is written in nodejs: executable='/Users/alexbowers/.nvm/versions/node/v18.5.0/bin/node' version='v18.5.0'

Found no pending operations associated with jobilla/production

Backend
Name           pulumi.com
URL            https://app.pulumi.com/alexbowers
User           alexbowers
Organizations  alexbowers, jobilla

Dependencies:
NAME                 VERSION
@pulumi/pulumi       3.38.0
yaml                 1.10.2
@pulumi/awsx         0.40.0
@pulumi/eks          0.41.2
@pulumi/kubernetes   3.21.0
@types/netmask       1.0.30
@types/node          10.17.60
netmask              2.0.2
@pulumi/aws-native   0.21.0
@pulumi/aws          5.11.0
@pulumi/kubernetesx  0.1.6

Pulumi locates its logs in /var/folders/30/9lvl9xwj1h1_ltl0b5hsl3mw0000gn/T/ by default

alexbowers avatar Sep 12 '22 08:09 alexbowers

My Workgroup was setup with a non-default SG and VPC. Not sure if that could be the cause of the problems?

alexbowers avatar Sep 12 '22 08:09 alexbowers

As we currently have no way to reproduce this issue, and it's sat stale for a while, I'm going to go ahead and close it for now. If a program with a reproduction can be provided, we'll be more than happy to investigate further. Thank you!

kpitzen avatar Mar 31 '23 14:03 kpitzen