forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resources.go
139 lines (124 loc) · 4.83 KB
/
resources.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package aws
import (
"github.com/hashicorp/terraform/helper/config"
"github.com/hashicorp/terraform/helper/resource"
)
// resourceMap is the mapping of resources we support to their basic
// operations. This makes it easy to implement new resource types.
var resourceMap *resource.Map
func init() {
resourceMap = &resource.Map{
Mapping: map[string]resource.Resource{
"aws_autoscaling_group": resource.Resource{
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,
Update: resource_aws_autoscaling_group_update,
},
"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,
},
"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,
},
"aws_elb": resource.Resource{
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,
},
"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,
Update: resource_aws_internet_gateway_update,
},
"aws_launch_configuration": resource.Resource{
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,
},
"aws_route_table": resource.Resource{
ConfigValidator: &config.Validator{
Required: []string{
"vpc_id",
"route.*.cidr_block",
},
Optional: []string{
"route.*.gateway_id",
"route.*.instance_id",
},
},
Create: resource_aws_route_table_create,
Destroy: resource_aws_route_table_destroy,
Diff: resource_aws_route_table_diff,
Refresh: resource_aws_route_table_refresh,
Update: resource_aws_route_table_update,
},
"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,
},
"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,
},
"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,
},
"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,
},
"aws_subnet": resource.Resource{
Create: resource_aws_subnet_create,
Destroy: resource_aws_subnet_destroy,
Diff: resource_aws_subnet_diff,
Refresh: resource_aws_subnet_refresh,
},
"aws_vpc": resource.Resource{
Create: resource_aws_vpc_create,
Destroy: resource_aws_vpc_destroy,
Diff: resource_aws_vpc_diff,
Refresh: resource_aws_vpc_refresh,
Update: resource_aws_vpc_update,
},
},
}
}