-
Notifications
You must be signed in to change notification settings - Fork 18
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
Recreate Missing Resources #95
Comments
The error is happening because it's trying to call an update to a non-existent ID, we're not setting ID to empty string for the resource to trigger a re-create. There are also inconsistencies with vendor error handling it seems. Query: query Users(
$id: ID!
) {
user(
id: $id
) {
id
name
email
effectiveAssignedProjects {
id
}
effectiveRole {
id
}
}
} Vars: {
"id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
} Response: {
"data": {
"user": null
}
} Query: query samlIdentityProvider ($id: ID!){
samlIdentityProvider (
id: $id
) {
id
name
issuerURL
loginURL
logoutURL
useProviderManagedRoles
allowManualRoleOverride
certificate
domains
mergeGroupsMappingByRole
groupMapping {
providerGroupId
role {
id
}
projects {
id
}
}
}
}
Vars: {
"id": "pingfederate-bogusname"
} Response: "errors": [
{
"message": "oops! an internal error has occurred. for reference purposes, this is your request id: af19d0f6-207d-4599-9f2d-bcd349572308",
"extensions": {
"code": "DOWNSTREAM_SERVICE_ERROR",
"exception": {
"message": "oops! an internal error has occurred. for reference purposes, this is your request id: af19d0f6-207d-4599-9f2d-bcd349572308"
}
}
}
],
"data": {
"samlIdentityProvider": null
}
} Ideally their Apollo response should always error with if len(diags) > 0 {
tflog.Info(ctx, "Error from API call, checking if resource was deleted outside Terraform.")
if data.SAMLIdentityProvider.ID == "" {
tflog.Debug(ctx, fmt.Sprintf("Response: (%T) %s", data, utils.PrettyPrint(data)))
tflog.Info(ctx, "Resource not found, marking as new.")
d.SetId("")
d.MarkNewResource()
return nil
}
return diags
} |
vendor has mentioned they're overhauling the error responses and these cases will be covered, they won't be responding with |
Terraform Version and Provider Version
When a resource is deleted outside Terraform, the provider should recreate the missing resource. Currently, an error condition is created.
Affected Resource(s)
All resources.
Debug Output
Expected Behavior
The missing wiz_user resource should have been recreated.
Actual Behavior
An error was returned.
Steps to Reproduce
References
Adopt the AWS provider acceptance test strategy, as outlined here:
https://hashicorp.github.io/terraform-provider-aws/running-and-writing-acceptance-tests/
Community Note
The text was updated successfully, but these errors were encountered: