2014-06-23 21:32:49 -05:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
2014-07-08 18:17:14 -05:00
|
|
|
"github.com/hashicorp/terraform/helper/config"
|
2014-06-23 21:32:49 -05:00
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
2014-06-24 12:23:09 -05:00
|
|
|
// resourceMap is the mapping of resources we support to their basic
|
|
|
|
// operations. This makes it easy to implement new resource types.
|
2014-06-23 21:32:49 -05:00
|
|
|
var resourceMap *resource.Map
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
resourceMap = &resource.Map{
|
|
|
|
Mapping: map[string]resource.Resource{
|
2014-07-09 18:00:11 -05:00
|
|
|
"aws_autoscaling_group": resource.Resource{
|
2014-07-15 11:31:49 -05:00
|
|
|
ConfigValidator: resource_aws_autoscaling_group_validation(),
|
|
|
|
Create: resource_aws_autoscaling_group_create,
|
|
|
|
Destroy: resource_aws_autoscaling_group_destroy,
|
|
|
|
Diff: resource_aws_autoscaling_group_diff,
|
|
|
|
Refresh: resource_aws_autoscaling_group_refresh,
|
2014-07-09 18:00:11 -05:00
|
|
|
},
|
|
|
|
|
2014-07-01 13:56:04 -05:00
|
|
|
"aws_elb": resource.Resource{
|
2014-07-15 11:18:36 -05:00
|
|
|
ConfigValidator: resource_aws_elb_validation(),
|
|
|
|
Create: resource_aws_elb_create,
|
|
|
|
Update: resource_aws_elb_update,
|
|
|
|
Destroy: resource_aws_elb_destroy,
|
|
|
|
Diff: resource_aws_elb_diff,
|
|
|
|
Refresh: resource_aws_elb_refresh,
|
2014-06-27 11:47:19 -05:00
|
|
|
},
|
2014-07-07 13:25:54 -05:00
|
|
|
|
2014-07-07 14:19:40 -05:00
|
|
|
"aws_eip": resource.Resource{
|
2014-07-15 11:18:36 -05:00
|
|
|
ConfigValidator: resource_aws_eip_validation(),
|
|
|
|
Create: resource_aws_eip_create,
|
|
|
|
Destroy: resource_aws_eip_destroy,
|
|
|
|
Diff: resource_aws_eip_diff,
|
|
|
|
Refresh: resource_aws_eip_refresh,
|
2014-07-07 14:19:40 -05:00
|
|
|
},
|
|
|
|
|
2014-07-07 13:25:54 -05:00
|
|
|
"aws_instance": resource.Resource{
|
|
|
|
Create: resource_aws_instance_create,
|
|
|
|
Destroy: resource_aws_instance_destroy,
|
|
|
|
Diff: resource_aws_instance_diff,
|
|
|
|
Refresh: resource_aws_instance_refresh,
|
2014-07-14 16:16:59 -05:00
|
|
|
Update: resource_aws_instance_update,
|
2014-07-07 13:25:54 -05:00
|
|
|
},
|
2014-07-07 14:16:58 -05:00
|
|
|
|
2014-07-07 18:12:03 -05:00
|
|
|
"aws_internet_gateway": resource.Resource{
|
|
|
|
Create: resource_aws_internet_gateway_create,
|
|
|
|
Destroy: resource_aws_internet_gateway_destroy,
|
|
|
|
Diff: resource_aws_internet_gateway_diff,
|
|
|
|
Refresh: resource_aws_internet_gateway_refresh,
|
2014-07-10 16:24:36 -05:00
|
|
|
Update: resource_aws_internet_gateway_update,
|
2014-07-07 18:12:03 -05:00
|
|
|
},
|
|
|
|
|
2014-07-10 13:15:58 -05:00
|
|
|
"aws_launch_configuration": resource.Resource{
|
2014-07-15 11:36:29 -05:00
|
|
|
ConfigValidator: resource_aws_launch_configuration_validation(),
|
|
|
|
Create: resource_aws_launch_configuration_create,
|
|
|
|
Destroy: resource_aws_launch_configuration_destroy,
|
|
|
|
Diff: resource_aws_launch_configuration_diff,
|
|
|
|
Refresh: resource_aws_launch_configuration_refresh,
|
2014-07-10 13:15:58 -05:00
|
|
|
},
|
|
|
|
|
2014-07-08 17:56:19 -05:00
|
|
|
"aws_route_table": resource.Resource{
|
2014-07-08 18:17:14 -05:00
|
|
|
ConfigValidator: &config.Validator{
|
2014-07-09 11:47:13 -05:00
|
|
|
Required: []string{
|
|
|
|
"vpc_id",
|
|
|
|
"route.*.cidr_block",
|
|
|
|
},
|
|
|
|
Optional: []string{
|
|
|
|
"route.*.gateway_id",
|
2014-07-09 11:51:52 -05:00
|
|
|
},
|
2014-07-08 18:17:14 -05:00
|
|
|
},
|
2014-07-08 17:56:19 -05:00
|
|
|
Create: resource_aws_route_table_create,
|
|
|
|
Destroy: resource_aws_route_table_destroy,
|
|
|
|
Diff: resource_aws_route_table_diff,
|
|
|
|
Refresh: resource_aws_route_table_refresh,
|
2014-07-10 17:52:56 -05:00
|
|
|
Update: resource_aws_route_table_update,
|
2014-07-08 17:56:19 -05:00
|
|
|
},
|
|
|
|
|
2014-07-10 19:17:01 -05:00
|
|
|
"aws_route_table_association": resource.Resource{
|
|
|
|
ConfigValidator: &config.Validator{
|
|
|
|
Required: []string{
|
|
|
|
"route_table_id",
|
|
|
|
"subnet_id",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Create: resource_aws_route_table_association_create,
|
|
|
|
Destroy: resource_aws_route_table_association_destroy,
|
|
|
|
Diff: resource_aws_route_table_association_diff,
|
|
|
|
Refresh: resource_aws_route_table_association_refresh,
|
|
|
|
Update: resource_aws_route_table_association_update,
|
|
|
|
},
|
|
|
|
|
2014-07-08 13:06:39 -05:00
|
|
|
"aws_security_group": resource.Resource{
|
2014-07-15 11:40:20 -05:00
|
|
|
ConfigValidator: resource_aws_security_group_validation(),
|
|
|
|
Create: resource_aws_security_group_create,
|
|
|
|
Destroy: resource_aws_security_group_destroy,
|
|
|
|
Diff: resource_aws_security_group_diff,
|
|
|
|
Refresh: resource_aws_security_group_refresh,
|
2014-07-08 13:06:39 -05:00
|
|
|
},
|
|
|
|
|
2014-07-07 16:46:02 -05:00
|
|
|
"aws_subnet": resource.Resource{
|
|
|
|
Create: resource_aws_subnet_create,
|
|
|
|
Destroy: resource_aws_subnet_destroy,
|
|
|
|
Diff: resource_aws_subnet_diff,
|
|
|
|
Refresh: resource_aws_subnet_refresh,
|
|
|
|
},
|
|
|
|
|
2014-07-07 14:16:58 -05:00
|
|
|
"aws_vpc": resource.Resource{
|
|
|
|
Create: resource_aws_vpc_create,
|
|
|
|
Destroy: resource_aws_vpc_destroy,
|
|
|
|
Diff: resource_aws_vpc_diff,
|
|
|
|
Refresh: resource_aws_vpc_refresh,
|
|
|
|
},
|
2014-06-23 21:32:49 -05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|