providers/aws: compile

This commit is contained in:
Mitchell Hashimoto 2014-07-03 13:06:24 -07:00
parent 175e455999
commit 5dbfed31b6
2 changed files with 14 additions and 8 deletions

View File

@ -4,6 +4,7 @@ import (
"log"
"github.com/hashicorp/terraform/helper/config"
"github.com/hashicorp/terraform/helper/multierror"
"github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/goamz/ec2"
)
@ -18,6 +19,11 @@ func (p *ResourceProvider) Validate(c *terraform.ResourceConfig) ([]string, []er
return nil, nil
}
func (p *ResourceProvider) ValidateResource(
t string, c *terraform.ResourceConfig) ([]string, []error) {
return nil, nil
}
func (p *ResourceProvider) Configure(c *terraform.ResourceConfig) error {
if _, err := config.Decode(&p.Config, c.Config); err != nil {
return err
@ -44,7 +50,7 @@ func (p *ResourceProvider) Configure(c *terraform.ResourceConfig) error {
}
if len(errs) > 0 {
return &terraform.MultiError{Errors: errs}
return &multierror.Error{Errors: errs}
}
return nil

View File

@ -109,18 +109,18 @@ func resource_aws_instance_diff(
c *terraform.ResourceConfig,
meta interface{}) (*terraform.ResourceDiff, error) {
b := &diff.ResourceBuilder{
CreateComputedAttrs: []string{
Attrs: map[string]diff.AttrType{
"ami": diff.AttrTypeCreate,
"availability_zone": diff.AttrTypeCreate,
"instance_type": diff.AttrTypeCreate,
},
ComputedAttrs: []string{
"public_dns",
"public_ip",
"private_dns",
"private_ip",
},
RequiresNewAttrs: []string{
"ami",
"availability_zone",
"instance_type",
},
}
return b.Diff(s, c)