2014-06-24 04:32:49 +02:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
2014-07-09 01:17:14 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/config"
|
2014-06-24 04:32:49 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
2014-06-24 19:23:09 +02:00
|
|
|
// resourceMap is the mapping of resources we support to their basic
|
|
|
|
// operations. This makes it easy to implement new resource types.
|
2014-06-24 04:32:49 +02:00
|
|
|
var resourceMap *resource.Map
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
resourceMap = &resource.Map{
|
|
|
|
Mapping: map[string]resource.Resource{
|
2014-07-10 01:00:11 +02:00
|
|
|
"aws_autoscaling_group": resource.Resource{
|
2014-07-15 18:31:49 +02: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-15 23:20:54 +02:00
|
|
|
Update: resource_aws_autoscaling_group_update,
|
2014-07-10 01:00:11 +02:00
|
|
|
},
|
|
|
|
|
2014-07-22 22:26:48 +02:00
|
|
|
"aws_db_instance": resource.Resource{
|
|
|
|
ConfigValidator: resource_aws_db_instance_validation(),
|
|
|
|
Create: resource_aws_db_instance_create,
|
|
|
|
Destroy: resource_aws_db_instance_destroy,
|
|
|
|
Diff: resource_aws_db_instance_diff,
|
|
|
|
Refresh: resource_aws_db_instance_refresh,
|
|
|
|
Update: resource_aws_db_instance_update,
|
|
|
|
},
|
|
|
|
|
2014-07-23 04:22:52 +02:00
|
|
|
"aws_db_security_group": resource.Resource{
|
|
|
|
ConfigValidator: resource_aws_db_security_group_validation(),
|
|
|
|
Create: resource_aws_db_security_group_create,
|
|
|
|
Destroy: resource_aws_db_security_group_destroy,
|
|
|
|
Diff: resource_aws_db_security_group_diff,
|
|
|
|
Refresh: resource_aws_db_security_group_refresh,
|
|
|
|
Update: resource_aws_db_security_group_update,
|
|
|
|
},
|
|
|
|
|
2014-07-24 05:10:20 +02:00
|
|
|
"aws_eip": resource.Resource{
|
|
|
|
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-27 00:53:26 +02:00
|
|
|
Update: resource_aws_eip_update,
|
2014-07-24 05:10:20 +02:00
|
|
|
},
|
|
|
|
|
2014-07-01 20:56:04 +02:00
|
|
|
"aws_elb": resource.Resource{
|
2014-07-15 18:18:36 +02: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 18:47:19 +02:00
|
|
|
},
|
2014-07-07 20:25:54 +02: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 23:16:59 +02:00
|
|
|
Update: resource_aws_instance_update,
|
2014-07-07 20:25:54 +02:00
|
|
|
},
|
2014-07-07 21:16:58 +02:00
|
|
|
|
2014-07-08 01:12:03 +02: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 23:24:36 +02:00
|
|
|
Update: resource_aws_internet_gateway_update,
|
2014-07-08 01:12:03 +02:00
|
|
|
},
|
|
|
|
|
2014-07-10 20:15:58 +02:00
|
|
|
"aws_launch_configuration": resource.Resource{
|
2014-07-15 18:36:29 +02: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 20:15:58 +02:00
|
|
|
},
|
|
|
|
|
2014-07-09 00:56:19 +02:00
|
|
|
"aws_route_table": resource.Resource{
|
2014-07-09 01:17:14 +02:00
|
|
|
ConfigValidator: &config.Validator{
|
2014-07-09 18:47:13 +02:00
|
|
|
Required: []string{
|
|
|
|
"vpc_id",
|
|
|
|
"route.*.cidr_block",
|
|
|
|
},
|
|
|
|
Optional: []string{
|
|
|
|
"route.*.gateway_id",
|
2014-07-17 18:21:55 +02:00
|
|
|
"route.*.instance_id",
|
2014-07-09 18:51:52 +02:00
|
|
|
},
|
2014-07-09 01:17:14 +02:00
|
|
|
},
|
2014-07-09 00:56:19 +02: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-11 00:52:56 +02:00
|
|
|
Update: resource_aws_route_table_update,
|
2014-07-09 00:56:19 +02:00
|
|
|
},
|
|
|
|
|
2014-07-11 02:17:01 +02: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-23 05:08:39 +02:00
|
|
|
"aws_route53_record": resource.Resource{
|
|
|
|
ConfigValidator: resource_aws_r53_record_validation(),
|
|
|
|
Create: resource_aws_r53_record_create,
|
|
|
|
Destroy: resource_aws_r53_record_destroy,
|
|
|
|
Diff: resource_aws_r53_record_diff,
|
|
|
|
Refresh: resource_aws_r53_record_refresh,
|
|
|
|
Update: resource_aws_r53_record_create,
|
|
|
|
},
|
|
|
|
|
2014-07-24 05:10:20 +02:00
|
|
|
"aws_route53_zone": resource.Resource{
|
|
|
|
ConfigValidator: resource_aws_r53_zone_validation(),
|
|
|
|
Create: resource_aws_r53_zone_create,
|
|
|
|
Destroy: resource_aws_r53_zone_destroy,
|
|
|
|
Diff: resource_aws_r53_zone_diff,
|
|
|
|
Refresh: resource_aws_r53_zone_refresh,
|
|
|
|
},
|
|
|
|
|
2014-07-21 20:34:47 +02:00
|
|
|
"aws_s3_bucket": resource.Resource{
|
|
|
|
ConfigValidator: resource_aws_s3_bucket_validation(),
|
|
|
|
Create: resource_aws_s3_bucket_create,
|
|
|
|
Destroy: resource_aws_s3_bucket_destroy,
|
|
|
|
Diff: resource_aws_s3_bucket_diff,
|
|
|
|
Refresh: resource_aws_s3_bucket_refresh,
|
|
|
|
},
|
|
|
|
|
2014-07-08 20:06:39 +02:00
|
|
|
"aws_security_group": resource.Resource{
|
2014-07-15 18:40:20 +02: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 20:06:39 +02:00
|
|
|
},
|
|
|
|
|
2014-07-07 23:46:02 +02: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 21:16:58 +02: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-24 04:32:49 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|