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.ModuleAddress = addr.Module.String()
r.Name = addr.Resource.Resource.Name r.Name = addr.Resource.Resource.Name
r.Type = addr.Resource.Resource.Type r.Type = addr.Resource.Resource.Type
r.ProviderName = rc.ProviderAddr.ProviderConfig.StringCompact()
p.ResourceChanges = append(p.ResourceChanges, r) p.ResourceChanges = append(p.ResourceChanges, r)

View File

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

View File

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

View File

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

View File

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

View File

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