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

octopusdeploy_tenant_project import documentation #782

Open
stalmok opened this issue Sep 14, 2024 · 1 comment
Open

octopusdeploy_tenant_project import documentation #782

stalmok opened this issue Sep 14, 2024 · 1 comment
Labels
category/dev-experience Issues about the dev experience of using the provider, writing correct HCL etc documentation Any issues relating to the associated documentation. kind/question Further information is requested

Comments

@stalmok
Copy link

stalmok commented Sep 14, 2024

Is your feature request related to a problem? Please describe.

I can't figure out what octopusdeploy_tenant_project ID should be used for importing:

import {
  for_each = local.tenants

  to = octopusdeploy_tenant_project.main[each.key]
  id = ???
}

Describe the solution you'd like
Maybe add import section to documentation?

@stalmok
Copy link
Author

stalmok commented Sep 16, 2024

I've identified that the ID format for importing an octopusdeploy_tenant_project resource is "space-id:tenant-id:project-id", but unfortunately, the import doesn't work as expected.

Steps I Took:

  1. Manual Import Attempt (I'm certain that the configuration exists):

    │ Error: Configuration for import target does not exist
    │
    │ The configuration for the given import octopusdeploy_tenant_project.project["tenant-id"] does not exist. All target instances must have an associated configuration to be imported.
    
  2. Using Terraform's import Command (I'm certain that project_id and tenant_id are defined):

    # octopusdeploy_tenant_project.project["tenant-id"] must be replaced
    # (imported from "Spaces-1:Tenants-1163:Projects-41")
    # Warning: this will destroy the imported resource
    -/+ resource "octopusdeploy_tenant_project" "platform" {
          environment_ids = [
              "Environments-2",
              "Environments-3",
              "Environments-4",
          ]
        ~ id              = "Spaces-1:Tenants-1163:Projects-41" -> (known after apply)
        + project_id      = "Projects-41" # forces replacement
        ~ space_id        = "Spaces-1" -> (known after apply)
        + tenant_id       = "Tenants-1163" # forces replacement
      }
    

Issue:

Even though the IDs are correctly formatted and the configurations exist, the import fails with the error message: "Configuration for import target does not exist."

When using the Terraform import command, it seems to recognize the IDs but still attempts to force replacement of the resource, which is unexpected behavior.

@mjhilton mjhilton added kind/question Further information is requested documentation Any issues relating to the associated documentation. category/dev-experience Issues about the dev experience of using the provider, writing correct HCL etc labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/dev-experience Issues about the dev experience of using the provider, writing correct HCL etc documentation Any issues relating to the associated documentation. kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants