prehistoric-house-26852
09/12/2023, 9:25 PMfast-vr-6049
09/12/2023, 9:37 PMGetResourceImportId
, but I don't see such a method anywhere in the provider code or your example code. If that's a method you wrote, you should definitely include its code in your example so folk can figure out what's going onkafka.NewUserScramCredential
call (redacting where appropriate), as Pulumi imports are very reliant on every attribute you pass to these methods. I also don't see any CustomResourceOptions
type being passed to this call, which you likely would need for importing purposes; however, all my experience with Pulumi is in C#, and this looks like Go (though I can't really tell as you didn't specify any syntax highlighting in your issue's markdown), so I could be mistaken there|SCRAM-SHA-256
in the ID could be causing problems. The Pulumi Kafka provider doesn't seem to include the Scram mechanism as part of the resource ID, so when it connects to Kafka and enumerates users, it may not be finding a user due to that. I don't know much at all about this, but it's worth a shot, at least!prehistoric-house-26852
09/13/2023, 4:06 AMi changed the example. You can assume it is just the, but I don't see such a method anywhere in the provider code or your example code. If that's a method you wrote, you should definitely include its code in your example so folk can figure out what's going onGetResourceImportId
resource_import_id
in the config
not sure what u meantype beingCustomResourceOptions
share the entire body of thenot exactly sure what u mean. That's the entire body. Maybe you are referring to the varadic parameter options...?kafka.NewUserScramCredential
it's possible that including thewe already tried without that and a few other combinations • username • username|SCRAM-SHA-256 • username|SCRAM-SHA-256|4096in the ID could be causing problems|SCRAM-SHA-256
stocky-restaurant-98004
09/13/2023, 2:06 PMprehistoric-house-26852
09/13/2023, 2:12 PMstocky-restaurant-98004
09/13/2023, 3:04 PMget
or `import`: https://github.com/Mongey/terraform-provider-kafka/blob/master/kafka/resource_kafka_user_scram_credential.go#L77prehistoric-house-26852
09/13/2023, 5:05 PMfast-vr-6049
09/13/2023, 7:52 PMCustomResourceOptions
, as they're called in C#. In Go, it looks like they're just extra options you provide after your `UserScramCredentialArgs`: https://www.pulumi.com/docs/concepts/options/import/
In C#, I'd be running an import like this:
var resourceGroup = new ResourceGroup(name: "my-existing-group", args: new ResourceGroupArgs
{
ResourceGroupName = "existing-resource-group-name-as-appears-in-azure",
Location = "WestUS2"
},
options: new CustomResourceOptions
{
ImportId = "/subscriptions/<subscription id>/resourceGroups/existing-resource-group-name-as-appears-in-azure"
});
In Go, it looks like you'd need to invoke pulumi.Import(pulumi.ID("resource ID"))
, which I don't see in your example. It might need to be something like so:
user, err := kafka.NewUserScramCredential(
ctx,
fmt.Sprintf("%s", args.Username),
args.UserScramCredentialArgs,
pulumi.Import(pulumi.ID("self_server_import_test_user_1"))
)