ilijamt / terraform-provider-awx

A complete terraform provider for AWX
MIT License
6 stars 1 forks source link

awx_job_template_associate_credential import failed #74

Closed Sujishv closed 9 months ago

Sujishv commented 9 months ago

I was trying to import my manually created templates credentials and getting below error. can you please guide me here

import { to = awx_job_template_associate_credential.fetch_sdts id = 18 }

│ Error: Unable to import state for JobTemplate association, invalid format. │ │ requires the identifier to be set to /, currently set to 18

sametime i could successfully import templates using below import

import { to = awx_job_template.fetch_sdts id = 18 }

ilijamt commented 9 months ago

The ID for import is a combination of two things. If you check https://github.com/ilijamt/terraform-provider-awx/blob/main/docs/resources/job_template_associate_credential.md

Then the ID should be <job_template_id>/<credential_id>

import {
    to = awx_job_template_associate_credential.fetch_sdts
    id = "${awx_job_template.fetch_sdts.id}/{awx_credential.cred.id}"
}

or another example

import {
    to = awx_job_template_associate_credential.fetch_sdts
    id = "29/18"
}

Where

Can you try this and let me know if it works?

Sujishv commented 9 months ago

Thank you so much its working.