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

Allow resource auto-naming #420

Closed
aureq opened this issue Sep 30, 2024 · 1 comment
Closed

Allow resource auto-naming #420

aureq opened this issue Sep 30, 2024 · 1 comment
Labels
kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue

Comments

@aureq
Copy link
Member

aureq commented Sep 30, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

When I create a S3 bucket and don't set the AWS Resource name, the Pulumi name is use and a random suffix is used instead ✔.
This is very helpful because it's easy to avoid name collisions this way. It also makes the code cleaner as the name doesn't need to be specified.

In this provider however, it seems like auto-naming isn't supported and all resources need to be explicitly named.

"""A Python Pulumi program"""

import pulumi
import pulumi_pulumiservice as pulumiservice

pulumi_agent_pool = pulumiservice.AgentPool("agentPoolResource",
    # name="agent-pool-resource",
    organization_name="menfin",
    description="this is to test agent pool id"
)

pulumi.export("agent-pool", {
    'id': pulumi_agent_pool.agent_pool_id,
    'name': pulumi_agent_pool.name,
    'token': pulumi_agent_pool.token_value
})

For the code above 👆 I get the error below 👇 and I'm forced to set the name property.

Previewing update (0001)

View in Browser (Ctrl+O): https://app.pulumi.com/menfin/zendesk/0001/previews/d94adb19-7a08-45c7-a742-501b9154c090

     Type                 Name          Plan       Info
 +   pulumi:pulumi:Stack  zendesk-0001  create     1 error

Diagnostics:
  pulumi:pulumi:Stack (zendesk-0001):
    error: Program failed with an unhandled exception:
    Traceback (most recent call last):
      File "/home/aureq/work/customers/zendesk/0001-xxxxx/a/__main__.py", line 6, in <module>
        pulumi_agent_pool = pulumiservice.AgentPool("agentPoolResource",
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/aureq/work/customers/zendesk/0001-xxxxx/a/venv/lib/python3.11/site-packages/pulumi_pulumiservice/agent_pool.py", line 105, in __init__
        __self__._internal_init(resource_name, *args, **kwargs)
      File "/home/aureq/work/customers/zendesk/0001-xxxxx/a/venv/lib/python3.11/site-packages/pulumi_pulumiservice/agent_pool.py", line 124, in _internal_init
        raise TypeError("Missing required property 'name'")
    TypeError: Missing required property 'name'

It would be great to have feature parity with other providers.

@aureq aureq added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Sep 30, 2024
@komalali komalali added resolution/duplicate This issue is a duplicate of another issue and removed needs-triage Needs attention from the triage team labels Sep 30, 2024
@komalali
Copy link
Member

Closing as a duplicate of #110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants