mirror of https://github.com/hashicorp/terraform
Feature/add additional fields to resource proto (#34364)
Add additional fields to the AppliedChange#ResourceInstance We're adding Resource Mode, Resource Type and Provider Address to the AppliedChange's ResourceInstancepull/34376/head
parent
17f420102f
commit
8ac8f18636
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package stackutils
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform/internal/addrs"
|
||||
"github.com/hashicorp/terraform/internal/rpcapi/terraform1"
|
||||
)
|
||||
|
||||
func ResourceModeForProto(mode addrs.ResourceMode) terraform1.ResourceMode {
|
||||
switch mode {
|
||||
case addrs.ManagedResourceMode:
|
||||
return terraform1.ResourceMode_MANAGED
|
||||
case addrs.DataResourceMode:
|
||||
return terraform1.ResourceMode_DATA
|
||||
default:
|
||||
// Should not get here, because the above should be exhaustive for
|
||||
// all addrs.ResourceMode variants.
|
||||
return terraform1.ResourceMode_UNKNOWN
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue