helper/schema: conforms to new API, tests pass
This commit is contained in:
parent
0bcbccf046
commit
81d9d70296
|
@ -136,11 +136,12 @@ func (p *Provider) Configure(c *terraform.ResourceConfig) error {
|
||||||
|
|
||||||
// Apply implementation of terraform.ResourceProvider interface.
|
// Apply implementation of terraform.ResourceProvider interface.
|
||||||
func (p *Provider) Apply(
|
func (p *Provider) Apply(
|
||||||
s *terraform.ResourceState,
|
info *terraform.InstanceInfo,
|
||||||
d *terraform.ResourceDiff) (*terraform.ResourceState, error) {
|
s *terraform.InstanceState,
|
||||||
r, ok := p.ResourcesMap[s.Type]
|
d *terraform.ResourceDiff) (*terraform.InstanceState, error) {
|
||||||
|
r, ok := p.ResourcesMap[info.Type]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("unknown resource type: %s", s.Type)
|
return nil, fmt.Errorf("unknown resource type: %s", info.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Apply(s, d, p.meta)
|
return r.Apply(s, d, p.meta)
|
||||||
|
@ -148,11 +149,12 @@ func (p *Provider) Apply(
|
||||||
|
|
||||||
// Diff implementation of terraform.ResourceProvider interface.
|
// Diff implementation of terraform.ResourceProvider interface.
|
||||||
func (p *Provider) Diff(
|
func (p *Provider) Diff(
|
||||||
s *terraform.ResourceState,
|
info *terraform.InstanceInfo,
|
||||||
|
s *terraform.InstanceState,
|
||||||
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
||||||
r, ok := p.ResourcesMap[s.Type]
|
r, ok := p.ResourcesMap[info.Type]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("unknown resource type: %s", s.Type)
|
return nil, fmt.Errorf("unknown resource type: %s", info.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Diff(s, c)
|
return r.Diff(s, c)
|
||||||
|
@ -160,10 +162,11 @@ func (p *Provider) Diff(
|
||||||
|
|
||||||
// Refresh implementation of terraform.ResourceProvider interface.
|
// Refresh implementation of terraform.ResourceProvider interface.
|
||||||
func (p *Provider) Refresh(
|
func (p *Provider) Refresh(
|
||||||
s *terraform.ResourceState) (*terraform.ResourceState, error) {
|
info *terraform.InstanceInfo,
|
||||||
r, ok := p.ResourcesMap[s.Type]
|
s *terraform.InstanceState) (*terraform.InstanceState, error) {
|
||||||
|
r, ok := p.ResourcesMap[info.Type]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("unknown resource type: %s", s.Type)
|
return nil, fmt.Errorf("unknown resource type: %s", info.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.Refresh(s, p.meta)
|
return r.Refresh(s, p.meta)
|
||||||
|
|
|
@ -61,9 +61,9 @@ type DeleteFunc func(*ResourceData, interface{}) error
|
||||||
|
|
||||||
// Apply creates, updates, and/or deletes a resource.
|
// Apply creates, updates, and/or deletes a resource.
|
||||||
func (r *Resource) Apply(
|
func (r *Resource) Apply(
|
||||||
s *terraform.ResourceState,
|
s *terraform.InstanceState,
|
||||||
d *terraform.ResourceDiff,
|
d *terraform.ResourceDiff,
|
||||||
meta interface{}) (*terraform.ResourceState, error) {
|
meta interface{}) (*terraform.InstanceState, error) {
|
||||||
data, err := schemaMap(r.Schema).Data(s, d)
|
data, err := schemaMap(r.Schema).Data(s, d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return s, err
|
return s, err
|
||||||
|
@ -72,7 +72,7 @@ func (r *Resource) Apply(
|
||||||
if s == nil {
|
if s == nil {
|
||||||
// The Terraform API dictates that this should never happen, but
|
// The Terraform API dictates that this should never happen, but
|
||||||
// it doesn't hurt to be safe in this case.
|
// it doesn't hurt to be safe in this case.
|
||||||
s = new(terraform.ResourceState)
|
s = new(terraform.InstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.Destroy || d.RequiresNew() {
|
if d.Destroy || d.RequiresNew() {
|
||||||
|
@ -99,7 +99,7 @@ func (r *Resource) Apply(
|
||||||
err = r.Create(data, meta)
|
err = r.Create(data, meta)
|
||||||
} else {
|
} else {
|
||||||
if r.Update == nil {
|
if r.Update == nil {
|
||||||
return s, fmt.Errorf("%s doesn't support update", s.Type)
|
return s, fmt.Errorf("doesn't support update")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = r.Update(data, meta)
|
err = r.Update(data, meta)
|
||||||
|
@ -111,7 +111,7 @@ func (r *Resource) Apply(
|
||||||
// Diff returns a diff of this resource and is API compatible with the
|
// Diff returns a diff of this resource and is API compatible with the
|
||||||
// ResourceProvider interface.
|
// ResourceProvider interface.
|
||||||
func (r *Resource) Diff(
|
func (r *Resource) Diff(
|
||||||
s *terraform.ResourceState,
|
s *terraform.InstanceState,
|
||||||
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
||||||
return schemaMap(r.Schema).Diff(s, c)
|
return schemaMap(r.Schema).Diff(s, c)
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,8 @@ func (r *Resource) Validate(c *terraform.ResourceConfig) ([]string, []error) {
|
||||||
|
|
||||||
// Refresh refreshes the state of the resource.
|
// Refresh refreshes the state of the resource.
|
||||||
func (r *Resource) Refresh(
|
func (r *Resource) Refresh(
|
||||||
s *terraform.ResourceState,
|
s *terraform.InstanceState,
|
||||||
meta interface{}) (*terraform.ResourceState, error) {
|
meta interface{}) (*terraform.InstanceState, error) {
|
||||||
data, err := schemaMap(r.Schema).Data(s, nil)
|
data, err := schemaMap(r.Schema).Data(s, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return s, err
|
return s, err
|
||||||
|
|
|
@ -23,13 +23,13 @@ type ResourceData struct {
|
||||||
// Settable (internally)
|
// Settable (internally)
|
||||||
schema map[string]*Schema
|
schema map[string]*Schema
|
||||||
config *terraform.ResourceConfig
|
config *terraform.ResourceConfig
|
||||||
state *terraform.ResourceState
|
state *terraform.InstanceState
|
||||||
diff *terraform.ResourceDiff
|
diff *terraform.ResourceDiff
|
||||||
diffing bool
|
diffing bool
|
||||||
|
|
||||||
// Don't set
|
// Don't set
|
||||||
setMap map[string]string
|
setMap map[string]string
|
||||||
newState *terraform.ResourceState
|
newState *terraform.InstanceState
|
||||||
partial bool
|
partial bool
|
||||||
partialMap map[string]struct{}
|
partialMap map[string]struct{}
|
||||||
once sync.Once
|
once sync.Once
|
||||||
|
@ -168,24 +168,11 @@ func (d *ResourceData) Id() string {
|
||||||
// ConnInfo returns the connection info for this resource.
|
// ConnInfo returns the connection info for this resource.
|
||||||
func (d *ResourceData) ConnInfo() map[string]string {
|
func (d *ResourceData) ConnInfo() map[string]string {
|
||||||
if d.newState != nil {
|
if d.newState != nil {
|
||||||
return d.newState.ConnInfo
|
return d.newState.Ephemeral.ConnInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.state != nil {
|
if d.state != nil {
|
||||||
return d.state.ConnInfo
|
return d.state.Ephemeral.ConnInfo
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dependencies returns the dependencies in this state.
|
|
||||||
func (d *ResourceData) Dependencies() []terraform.ResourceDependency {
|
|
||||||
if d.newState != nil {
|
|
||||||
return d.newState.Dependencies
|
|
||||||
}
|
|
||||||
|
|
||||||
if d.state != nil {
|
|
||||||
return d.state.Dependencies
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -201,19 +188,13 @@ func (d *ResourceData) SetId(v string) {
|
||||||
// SetConnInfo sets the connection info for a resource.
|
// SetConnInfo sets the connection info for a resource.
|
||||||
func (d *ResourceData) SetConnInfo(v map[string]string) {
|
func (d *ResourceData) SetConnInfo(v map[string]string) {
|
||||||
d.once.Do(d.init)
|
d.once.Do(d.init)
|
||||||
d.newState.ConnInfo = v
|
d.newState.Ephemeral.ConnInfo = v
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDependencies sets the dependencies of a resource.
|
// State returns the new InstanceState after the diff and any Set
|
||||||
func (d *ResourceData) SetDependencies(ds []terraform.ResourceDependency) {
|
|
||||||
d.once.Do(d.init)
|
|
||||||
d.newState.Dependencies = ds
|
|
||||||
}
|
|
||||||
|
|
||||||
// State returns the new ResourceState after the diff and any Set
|
|
||||||
// calls.
|
// calls.
|
||||||
func (d *ResourceData) State() *terraform.ResourceState {
|
func (d *ResourceData) State() *terraform.InstanceState {
|
||||||
var result terraform.ResourceState
|
var result terraform.InstanceState
|
||||||
result.ID = d.Id()
|
result.ID = d.Id()
|
||||||
|
|
||||||
// If we have no ID, then this resource doesn't exist and we just
|
// If we have no ID, then this resource doesn't exist and we just
|
||||||
|
@ -223,8 +204,7 @@ func (d *ResourceData) State() *terraform.ResourceState {
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Attributes = d.stateObject("", d.schema)
|
result.Attributes = d.stateObject("", d.schema)
|
||||||
result.ConnInfo = d.ConnInfo()
|
result.Ephemeral.ConnInfo = d.ConnInfo()
|
||||||
result.Dependencies = d.Dependencies()
|
|
||||||
|
|
||||||
if v := d.Id(); v != "" {
|
if v := d.Id(); v != "" {
|
||||||
result.Attributes["id"] = d.Id()
|
result.Attributes["id"] = d.Id()
|
||||||
|
@ -234,7 +214,7 @@ func (d *ResourceData) State() *terraform.ResourceState {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *ResourceData) init() {
|
func (d *ResourceData) init() {
|
||||||
var copyState terraform.ResourceState
|
var copyState terraform.InstanceState
|
||||||
if d.state != nil {
|
if d.state != nil {
|
||||||
copyState = *d.state
|
copyState = *d.state
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
func TestResourceDataGet(t *testing.T) {
|
func TestResourceDataGet(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
Key string
|
Key string
|
||||||
Value interface{}
|
Value interface{}
|
||||||
|
@ -104,7 +104,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "bar",
|
"availability_zone": "bar",
|
||||||
},
|
},
|
||||||
|
@ -127,7 +127,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
},
|
},
|
||||||
|
@ -157,7 +157,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"port": "80",
|
"port": "80",
|
||||||
},
|
},
|
||||||
|
@ -179,7 +179,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "1",
|
"ports.0": "1",
|
||||||
|
@ -202,7 +202,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "1",
|
"ports.0": "1",
|
||||||
|
@ -241,7 +241,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "1",
|
"ports.0": "1",
|
||||||
|
@ -342,7 +342,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
},
|
},
|
||||||
|
@ -440,7 +440,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "2",
|
"config_vars.#": "2",
|
||||||
"config_vars.0.foo": "baz",
|
"config_vars.0.foo": "baz",
|
||||||
|
@ -475,7 +475,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "1",
|
"config_vars.#": "1",
|
||||||
"config_vars.0.FOO": "bar",
|
"config_vars.0.FOO": "bar",
|
||||||
|
@ -514,7 +514,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "1",
|
"ports.#": "1",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -549,7 +549,7 @@ func TestResourceDataGet(t *testing.T) {
|
||||||
func TestResourceDataGetChange(t *testing.T) {
|
func TestResourceDataGetChange(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
Key string
|
Key string
|
||||||
OldValue interface{}
|
OldValue interface{}
|
||||||
|
@ -593,7 +593,7 @@ func TestResourceDataGetChange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
},
|
},
|
||||||
|
@ -635,7 +635,7 @@ func TestResourceDataGetChange(t *testing.T) {
|
||||||
func TestResourceDataGetOk(t *testing.T) {
|
func TestResourceDataGetOk(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
Key string
|
Key string
|
||||||
Value interface{}
|
Value interface{}
|
||||||
|
@ -798,7 +798,7 @@ func TestResourceDataGetOk(t *testing.T) {
|
||||||
func TestResourceDataHasChange(t *testing.T) {
|
func TestResourceDataHasChange(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
Key string
|
Key string
|
||||||
Change bool
|
Change bool
|
||||||
|
@ -840,7 +840,7 @@ func TestResourceDataHasChange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
},
|
},
|
||||||
|
@ -878,7 +878,7 @@ func TestResourceDataHasChange(t *testing.T) {
|
||||||
func TestResourceDataSet(t *testing.T) {
|
func TestResourceDataSet(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
Key string
|
Key string
|
||||||
Value interface{}
|
Value interface{}
|
||||||
|
@ -1002,7 +1002,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "1",
|
"ports.0": "1",
|
||||||
|
@ -1079,7 +1079,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "2",
|
"ingress.#": "2",
|
||||||
"ingress.0.from": "80",
|
"ingress.0.from": "80",
|
||||||
|
@ -1119,7 +1119,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "2",
|
"ingress.#": "2",
|
||||||
"ingress.0.from": "80",
|
"ingress.0.from": "80",
|
||||||
|
@ -1164,7 +1164,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "2",
|
"ingress.#": "2",
|
||||||
"ingress.0.from": "80",
|
"ingress.0.from": "80",
|
||||||
|
@ -1288,7 +1288,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "100",
|
"ports.0": "100",
|
||||||
|
@ -1318,7 +1318,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "100",
|
"ports.0": "100",
|
||||||
|
@ -1353,7 +1353,7 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "100",
|
"ports.0": "100",
|
||||||
|
@ -1394,10 +1394,10 @@ func TestResourceDataSet(t *testing.T) {
|
||||||
func TestResourceDataState(t *testing.T) {
|
func TestResourceDataState(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
Set map[string]interface{}
|
Set map[string]interface{}
|
||||||
Result *terraform.ResourceState
|
Result *terraform.InstanceState
|
||||||
Partial []string
|
Partial []string
|
||||||
}{
|
}{
|
||||||
// Basic primitive in diff
|
// Basic primitive in diff
|
||||||
|
@ -1423,7 +1423,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
},
|
},
|
||||||
|
@ -1457,7 +1457,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
"availability_zone": "bar",
|
"availability_zone": "bar",
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "bar",
|
"availability_zone": "bar",
|
||||||
},
|
},
|
||||||
|
@ -1480,7 +1480,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
"vpc": true,
|
"vpc": true,
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"vpc": "true",
|
"vpc": "true",
|
||||||
},
|
},
|
||||||
|
@ -1510,7 +1510,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
},
|
},
|
||||||
|
@ -1527,7 +1527,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "1",
|
"ports.#": "1",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -1547,7 +1547,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -1573,7 +1573,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "1",
|
"ingress.#": "1",
|
||||||
"ingress.0.from": "80",
|
"ingress.0.from": "80",
|
||||||
|
@ -1597,7 +1597,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "2",
|
"ingress.#": "2",
|
||||||
"ingress.0.from": "150",
|
"ingress.0.from": "150",
|
||||||
|
@ -1619,7 +1619,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "2",
|
"config_vars.#": "2",
|
||||||
"config_vars.0.foo": "bar",
|
"config_vars.0.foo": "bar",
|
||||||
|
@ -1642,7 +1642,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "2",
|
"config_vars.#": "2",
|
||||||
"config_vars.0.foo": "bar",
|
"config_vars.0.foo": "bar",
|
||||||
|
@ -1664,7 +1664,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "1",
|
"config_vars.#": "1",
|
||||||
"config_vars.0.FOO": "bar",
|
"config_vars.0.FOO": "bar",
|
||||||
|
@ -1684,7 +1684,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{},
|
Attributes: map[string]string{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1700,7 +1700,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"id": "bar",
|
"id": "bar",
|
||||||
|
@ -1717,7 +1717,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"id": "bar",
|
"id": "bar",
|
||||||
|
@ -1740,7 +1740,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "100",
|
"ports.0": "100",
|
||||||
|
@ -1751,7 +1751,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
|
|
||||||
Diff: nil,
|
Diff: nil,
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -1789,7 +1789,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
|
|
||||||
Partial: []string{},
|
Partial: []string{},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{},
|
Attributes: map[string]string{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1804,7 +1804,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "1",
|
"ports.#": "1",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -1826,7 +1826,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
|
|
||||||
Partial: []string{},
|
Partial: []string{},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "1",
|
"ports.#": "1",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -1851,7 +1851,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "1",
|
"ingress.#": "1",
|
||||||
"ingress.0.from": "80",
|
"ingress.0.from": "80",
|
||||||
|
@ -1877,7 +1877,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
|
|
||||||
Partial: []string{},
|
Partial: []string{},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ingress.#": "1",
|
"ingress.#": "1",
|
||||||
"ingress.0.from": "80",
|
"ingress.0.from": "80",
|
||||||
|
@ -1898,7 +1898,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "2",
|
"config_vars.#": "2",
|
||||||
"config_vars.0.foo": "bar",
|
"config_vars.0.foo": "bar",
|
||||||
|
@ -1923,7 +1923,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
|
|
||||||
Partial: []string{},
|
Partial: []string{},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "2",
|
"config_vars.#": "2",
|
||||||
"config_vars.0.foo": "bar",
|
"config_vars.0.foo": "bar",
|
||||||
|
@ -1947,7 +1947,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "100",
|
"ports.0": "100",
|
||||||
|
@ -1966,7 +1966,7 @@ func TestResourceDataState(t *testing.T) {
|
||||||
|
|
||||||
Partial: []string{},
|
Partial: []string{},
|
||||||
|
|
||||||
Result: &terraform.ResourceState{
|
Result: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "80",
|
"ports.0": "80",
|
||||||
|
@ -2029,24 +2029,7 @@ func TestResourceDataSetConnInfo(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
actual := d.State()
|
actual := d.State()
|
||||||
if !reflect.DeepEqual(actual.ConnInfo, expected) {
|
if !reflect.DeepEqual(actual.Ephemeral.ConnInfo, expected) {
|
||||||
t.Fatalf("bad: %#v", actual)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestResourceDataSetDependencies(t *testing.T) {
|
|
||||||
d := &ResourceData{}
|
|
||||||
d.SetId("foo")
|
|
||||||
d.SetDependencies([]terraform.ResourceDependency{
|
|
||||||
terraform.ResourceDependency{ID: "foo"},
|
|
||||||
})
|
|
||||||
|
|
||||||
expected := []terraform.ResourceDependency{
|
|
||||||
terraform.ResourceDependency{ID: "foo"},
|
|
||||||
}
|
|
||||||
|
|
||||||
actual := d.State()
|
|
||||||
if !reflect.DeepEqual(actual.Dependencies, expected) {
|
|
||||||
t.Fatalf("bad: %#v", actual)
|
t.Fatalf("bad: %#v", actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2063,7 +2046,7 @@ func TestResourceDataSetId(t *testing.T) {
|
||||||
|
|
||||||
func TestResourceDataSetId_clear(t *testing.T) {
|
func TestResourceDataSetId_clear(t *testing.T) {
|
||||||
d := &ResourceData{
|
d := &ResourceData{
|
||||||
state: &terraform.ResourceState{ID: "bar"},
|
state: &terraform.InstanceState{ID: "bar"},
|
||||||
}
|
}
|
||||||
d.SetId("")
|
d.SetId("")
|
||||||
|
|
||||||
|
@ -2075,7 +2058,7 @@ func TestResourceDataSetId_clear(t *testing.T) {
|
||||||
|
|
||||||
func TestResourceDataSetId_override(t *testing.T) {
|
func TestResourceDataSetId_override(t *testing.T) {
|
||||||
d := &ResourceData{
|
d := &ResourceData{
|
||||||
state: &terraform.ResourceState{ID: "bar"},
|
state: &terraform.InstanceState{ID: "bar"},
|
||||||
}
|
}
|
||||||
d.SetId("foo")
|
d.SetId("foo")
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ func TestResourceApply_create(t *testing.T) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var s *terraform.ResourceState = nil
|
var s *terraform.InstanceState = nil
|
||||||
|
|
||||||
d := &terraform.ResourceDiff{
|
d := &terraform.ResourceDiff{
|
||||||
Attributes: map[string]*terraform.ResourceAttrDiff{
|
Attributes: map[string]*terraform.ResourceAttrDiff{
|
||||||
|
@ -44,7 +44,7 @@ func TestResourceApply_create(t *testing.T) {
|
||||||
t.Fatal("not called")
|
t.Fatal("not called")
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := &terraform.ResourceState{
|
expected := &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"id": "foo",
|
"id": "foo",
|
||||||
|
@ -73,7 +73,7 @@ func TestResourceApply_destroy(t *testing.T) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &terraform.ResourceState{
|
s := &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ func TestResourceApply_destroyPartial(t *testing.T) {
|
||||||
return fmt.Errorf("some error")
|
return fmt.Errorf("some error")
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &terraform.ResourceState{
|
s := &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"foo": "12",
|
"foo": "12",
|
||||||
|
@ -126,7 +126,7 @@ func TestResourceApply_destroyPartial(t *testing.T) {
|
||||||
t.Fatal("should error")
|
t.Fatal("should error")
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := &terraform.ResourceState{
|
expected := &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"id": "bar",
|
"id": "bar",
|
||||||
|
@ -154,7 +154,7 @@ func TestResourceApply_update(t *testing.T) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &terraform.ResourceState{
|
s := &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"foo": "12",
|
"foo": "12",
|
||||||
|
@ -174,7 +174,7 @@ func TestResourceApply_update(t *testing.T) {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := &terraform.ResourceState{
|
expected := &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"id": "foo",
|
"id": "foo",
|
||||||
|
@ -199,7 +199,7 @@ func TestResourceApply_updateNoCallback(t *testing.T) {
|
||||||
|
|
||||||
r.Update = nil
|
r.Update = nil
|
||||||
|
|
||||||
s := &terraform.ResourceState{
|
s := &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"foo": "12",
|
"foo": "12",
|
||||||
|
@ -219,7 +219,7 @@ func TestResourceApply_updateNoCallback(t *testing.T) {
|
||||||
t.Fatal("should error")
|
t.Fatal("should error")
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := &terraform.ResourceState{
|
expected := &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"foo": "12",
|
"foo": "12",
|
||||||
|
@ -282,14 +282,14 @@ func TestResourceRefresh(t *testing.T) {
|
||||||
return d.Set("foo", d.Get("foo").(int)+1)
|
return d.Set("foo", d.Get("foo").(int)+1)
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &terraform.ResourceState{
|
s := &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"foo": "12",
|
"foo": "12",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := &terraform.ResourceState{
|
expected := &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"id": "bar",
|
"id": "bar",
|
||||||
|
@ -322,7 +322,7 @@ func TestResourceRefresh_delete(t *testing.T) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &terraform.ResourceState{
|
s := &terraform.InstanceState{
|
||||||
ID: "bar",
|
ID: "bar",
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"foo": "12",
|
"foo": "12",
|
||||||
|
|
|
@ -162,7 +162,7 @@ type schemaMap map[string]*Schema
|
||||||
//
|
//
|
||||||
// The diff is optional.
|
// The diff is optional.
|
||||||
func (m schemaMap) Data(
|
func (m schemaMap) Data(
|
||||||
s *terraform.ResourceState,
|
s *terraform.InstanceState,
|
||||||
d *terraform.ResourceDiff) (*ResourceData, error) {
|
d *terraform.ResourceDiff) (*ResourceData, error) {
|
||||||
return &ResourceData{
|
return &ResourceData{
|
||||||
schema: m,
|
schema: m,
|
||||||
|
@ -174,7 +174,7 @@ func (m schemaMap) Data(
|
||||||
// Diff returns the diff for a resource given the schema map,
|
// Diff returns the diff for a resource given the schema map,
|
||||||
// state, and configuration.
|
// state, and configuration.
|
||||||
func (m schemaMap) Diff(
|
func (m schemaMap) Diff(
|
||||||
s *terraform.ResourceState,
|
s *terraform.InstanceState,
|
||||||
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
|
||||||
result := new(terraform.ResourceDiff)
|
result := new(terraform.ResourceDiff)
|
||||||
result.Attributes = make(map[string]*terraform.ResourceAttrDiff)
|
result.Attributes = make(map[string]*terraform.ResourceAttrDiff)
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
func TestSchemaMap_Diff(t *testing.T) {
|
func TestSchemaMap_Diff(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
Schema map[string]*Schema
|
Schema map[string]*Schema
|
||||||
State *terraform.ResourceState
|
State *terraform.InstanceState
|
||||||
Config map[string]interface{}
|
Config map[string]interface{}
|
||||||
ConfigVariables map[string]string
|
ConfigVariables map[string]string
|
||||||
Diff *terraform.ResourceDiff
|
Diff *terraform.ResourceDiff
|
||||||
|
@ -87,7 +87,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "3",
|
"ports.#": "3",
|
||||||
"ports.0": "1",
|
"ports.0": "1",
|
||||||
|
@ -421,7 +421,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "1",
|
"ports.0": "1",
|
||||||
|
@ -577,7 +577,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "2",
|
"ports.0": "2",
|
||||||
|
@ -617,7 +617,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"ports.#": "2",
|
"ports.#": "2",
|
||||||
"ports.0": "2",
|
"ports.0": "2",
|
||||||
|
@ -658,7 +658,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "bar",
|
"availability_zone": "bar",
|
||||||
"ports.#": "1",
|
"ports.#": "1",
|
||||||
|
@ -737,7 +737,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
"port": "80",
|
"port": "80",
|
||||||
|
@ -767,7 +767,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"port": "80",
|
"port": "80",
|
||||||
},
|
},
|
||||||
|
@ -803,7 +803,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "foo",
|
"availability_zone": "foo",
|
||||||
"port": "80",
|
"port": "80",
|
||||||
|
@ -843,7 +843,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "1",
|
"config_vars.#": "1",
|
||||||
"config_vars.0.foo": "bar",
|
"config_vars.0.foo": "bar",
|
||||||
|
@ -882,7 +882,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"config_vars.#": "1",
|
"config_vars.#": "1",
|
||||||
"config_vars.0.foo": "bar",
|
"config_vars.0.foo": "bar",
|
||||||
|
@ -931,7 +931,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "bar",
|
"availability_zone": "bar",
|
||||||
"address": "foo",
|
"address": "foo",
|
||||||
|
@ -979,7 +979,7 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
State: &terraform.ResourceState{
|
State: &terraform.InstanceState{
|
||||||
Attributes: map[string]string{
|
Attributes: map[string]string{
|
||||||
"availability_zone": "bar",
|
"availability_zone": "bar",
|
||||||
"ports.#": "1",
|
"ports.#": "1",
|
||||||
|
|
Loading…
Reference in New Issue