Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing a resource with . in the name converts it to _ but it gets saved with . in the stack #1605

Open
YanishR opened this issue Jan 28, 2025 · 2 comments
Labels
area/codegen Code generation kind/bug Some behavior is incorrect or out of spec language/java Java

Comments

@YanishR
Copy link

YanishR commented Jan 28, 2025

What happened?

I imported a kafka topic into my stack. The name of the resource has full stops in i.e. organizations_db.public.teams. Pulumi instructed me to declare the resource with the full stops replaced by underscores i.e. organizations_db_public_teams. However, it saved it in the stack as organizations_db.public.teams.

Example

pulumi import kafka:index/topic:Topic organizations_db.public.teams organizations_db.public.teams --yes
outputted

public static void stack(Context ctx) {
    var organizations_db_public_teams = new Topic("organizations_db_public_teams", TopicArgs.builder()
      .config(Map.of("cleanup.policy", "delete"))
      .name("organizations_db.public.teams")
      .partitions(6)
      .replicationFactor(3)
      .build(), CustomResourceOptions.builder()
        .protect(true)
        .build());

}

but the stack state showed:

├─ kafka:index/topic:Topic                    organizations_db.public.teams
    │     URN: urn:pulumi:prod::cluster::kafka:index/topic:Topic::organizations_db.public.teams

Output of pulumi about

CLI          
Version      3.144.0
Go Version   go1.23.4
Go Compiler  gc

Plugins
KIND      NAME  VERSION
language  java  0.19.0

Host     
OS       debian
Version  12.8
Arch     aarch64

This project is written in java: executable='/usr/bin/java' version='openjdk 21.0.5 2024-10-15 LTS
OpenJDK Runtime Environment Microsoft-10376803 (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM Microsoft-10376803 (build 21.0.5+11-LTS, mixed mode, sharing)' java='/usr/bin/java' javac='21.0.5' maven='Apache Maven 3.8.7' gradle='4.4.1'

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).

@YanishR YanishR added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 28, 2025
@lunaris lunaris added language/python Python area/codegen Code generation language/java Java and removed needs-triage Needs attention from the triage team language/python Python labels Jan 28, 2025
@lunaris
Copy link
Contributor

lunaris commented Jan 28, 2025

Hi @YanishR, thanks for raising this and sorry it's affected you. In terms of resolving any issues this might have caused, I suspect changing new Topic("organizations_db_public_teams", ...) to new Topic("organizations_db.public.teams", ...) is the workaround -- does that solve your issue or are you otherwise blocked?

@YanishR
Copy link
Author

YanishR commented Jan 29, 2025

Hey @lunaris 🙂
Yep, that is indeed the workaround, which I found out after a while of figuring out what was wrong with the stack.
Thanks for the rapid response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen Code generation kind/bug Some behavior is incorrect or out of spec language/java Java
Projects
None yet
Development

No branches or pull requests

2 participants