command/show: add provider name to resource changes (#20711)

This commit is contained in:
Kristin Laemmert 2019-03-15 13:20:43 -07:00 committed by GitHub
parent 247faca59d
commit c73a5fc07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 3 deletions

View File

@ -271,6 +271,7 @@ func (p *plan) marshalResourceChanges(changes *plans.Changes, schemas *terraform
r.ModuleAddress = addr.Module.String()
r.Name = addr.Resource.Resource.Name
r.Type = addr.Resource.Resource.Type
r.ProviderName = rc.ProviderAddr.ProviderConfig.StringCompact()
p.ResourceChanges = append(p.ResourceChanges, r)

View File

@ -49,9 +49,10 @@ type resourceChange struct {
// "managed" or "data"
Mode string `json:"mode,omitempty"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Index addrs.InstanceKey `json:"index,omitempty"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Index addrs.InstanceKey `json:"index,omitempty"`
ProviderName string `json:"provider_name,omitempty"`
// "deposed", if set, indicates that this action applies to a "deposed"
// object of the given instance rather than to its "current" object. Omitted

View File

@ -59,6 +59,7 @@
"index": 0,
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"change": {
"actions": [
@ -79,6 +80,7 @@
"index": 1,
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"change": {
"actions": [
@ -99,6 +101,7 @@
"index": 2,
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"change": {
"actions": [

View File

@ -34,6 +34,7 @@
"address": "test_instance.test",
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"change": {
"actions": [
@ -57,6 +58,7 @@
"address": "test_instance.test-delete",
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test-delete",
"change": {
"actions": [

View File

@ -34,6 +34,7 @@
"address": "test_instance.test",
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"change": {
"actions": [

View File

@ -76,6 +76,7 @@
"mode": "managed",
"type": "test_instance",
"name": "test",
"provider_name": "test",
"change": {
"actions": [
"create"
@ -95,6 +96,7 @@
"module_address": "module.module_test_foo",
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"index": 0,
"change": {
@ -116,6 +118,7 @@
"module_address": "module.module_test_foo",
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"index": 1,
"change": {
@ -137,6 +140,7 @@
"module_address": "module.module_test_foo",
"mode": "managed",
"type": "test_instance",
"provider_name": "test",
"name": "test",
"index": 2,
"change": {