* feat: initialize Terraform Plugin Framework * fix docker-compose path for tests * fix: ensure documentation can be generated with old provider SDK and new plugin framework * lint
18 lines
419 B
Go
18 lines
419 B
Go
package v1
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
)
|
|
|
|
func importSiteAndID(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
|
|
if id := d.Id(); strings.Contains(id, ":") {
|
|
importParts := strings.SplitN(id, ":", 2)
|
|
d.SetId(importParts[1])
|
|
d.Set("site", importParts[0])
|
|
}
|
|
return []*schema.ResourceData{d}, nil
|
|
}
|