terraform/builtin/providers/aws/resource_provider.go

43 lines
783 B
Go
Raw Normal View History

2014-05-30 02:28:38 +02:00
package aws
import (
2014-06-18 18:33:13 +02:00
"fmt"
"github.com/hashicorp/terraform/terraform"
)
2014-05-30 02:28:38 +02:00
type ResourceProvider struct {
}
2014-06-13 08:08:47 +02:00
func (p *ResourceProvider) Validate(c *terraform.ResourceConfig) ([]string, []error) {
errs := c.CheckSet([]string{
"access_key",
"secret_key",
})
return nil, errs
2014-06-13 07:39:29 +02:00
}
2014-06-13 07:15:36 +02:00
func (p *ResourceProvider) Configure(*terraform.ResourceConfig) error {
2014-06-07 05:17:38 +02:00
return nil
}
func (p *ResourceProvider) Diff(
s *terraform.ResourceState,
2014-06-13 07:15:36 +02:00
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
2014-06-18 18:33:13 +02:00
b := diffMap.Get(s.Type)
if b == nil {
return nil, fmt.Errorf("Unknown type: %s", s.Type)
}
return b.Diff(s, c)
2014-05-30 02:28:38 +02:00
}
func (p *ResourceProvider) Resources() []terraform.ResourceType {
2014-06-10 20:34:14 +02:00
return []terraform.ResourceType{
terraform.ResourceType{
Name: "aws_instance",
},
}
}