diff --git a/mmv1/third_party/terraform/services/logging/resource_logging_project_bucket_config.go b/mmv1/third_party/terraform/services/logging/resource_logging_project_bucket_config.go index d7b8b8521da0..75ce530920fd 100644 --- a/mmv1/third_party/terraform/services/logging/resource_logging_project_bucket_config.go +++ b/mmv1/third_party/terraform/services/logging/resource_logging_project_bucket_config.go @@ -131,15 +131,16 @@ For example: jsonPayload.request.status`, } func projectBucketConfigID(d *schema.ResourceData, config *transport_tpg.Config) (string, error) { - project := d.Get("project").(string) + projectID := d.Get("project").(string) location := d.Get("location").(string) bucketID := d.Get("bucket_id").(string) - if !strings.HasPrefix(project, "project") { - project = "projects/" + project + if strings.HasPrefix(projectID, "projects/") { + // Remove "projects/" prefix if it exists + projectID = strings.TrimPrefix(projectID, "projects/") } - id := fmt.Sprintf("%s/locations/%s/buckets/%s", project, location, bucketID) + id := fmt.Sprintf("projects/%s/locations/%s/buckets/%s", projectID, location, bucketID) return id, nil }