providers/aws: compile
This commit is contained in:
parent
175e455999
commit
5dbfed31b6
|
@ -4,6 +4,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/config"
|
"github.com/hashicorp/terraform/helper/config"
|
||||||
|
"github.com/hashicorp/terraform/helper/multierror"
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
"github.com/mitchellh/goamz/ec2"
|
"github.com/mitchellh/goamz/ec2"
|
||||||
)
|
)
|
||||||
|
@ -18,6 +19,11 @@ func (p *ResourceProvider) Validate(c *terraform.ResourceConfig) ([]string, []er
|
||||||
return nil, nil
|
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 {
|
func (p *ResourceProvider) Configure(c *terraform.ResourceConfig) error {
|
||||||
if _, err := config.Decode(&p.Config, c.Config); err != nil {
|
if _, err := config.Decode(&p.Config, c.Config); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -44,7 +50,7 @@ func (p *ResourceProvider) Configure(c *terraform.ResourceConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
return &terraform.MultiError{Errors: errs}
|
return &multierror.Error{Errors: errs}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -109,18 +109,18 @@ func resource_aws_instance_diff(
|
||||||
c *terraform.ResourceConfig,
|
c *terraform.ResourceConfig,
|
||||||
meta interface{}) (*terraform.ResourceDiff, error) {
|
meta interface{}) (*terraform.ResourceDiff, error) {
|
||||||
b := &diff.ResourceBuilder{
|
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_dns",
|
||||||
"public_ip",
|
"public_ip",
|
||||||
"private_dns",
|
"private_dns",
|
||||||
"private_ip",
|
"private_ip",
|
||||||
},
|
},
|
||||||
|
|
||||||
RequiresNewAttrs: []string{
|
|
||||||
"ami",
|
|
||||||
"availability_zone",
|
|
||||||
"instance_type",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.Diff(s, c)
|
return b.Diff(s, c)
|
||||||
|
|
Loading…
Reference in New Issue