Update documentation to include new "project" attribute
This commit also normalizes the format we display attributes.
This commit is contained in:
parent
bacf5abf3c
commit
29b073158f
|
@ -27,9 +27,10 @@ func resourceComputeAddress() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
|
@ -38,10 +39,9 @@ func resourceComputeAddress() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -23,16 +23,17 @@ func resourceComputeAutoscaler() *schema.Resource {
|
|||
Required: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"target": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"autoscaling_policy": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -105,15 +106,9 @@ func resourceComputeAutoscaler() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
|
@ -121,6 +116,11 @@ func resourceComputeAutoscaler() *schema.Resource {
|
|||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,10 +20,36 @@ func resourceComputeBackendService() *schema.Resource {
|
|||
Delete: resourceComputeBackendServiceDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
re := `^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$`
|
||||
if !regexp.MustCompile(re).MatchString(value) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q (%q) doesn't match regexp %q", k, value, re))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"health_checks": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Required: true,
|
||||
Set: schema.HashString,
|
||||
},
|
||||
|
||||
"backend": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"group": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
"balancing_mode": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -38,10 +64,6 @@ func resourceComputeBackendService() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
"group": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
"max_rate": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
|
@ -66,32 +88,9 @@ func resourceComputeBackendService() *schema.Resource {
|
|||
Optional: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
"fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
ForceNew: true,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"health_checks": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Required: true,
|
||||
Set: schema.HashString,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
re := `^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$`
|
||||
if !regexp.MustCompile(re).MatchString(value) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q (%q) doesn't match regexp %q", k, value, re))
|
||||
}
|
||||
return
|
||||
},
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"port_name": &schema.Schema{
|
||||
|
@ -100,21 +99,22 @@ func resourceComputeBackendService() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"protocol": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"timeout_sec": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"fingerprint": &schema.Schema{
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
|
@ -122,10 +122,10 @@ func resourceComputeBackendService() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
"timeout_sec": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -34,30 +34,30 @@ func resourceComputeDisk() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"size": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"snapshot": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
"snapshot": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
|
|
@ -26,11 +26,6 @@ func resourceComputeFirewall() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"network": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
|
@ -58,6 +53,22 @@ func resourceComputeFirewall() *schema.Resource {
|
|||
Set: resourceComputeFirewallAllowHash,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"source_ranges": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
|
@ -78,17 +89,6 @@ func resourceComputeFirewall() *schema.Resource {
|
|||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: schema.HashString,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,24 @@ func resourceComputeForwardingRule() *schema.Resource {
|
|||
Update: resourceComputeForwardingRuleUpdate,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"target": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: false,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ip_address": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -31,46 +49,28 @@ func resourceComputeForwardingRule() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"port_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"target": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: false,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,16 +27,16 @@ func resourceComputeGlobalAddress() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,23 @@ func resourceComputeGlobalForwardingRule() *schema.Resource {
|
|||
Delete: resourceComputeGlobalForwardingRuleDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"target": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ip_address": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -31,32 +48,16 @@ func resourceComputeGlobalForwardingRule() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"port_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"target": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
|
@ -66,10 +67,9 @@ func resourceComputeGlobalForwardingRule() *schema.Resource {
|
|||
Deprecated: "Please remove this attribute (it was never used)",
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -17,6 +17,12 @@ func resourceComputeHttpHealthCheck() *schema.Resource {
|
|||
Update: resourceComputeHttpHealthCheckUpdate,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"check_interval_sec": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
|
@ -39,18 +45,18 @@ func resourceComputeHttpHealthCheck() *schema.Resource {
|
|||
Optional: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"port": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 80,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"request_path": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -73,12 +79,6 @@ func resourceComputeHttpHealthCheck() *schema.Resource {
|
|||
Optional: true,
|
||||
Default: 2,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,12 @@ func resourceComputeHttpsHealthCheck() *schema.Resource {
|
|||
Update: resourceComputeHttpsHealthCheckUpdate,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"check_interval_sec": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
|
@ -39,18 +45,18 @@ func resourceComputeHttpsHealthCheck() *schema.Resource {
|
|||
Optional: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"port": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 443,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"request_path": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -73,12 +79,6 @@ func resourceComputeHttpsHealthCheck() *schema.Resource {
|
|||
Optional: true,
|
||||
Default: 2,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,30 +26,6 @@ func resourceComputeInstance() *schema.Resource {
|
|||
MigrateState: resourceComputeInstanceMigrateState,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"machine_type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"disk": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
|
@ -103,6 +79,55 @@ func resourceComputeInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"machine_type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"can_ip_forward": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"metadata": &schema.Schema{
|
||||
Type: schema.TypeMap,
|
||||
Optional: true,
|
||||
Elem: schema.TypeString,
|
||||
ValidateFunc: validateInstanceMetadata,
|
||||
},
|
||||
|
||||
"metadata_startup_script": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"metadata_fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"network_interface": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -189,24 +214,38 @@ func resourceComputeInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"can_ip_forward": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"metadata_startup_script": &schema.Schema{
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"metadata": &schema.Schema{
|
||||
Type: schema.TypeMap,
|
||||
Optional: true,
|
||||
Elem: schema.TypeString,
|
||||
ValidateFunc: validateInstanceMetadata,
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"scheduling": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"on_host_maintenance": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"automatic_restart": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"preemptible": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
"service_account": &schema.Schema{
|
||||
|
@ -237,29 +276,6 @@ func resourceComputeInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"scheduling": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"on_host_maintenance": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"automatic_restart": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"preemptible": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
"tags": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
|
@ -267,26 +283,10 @@ func resourceComputeInstance() *schema.Resource {
|
|||
Set: schema.HashString,
|
||||
},
|
||||
|
||||
"metadata_fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"tags_fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,12 +25,24 @@ func resourceComputeInstanceGroup() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instances": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"named_port": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -49,38 +61,26 @@ func resourceComputeInstanceGroup() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"instances": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"network": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"size": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"size": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,24 +19,35 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
|||
Delete: resourceComputeInstanceGroupManagerDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"base_instance_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instance_template": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"base_instance_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
|
@ -47,17 +58,11 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"instance_template": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"named_port": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
|
@ -71,6 +76,17 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"update_strategy": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -89,23 +105,6 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
|||
Computed: true,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,37 +16,6 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
|||
Delete: resourceComputeInstanceTemplateDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"can_ip_forward": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instance_description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"machine_type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"disk": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
|
@ -123,12 +92,56 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"machine_type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"automatic_restart": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: true,
|
||||
ForceNew: true,
|
||||
Deprecated: "Please use `scheduling.automatic_restart` instead",
|
||||
},
|
||||
|
||||
"can_ip_forward": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instance_description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"metadata": &schema.Schema{
|
||||
Type: schema.TypeMap,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"metadata_fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"network_interface": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -164,14 +177,6 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"automatic_restart": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: true,
|
||||
ForceNew: true,
|
||||
Deprecated: "Please use `scheduling.automatic_restart` instead",
|
||||
},
|
||||
|
||||
"on_host_maintenance": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -179,6 +184,18 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
|||
Deprecated: "Please use `scheduling.on_host_maintenance` instead",
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"scheduling": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -207,6 +224,11 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"service_account": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -242,32 +264,10 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
|||
Set: schema.HashString,
|
||||
},
|
||||
|
||||
"metadata_fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"tags_fingerprint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,18 +22,6 @@ func resourceComputeNetwork() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ipv4_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Deprecated: "Please use google_compute_subnetwork resources instead.",
|
||||
},
|
||||
|
||||
"gateway_ipv4": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"auto_create_subnetworks": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
|
@ -52,16 +40,28 @@ func resourceComputeNetwork() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
"gateway_ipv4": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"ipv4_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Deprecated: "Please use google_compute_subnetwork resources instead.",
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,13 @@ func resourceComputeRoute() *schema.Resource {
|
|||
Delete: resourceComputeRouteDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"dest_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"dest_range": &schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
|
@ -34,7 +34,13 @@ func resourceComputeRoute() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"next_hop_ip": &schema.Schema{
|
||||
"priority": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"next_hop_gateway": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
@ -52,7 +58,7 @@ func resourceComputeRoute() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"next_hop_gateway": &schema.Schema{
|
||||
"next_hop_ip": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
@ -69,12 +75,17 @@ func resourceComputeRoute() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"priority": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"tags": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
|
@ -82,17 +93,6 @@ func resourceComputeRoute() *schema.Resource {
|
|||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: schema.HashString,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,19 +17,13 @@ func resourceComputeSslCertificate() *schema.Resource {
|
|||
Delete: resourceComputeSslCertificateDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"certificate": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"certificate": &schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
|
@ -41,9 +35,10 @@ func resourceComputeSslCertificate() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"id": &schema.Schema{
|
||||
|
@ -56,6 +51,11 @@ func resourceComputeSslCertificate() *schema.Resource {
|
|||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,30 +18,24 @@ func resourceComputeSubnetwork() *schema.Resource {
|
|||
Delete: resourceComputeSubnetworkDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"ip_cidr_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"network": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ip_cidr_range": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -53,16 +47,22 @@ func resourceComputeSubnetwork() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,11 @@ func splitSubnetID(id string) (region string, name string) {
|
|||
func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) error {
|
||||
config := meta.(*Config)
|
||||
|
||||
region, err := getRegion(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
project, err := getProject(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -93,7 +98,6 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
|
|||
IpCidrRange: d.Get("ip_cidr_range").(string),
|
||||
Network: d.Get("network").(string),
|
||||
}
|
||||
region := d.Get("region").(string)
|
||||
|
||||
log.Printf("[DEBUG] Subnetwork insert request: %#v", subnetwork)
|
||||
op, err := config.clientCompute.Subnetworks.Insert(
|
||||
|
@ -122,13 +126,17 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
|
|||
func resourceComputeSubnetworkRead(d *schema.ResourceData, meta interface{}) error {
|
||||
config := meta.(*Config)
|
||||
|
||||
region, err := getRegion(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
project, err := getProject(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
name := d.Get("name").(string)
|
||||
region := d.Get("region").(string)
|
||||
|
||||
subnetwork, err := config.clientCompute.Subnetworks.Get(
|
||||
project, region, name).Do()
|
||||
|
@ -153,12 +161,15 @@ func resourceComputeSubnetworkRead(d *schema.ResourceData, meta interface{}) err
|
|||
func resourceComputeSubnetworkDelete(d *schema.ResourceData, meta interface{}) error {
|
||||
config := meta.(*Config)
|
||||
|
||||
project, err := getProject(d, config)
|
||||
region, err := getRegion(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
region := d.Get("region").(string)
|
||||
project, err := getProject(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete the subnetwork
|
||||
op, err := config.clientCompute.Subnetworks.Delete(
|
||||
|
|
|
@ -24,32 +24,32 @@ func resourceComputeTargetHttpProxy() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"url_map": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"url_map": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,17 @@ func resourceComputeTargetHttpsProxy() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ssl_certificates": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"url_map": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -40,17 +51,6 @@ func resourceComputeTargetHttpsProxy() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"url_map": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"ssl_certificates": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
|
|
@ -18,6 +18,12 @@ func resourceComputeTargetPool() *schema.Resource {
|
|||
Update: resourceComputeTargetPoolUpdate,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"backup_pool": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -50,18 +56,7 @@ func resourceComputeTargetPool() *schema.Resource {
|
|||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"session_affinity": &schema.Schema{
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
@ -73,7 +68,12 @@ func resourceComputeTargetPool() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"session_affinity": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
|
|
@ -18,22 +18,17 @@ func resourceComputeUrlMap() *schema.Resource {
|
|||
Delete: resourceComputeUrlMapDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"default_service": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"default_service": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -68,6 +63,11 @@ func resourceComputeUrlMap() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"path_matcher": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -110,6 +110,12 @@ func resourceComputeUrlMap() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
|
@ -142,12 +148,6 @@ func resourceComputeUrlMap() *schema.Resource {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,29 +24,34 @@ func resourceComputeVpnGateway() *schema.Resource {
|
|||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"network": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"self_link": &schema.Schema{
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"project": &schema.Schema{
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -26,33 +26,44 @@ func resourceComputeVpnTunnel() *schema.Resource {
|
|||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"peer_ip": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: validatePeerAddr,
|
||||
},
|
||||
|
||||
"shared_secret": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"target_vpn_gateway": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"detailed_status": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"ike_version": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 2,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"local_traffic_selector": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
|
@ -60,23 +71,22 @@ func resourceComputeVpnTunnel() *schema.Resource {
|
|||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: schema.HashString,
|
||||
},
|
||||
"detailed_status": &schema.Schema{
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"project": &schema.Schema{
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -21,60 +21,12 @@ func resourceContainerCluster() *schema.Resource {
|
|||
Delete: resourceContainerClusterDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
"initial_node_count": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"node_version": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"cluster_ipv4_cidr": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
_, ipnet, err := net.ParseCIDR(value)
|
||||
|
||||
if err != nil || ipnet == nil || value != ipnet.String() {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q must contain a valid CIDR", k))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"endpoint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"logging_service": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"monitoring_service": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"master_auth": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
|
@ -93,13 +45,11 @@ func resourceContainerCluster() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"password": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"username": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
|
@ -136,6 +86,60 @@ func resourceContainerCluster() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"cluster_ipv4_cidr": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
_, ipnet, err := net.ParseCIDR(value)
|
||||
|
||||
if err != nil || ipnet == nil || value != ipnet.String() {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q must contain a valid CIDR", k))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"endpoint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"instance_group_urls": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"logging_service": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"monitoring_service": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"network": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -184,16 +188,10 @@ func resourceContainerCluster() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"initial_node_count": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instance_group_urls": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
"node_version": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
|
|
|
@ -16,13 +16,13 @@ func resourceDnsManagedZone() *schema.Resource {
|
|||
Delete: resourceDnsManagedZoneDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"dns_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"dns_name": &schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
|
|
|
@ -17,30 +17,18 @@ func resourceDnsRecordSet() *schema.Resource {
|
|||
Delete: resourceDnsRecordSetDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"managed_zone": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"type": &schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ttl": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"rrdatas": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
|
@ -50,6 +38,18 @@ func resourceDnsRecordSet() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"ttl": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
|
|
@ -20,12 +20,24 @@ func resourcePubsubSubscription() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"topic": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ack_deadline_seconds": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"push_config": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -47,18 +59,6 @@ func resourcePubsubSubscription() *schema.Resource {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
"topic": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,20 +22,23 @@ func resourceSqlDatabase() *schema.Resource {
|
|||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instance": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,32 +19,12 @@ func resourceSqlDatabaseInstance() *schema.Resource {
|
|||
Delete: resourceSqlDatabaseInstanceDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"master_instance_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"database_version": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "MYSQL_5_5",
|
||||
ForceNew: true,
|
||||
},
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"settings": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Required: true,
|
||||
|
@ -170,6 +150,14 @@ func resourceSqlDatabaseInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
"database_version": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "MYSQL_5_5",
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"ip_address": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
|
@ -187,6 +175,26 @@ func resourceSqlDatabaseInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"master_instance_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"replica_configuration": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -246,10 +254,9 @@ func resourceSqlDatabaseInstance() *schema.Resource {
|
|||
},
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -18,17 +18,6 @@ func resourceSqlUser() *schema.Resource {
|
|||
Delete: resourceSqlUserDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"password": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"host": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
|
@ -41,6 +30,17 @@ func resourceSqlUser() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"password": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
|
|
@ -24,23 +24,38 @@ func resourceStorageBucket() *schema.Resource {
|
|||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"predefined_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Deprecated: "Please use resource \"storage_bucket_acl.predefined_acl\" instead.",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
||||
"force_destroy": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
},
|
||||
|
||||
"location": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Default: "US",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"force_destroy": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
|
||||
"predefined_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Deprecated: "Please use resource \"storage_bucket_acl.predefined_acl\" instead.",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"website": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
|
@ -57,15 +72,6 @@ func resourceStorageBucket() *schema.Resource {
|
|||
},
|
||||
},
|
||||
},
|
||||
"self_link": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"project": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,20 +24,23 @@ func resourceStorageBucketAcl() *schema.Resource {
|
|||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"default_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
|
||||
"predefined_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"role_entity": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
"default_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,13 +32,6 @@ func resourceStorageBucketObject() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"source": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
ConflictsWith: []string{"content"},
|
||||
},
|
||||
|
||||
"content": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
|
@ -46,6 +39,16 @@ func resourceStorageBucketObject() *schema.Resource {
|
|||
ConflictsWith: []string{"source"},
|
||||
},
|
||||
|
||||
"crc32c": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"md5hash": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"predefined_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Deprecated: "Please use resource \"storage_object_acl.predefined_acl\" instead.",
|
||||
|
@ -53,14 +56,11 @@ func resourceStorageBucketObject() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"md5hash": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"crc32c": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
"source": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
ConflictsWith: []string{"content"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -23,21 +23,24 @@ func resourceStorageObjectAcl() *schema.Resource {
|
|||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"object": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"role_entity": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
|
||||
"predefined_acl": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"role_entity": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ Use the navigation to the left to read about the available resources.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
# Configure the Google Cloud provider
|
||||
```js
|
||||
// Configure the Google Cloud provider
|
||||
provider "google" {
|
||||
credentials = "${file("account.json")}"
|
||||
project = "my-gce-project"
|
||||
region = "us-central1"
|
||||
}
|
||||
|
||||
# Create a new instance
|
||||
// Create a new instance
|
||||
resource "google_compute_instance" "default" {
|
||||
...
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -8,16 +8,16 @@ description: |-
|
|||
|
||||
# google\_compute\_address
|
||||
|
||||
Creates a static IP address resource for Google Compute Engine. For more information see
|
||||
Creates a static IP address resource for Google Compute Engine. For more information see
|
||||
[the official documentation](https://cloud.google.com/compute/docs/instances-and-network) and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/addresses).
|
||||
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_address" "default" {
|
||||
name = "test-address"
|
||||
name = "test-address"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -27,14 +27,18 @@ The following arguments are supported:
|
|||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `region` - (Optional) The Region in which the created address should reside.
|
||||
If it is not provided, the provider region is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `address` - The IP address that was allocated.
|
||||
* `self_link` - The URI of the created resource.
|
||||
* `region` - The Region in which the created address does reside.
|
||||
|
|
|
@ -12,7 +12,7 @@ A Compute Engine Autoscaler automatically adds or removes virtual machines from
|
|||
a managed instance group based on increases or decreases in load. This allows
|
||||
your applications to gracefully handle increases in traffic and reduces cost
|
||||
when the need for resources is lower. You just define the autoscaling policy and
|
||||
the autoscaler performs automatic scaling based on the measured load. For more
|
||||
the autoscaler performs automatic scaling based on the measured load. For more
|
||||
information, see [the official
|
||||
documentation](https://cloud.google.com/compute/docs/autoscaler/) and
|
||||
[API](https://cloud.google.com/compute/docs/autoscaler/v1beta2/autoscalers)
|
||||
|
@ -20,54 +20,58 @@ documentation](https://cloud.google.com/compute/docs/autoscaler/) and
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance_template" "foobar" {
|
||||
name = "foobar"
|
||||
machine_type = "n1-standard-1"
|
||||
can_ip_forward = false
|
||||
tags = ["foo", "bar"]
|
||||
name = "foobar"
|
||||
machine_type = "n1-standard-1"
|
||||
can_ip_forward = false
|
||||
|
||||
disk {
|
||||
source_image = "debian-cloud/debian-7-wheezy-v20160301"
|
||||
}
|
||||
tags = ["foo", "bar"]
|
||||
|
||||
network_interface {
|
||||
network = "default"
|
||||
}
|
||||
disk {
|
||||
source_image = "debian-cloud/debian-7-wheezy-v20160301"
|
||||
}
|
||||
|
||||
metadata {
|
||||
foo = "bar"
|
||||
}
|
||||
network_interface {
|
||||
network = "default"
|
||||
}
|
||||
|
||||
service_account {
|
||||
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
|
||||
}
|
||||
metadata {
|
||||
foo = "bar"
|
||||
}
|
||||
|
||||
service_account {
|
||||
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_target_pool" "foobar" {
|
||||
name = "foobar"
|
||||
name = "foobar"
|
||||
}
|
||||
|
||||
resource "google_compute_instance_group_manager" "foobar" {
|
||||
name = "foobar"
|
||||
instance_template = "${google_compute_instance_template.foobar.self_link}"
|
||||
target_pools = ["${google_compute_target_pool.foobar.self_link}"]
|
||||
base_instance_name = "foobar"
|
||||
zone = "us-central1-f"
|
||||
name = "foobar"
|
||||
zone = "us-central1-f"
|
||||
|
||||
instance_template = "${google_compute_instance_template.foobar.self_link}"
|
||||
target_pools = ["${google_compute_target_pool.foobar.self_link}"]
|
||||
base_instance_name = "foobar"
|
||||
}
|
||||
|
||||
resource "google_compute_autoscaler" "foobar" {
|
||||
name = "foobar"
|
||||
zone = "us-central1-f"
|
||||
target = "${google_compute_instance_group_manager.foobar.self_link}"
|
||||
autoscaling_policy = {
|
||||
max_replicas = 5
|
||||
min_replicas = 1
|
||||
cooldown_period = 60
|
||||
cpu_utilization = {
|
||||
target = 0.5
|
||||
}
|
||||
name = "foobar"
|
||||
zone = "us-central1-f"
|
||||
target = "${google_compute_instance_group_manager.foobar.self_link}"
|
||||
|
||||
autoscaling_policy = {
|
||||
max_replicas = 5
|
||||
min_replicas = 1
|
||||
cooldown_period = 60
|
||||
|
||||
cpu_utilization {
|
||||
target = 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -75,39 +79,46 @@ resource "google_compute_autoscaler" "foobar" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `description` - (Optional) An optional textual description of the instance
|
||||
group manager.
|
||||
* `name` - (Required) The name of the autoscaler.
|
||||
|
||||
* `target` - (Required) The full URL to the instance group manager whose size we
|
||||
control.
|
||||
|
||||
* `autoscaling_policy.` - (Required) The parameters of the autoscaling
|
||||
algorithm. Structure is documented below.
|
||||
|
||||
* `zone` - (Required) The zone of the target.
|
||||
|
||||
* `autoscaling_policy.` - (Required) The parameters of the autoscaling
|
||||
algorithm. Structure is documented below.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) An optional textual description of the instance
|
||||
group manager.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
The `autoscaling_policy` block contains:
|
||||
|
||||
* `max_replicas` - (Required) The group will never be larger than this.
|
||||
|
||||
* `min_replicas` - (Required) The group will never be smaller than this.
|
||||
|
||||
* `cooldown_period` - (Optional) Period to wait between changes. This should be
|
||||
* `cooldown_period` - (Optional) Period to wait between changes. This should be
|
||||
at least double the time your instances take to start up.
|
||||
|
||||
* `cpu_utilization` - (Optional) A policy that scales when the cluster's average
|
||||
CPU is above or below a given threshold. Structure is documented below.
|
||||
CPU is above or below a given threshold. Structure is documented below.
|
||||
|
||||
* `metric` - (Optional) A policy that scales according to Google Cloud
|
||||
Monitoring metrics Structure is documented below.
|
||||
|
||||
* `load_balancing_utilization` - (Optional) A policy that scales when the load
|
||||
reaches a proportion of a limit defined in the HTTP load balancer. Structure
|
||||
reaches a proportion of a limit defined in the HTTP load balancer. Structure
|
||||
is documented below.
|
||||
|
||||
The `cpu_utilization` block contains:
|
||||
|
||||
* `target` - The floating point threshold where CPU utilization should be. E.g.
|
||||
* `target` - The floating point threshold where CPU utilization should be. E.g.
|
||||
for 50% one would specify 0.5.
|
||||
|
||||
The `metric` block contains (more documentation
|
||||
|
@ -118,18 +129,19 @@ The `metric` block contains (more documentation
|
|||
|
||||
* `type` - Either "cumulative", "delta", or "gauge".
|
||||
|
||||
* `target` - The desired metric value per instance. Must be a positive value.
|
||||
* `target` - The desired metric value per instance. Must be a positive value.
|
||||
|
||||
The `load_balancing_utilization` block contains:
|
||||
|
||||
* `target` - The floating point threshold where load balancing utilization
|
||||
should be. E.g. if the load balancer's `maxRatePerInstance` is 10 requests
|
||||
should be. E.g. if the load balancer's `maxRatePerInstance` is 10 requests
|
||||
per second (RPS) then setting this to 0.5 would cause the group to be scaled
|
||||
such that each instance receives 5 RPS.
|
||||
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URL of the created resource.
|
||||
|
|
|
@ -12,50 +12,49 @@ A Backend Service defines a group of virtual machines that will serve traffic fo
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_backend_service" "foobar" {
|
||||
name = "blablah"
|
||||
description = "Hello World 1234"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
name = "blablah"
|
||||
description = "Hello World 1234"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
|
||||
backend {
|
||||
group = "${google_compute_instance_group_manager.foo.instance_group}"
|
||||
}
|
||||
backend {
|
||||
group = "${google_compute_instance_group_manager.foo.instance_group}"
|
||||
}
|
||||
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_instance_group_manager" "foo" {
|
||||
name = "terraform-test"
|
||||
instance_template = "${google_compute_instance_template.foobar.self_link}"
|
||||
base_instance_name = "foobar"
|
||||
zone = "us-central1-f"
|
||||
target_size = 1
|
||||
name = "terraform-test"
|
||||
instance_template = "${google_compute_instance_template.foobar.self_link}"
|
||||
base_instance_name = "foobar"
|
||||
zone = "us-central1-f"
|
||||
target_size = 1
|
||||
}
|
||||
|
||||
resource "google_compute_instance_template" "foobar" {
|
||||
name = "terraform-test"
|
||||
machine_type = "n1-standard-1"
|
||||
name = "terraform-test"
|
||||
machine_type = "n1-standard-1"
|
||||
|
||||
network_interface {
|
||||
network = "default"
|
||||
}
|
||||
network_interface {
|
||||
network = "default"
|
||||
}
|
||||
|
||||
disk {
|
||||
source_image = "debian-7-wheezy-v20160301"
|
||||
auto_delete = true
|
||||
boot = true
|
||||
}
|
||||
disk {
|
||||
source_image = "debian-7-wheezy-v20160301"
|
||||
auto_delete = true
|
||||
boot = true
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_http_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -64,31 +63,64 @@ resource "google_compute_http_health_check" "default" {
|
|||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) The name of the backend service.
|
||||
|
||||
* `health_checks` - (Required) Specifies a list of HTTP health check objects
|
||||
for checking the health of the backend service.
|
||||
|
||||
- - -
|
||||
|
||||
* `backend` - (Optional) The list of backends that serve this BackendService.
|
||||
See *Backend* below.
|
||||
|
||||
* `description` - (Optional) The textual description for the backend service.
|
||||
* `backend` - (Optional) The list of backends that serve this BackendService. See *Backend* below.
|
||||
* `region` - (Optional) The region the service sits in. If not specified, the project region is used.
|
||||
* `port_name` - (Optional) The name of a service that has been added to
|
||||
an instance group in this backend. See [related docs](https://cloud.google.com/compute/docs/instance-groups/#specifying_service_endpoints)
|
||||
for details. Defaults to http.
|
||||
* `protocol` - (Optional) The protocol for incoming requests. Defaults to `HTTP`.
|
||||
|
||||
* `port_name` - (Optional) The name of a service that has been added to an
|
||||
instance group in this backend. See [related docs](https://cloud.google.com/compute/docs/instance-groups/#specifying_service_endpoints) for details. Defaults to http.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `protocol` - (Optional) The protocol for incoming requests. Defaults to
|
||||
`HTTP`.
|
||||
|
||||
* `region` - (Optional) The Region in which the created address should reside.
|
||||
If it is not provided, the provider region is used.
|
||||
|
||||
* `timeout_sec` - (Optional) The number of secs to wait for a backend to respond
|
||||
to a request before considering the request failed. Defaults to `30`.
|
||||
to a request before considering the request failed. Defaults to `30`.
|
||||
|
||||
|
||||
**Backend** supports the following attributes:
|
||||
|
||||
* `group` - (Required) The name or URI of a Compute Engine instance group (`google_compute_instance_group_manager.xyz.instance_group`) that can receive traffic.
|
||||
* `balancing_mode` - (Optional) Defines the strategy for balancing load. Defaults to `UTILIZATION`
|
||||
* `capacity_scaler` - (Optional) A float in the range [0, 1.0] that scales the maximum parameters for the group (e.g., max rate). A value of 0.0 will cause no requests to be sent to the group (i.e., it adds the group in a drained state). The default is 1.0.
|
||||
* `group` - (Required) The name or URI of a Compute Engine instance group
|
||||
(`google_compute_instance_group_manager.xyz.instance_group`) that can
|
||||
receive traffic.
|
||||
|
||||
* `balancing_mode` - (Optional) Defines the strategy for balancing load.
|
||||
Defaults to `UTILIZATION`
|
||||
|
||||
* `capacity_scaler` - (Optional) A float in the range [0, 1.0] that scales the
|
||||
maximum parameters for the group (e.g., max rate). A value of 0.0 will cause
|
||||
no requests to be sent to the group (i.e., it adds the group in a drained
|
||||
state). The default is 1.0.
|
||||
|
||||
* `description` - (Optional) Textual description for the backend.
|
||||
* `max_rate` - (Optional) Maximum requests per second (RPS) that the group can handle.
|
||||
* `max_rate_per_instance` - (Optional) The maximum per-instance requests per second (RPS).
|
||||
* `max_utilization` - (Optional) The target CPU utilization for the group as a float in the range [0.0, 1.0]. This flag can only be provided when the balancing mode is `UTILIZATION`. Defaults to `0.8`.
|
||||
|
||||
* `max_rate` - (Optional) Maximum requests per second (RPS) that the group can
|
||||
handle.
|
||||
|
||||
* `max_rate_per_instance` - (Optional) The maximum per-instance requests per
|
||||
second (RPS).
|
||||
|
||||
* `max_utilization` - (Optional) The target CPU utilization for the group as a
|
||||
float in the range [0.0, 1.0]. This flag can only be provided when the
|
||||
balancing mode is `UTILIZATION`. Defaults to `0.8`.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `fingerprint` - The fingerprint of the backend service.
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -12,12 +12,12 @@ Creates a new persistent disk within GCE, based on another disk.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_disk" "default" {
|
||||
name = "test-disk"
|
||||
type = "pd-ssd"
|
||||
zone = "us-central1-a"
|
||||
image = "debian7-wheezy"
|
||||
name = "test-disk"
|
||||
type = "pd-ssd"
|
||||
zone = "us-central1-a"
|
||||
image = "debian7-wheezy"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -30,22 +30,25 @@ The following arguments are supported:
|
|||
|
||||
* `zone` - (Required) The zone where this disk will be available.
|
||||
|
||||
* `image` - (Optional) The image from which to initialize this disk. Either the full URL, a
|
||||
contraction of the form "project/name", or just a name (in which case the current project is
|
||||
used).
|
||||
- - -
|
||||
|
||||
* `snapshot` - (Optional) Name of snapshot from which to initialize this disk;
|
||||
* `image` - (Optional) The image from which to initialize this disk. Either the
|
||||
full URL, a contraction of the form "project/name", or just a name (in which
|
||||
case the current project is used).
|
||||
|
||||
* `size` - (Optional) The size of the image in gigabytes. If not specified,
|
||||
it will inherit the size of its base image.
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `size` - (Optional) The size of the image in gigabytes. If not specified, it
|
||||
will inherit the size of its base image.
|
||||
|
||||
* `snapshot` - (Optional) Name of snapshot from which to initialize this disk.
|
||||
|
||||
* `type` - (Optional) The GCE disk type.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `zone` - The zone where the resource is located.
|
||||
* `image` - The name of the image the disk is based off of.
|
||||
* `size` - The size of the disk in gigabytes.
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -12,21 +12,21 @@ Manages a firewall resource within GCE.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_firewall" "default" {
|
||||
name = "test"
|
||||
network = "${google_compute_network.other.name}"
|
||||
name = "test"
|
||||
network = "${google_compute_network.other.name}"
|
||||
|
||||
allow {
|
||||
protocol = "icmp"
|
||||
}
|
||||
allow {
|
||||
protocol = "icmp"
|
||||
}
|
||||
|
||||
allow {
|
||||
protocol = "tcp"
|
||||
ports = ["80", "8080", "1000-2000"]
|
||||
}
|
||||
allow {
|
||||
protocol = "tcp"
|
||||
ports = ["80", "8080", "1000-2000"]
|
||||
}
|
||||
|
||||
source_tags = ["web"]
|
||||
source_tags = ["web"]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -37,19 +37,24 @@ The following arguments are supported:
|
|||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
* `network` - (Required) The name of the network to attach this firewall to.
|
||||
|
||||
* `allow` - (Required) Can be specified multiple times for each allow
|
||||
rule. Each allow block supports fields documented below.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `source_ranges` - (Optional) A list of source CIDR ranges that this
|
||||
firewall applies to.
|
||||
|
||||
* `source_tags` - (Optional) A list of source tags that this firewall applies to.
|
||||
* `source_tags` - (Optional) A list of source tags for this firewall.
|
||||
|
||||
* `target_tags` - (Optional) A list of target tags that this firewall applies to.
|
||||
* `target_tags` - (Optional) A list of target tags for this firewall.
|
||||
|
||||
The `allow` block supports:
|
||||
|
||||
|
@ -60,9 +65,7 @@ The `allow` block supports:
|
|||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `network` - The network that this resource is attached to.
|
||||
* `source_ranges` - The CIDR block ranges this firewall applies to.
|
||||
* `source_tags` - The tags that this firewall applies to.
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -8,18 +8,18 @@ description: |-
|
|||
|
||||
# google\_compute\_forwarding\_rule
|
||||
|
||||
Manages a Forwarding Rule within GCE. This binds an ip and port range to a target pool. For more
|
||||
Manages a Forwarding Rule within GCE. This binds an ip and port range to a target pool. For more
|
||||
information see [the official
|
||||
documentation](https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules) and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/forwardingRules).
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_forwarding_rule" "default" {
|
||||
name = "test"
|
||||
target = "${google_compute_target_pool.default.self_link}"
|
||||
port_range = "80"
|
||||
name = "test"
|
||||
target = "${google_compute_target_pool.default.self_link}"
|
||||
port_range = "80"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -27,27 +27,33 @@ resource "google_compute_forwarding_rule" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
* `target` - (Required) URL of target pool.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
* `ip_address` - (Optional) The static IP. (if not set, an ephemeral IP is
|
||||
used).
|
||||
used).
|
||||
|
||||
* `ip_protocol` - (Optional) The IP protocol to route, one of "TCP" "UDP" "AH" "ESP" or "SCTP". (default "TCP").
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
* `ip_protocol` - (Optional) The IP protocol to route, one of "TCP" "UDP" "AH"
|
||||
"ESP" or "SCTP". (default "TCP").
|
||||
|
||||
* `port_range` - (Optional) A range e.g. "1024-2048" or a single port "1024"
|
||||
(defaults to all ports!).
|
||||
(defaults to all ports!).
|
||||
|
||||
* `target` - URL of target pool.
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `region` - (Optional) The Region in which the created address should reside.
|
||||
If it is not provided, the provider region is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `self_link` - The URL of the created resource.
|
||||
|
||||
* `ip_address` - The IP address that was chosen (or specified).
|
||||
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -15,9 +15,9 @@ Creates a static IP address resource global to a Google Compute Engine project.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_global_address" "default" {
|
||||
name = "test-address"
|
||||
name = "test-address"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -28,10 +28,16 @@ The following arguments are supported:
|
|||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `address` - The assigned address.
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `address` - The IP address that was allocated.
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -1,68 +1,67 @@
|
|||
---
|
||||
layout: "google"
|
||||
page_title: "Google: google_compute_global_forwarding_rule"
|
||||
sidebar_current: "docs-google-compute-global-forwarding_rule"
|
||||
sidebar_current: "docs-google-compute-global-forwarding-rule"
|
||||
description: |-
|
||||
Manages a Target Pool within GCE.
|
||||
---
|
||||
|
||||
# google\_compute\_global\_forwarding\_rule
|
||||
|
||||
Manages a Global Forwarding Rule within GCE. This binds an ip and port to a target HTTP(s) proxy. For more
|
||||
Manages a Global Forwarding Rule within GCE. This binds an ip and port to a target HTTP(s) proxy. For more
|
||||
information see [the official
|
||||
documentation](https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules) and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules).
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_global_forwarding_rule" "default" {
|
||||
name = "test"
|
||||
target = "${google_compute_target_http_proxy.default.self_link}"
|
||||
port_range = "80"
|
||||
name = "test"
|
||||
target = "${google_compute_target_http_proxy.default.self_link}"
|
||||
port_range = "80"
|
||||
}
|
||||
|
||||
resource "google_compute_target_http_proxy" "default" {
|
||||
name = "test-proxy"
|
||||
description = "a description"
|
||||
url_map = "${google_compute_url_map.default.self_link}"
|
||||
name = "test-proxy"
|
||||
description = "a description"
|
||||
url_map = "${google_compute_url_map.default.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_url_map" "default" {
|
||||
name = "url-map"
|
||||
description = "a description"
|
||||
name = "url-map"
|
||||
description = "a description"
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
name = "allpaths"
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
name = "allpaths"
|
||||
path_rule {
|
||||
paths = ["/*"]
|
||||
service = "${google_compute_backend_service.default.self_link}"
|
||||
}
|
||||
path_rule {
|
||||
paths = ["/*"]
|
||||
service = "${google_compute_backend_service.default.self_link}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_backend_service" "default" {
|
||||
name = "default-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
name = "default-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_http_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -70,24 +69,30 @@ resource "google_compute_http_health_check" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
* `ip_address` - (Optional) The static IP. (if not set, an ephemeral IP is used).
|
||||
|
||||
* `ip_protocol` - (Optional) The IP protocol to route, one of "TCP" "UDP" "AH" "ESP" or "SCTP". (default "TCP").
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
* `port_range` - (Optional) A range e.g. "1024-2048" or a single port "1024"
|
||||
(defaults to all ports!).
|
||||
* `target` - (Required) URL of target HTTP or HTTPS proxy.
|
||||
|
||||
* `target` - URL of target HTTP or HTTPS proxy.
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
* `ip_address` - (Optional) The static IP. (if not set, an ephemeral IP is
|
||||
used).
|
||||
|
||||
* `ip_protocol` - (Optional) The IP protocol to route, one of "TCP" "UDP" "AH"
|
||||
"ESP" or "SCTP". (default "TCP").
|
||||
|
||||
* `port_range` - (Optional) A range e.g. "1024-2048" or a single port "1024"
|
||||
(defaults to all ports!).
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URL of the created resource.
|
||||
|
||||
* `ip_address` - The IP address that was chosen (or specified).
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -8,21 +8,22 @@ description: |-
|
|||
|
||||
# google\_compute\_http\_health\_check
|
||||
|
||||
Manages an HTTP health check within GCE. This is used to monitor instances
|
||||
behind load balancers. Timeouts or HTTP errors cause the instance to be
|
||||
removed from the pool. For more information, see [the official
|
||||
Manages an HTTP health check within GCE. This is used to monitor instances
|
||||
behind load balancers. Timeouts or HTTP errors cause the instance to be
|
||||
removed from the pool. For more information, see [the official
|
||||
documentation](https://cloud.google.com/compute/docs/load-balancing/health-checks)
|
||||
and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks).
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_http_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/health_check"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/health_check"
|
||||
|
||||
timeout_sec = 1
|
||||
check_interval_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -30,7 +31,13 @@ resource "google_compute_http_health_check" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `check_interval_sec` - (Optional) How often to poll each instance (default 5).
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `check_interval_sec` - (Optional) The number of seconds between each poll of
|
||||
the instance instance (default 5).
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
|
@ -38,20 +45,22 @@ The following arguments are supported:
|
|||
|
||||
* `host` - (Optional) HTTP host header field (default instance's public ip).
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `port` - (Optional) TCP port to connect to (default 80).
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `request_path` - (Optional) URL path to query (default /).
|
||||
|
||||
* `timeout_sec` - (Optional) How long before declaring failure (default 5).
|
||||
* `timeout_sec` - (Optional) The number of seconds to wait before declaring
|
||||
failure (default 5).
|
||||
|
||||
* `unhealthy_threshold` - (Optional) Consecutive failures required (default 2).
|
||||
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URL of the created resource.
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -8,21 +8,22 @@ description: |-
|
|||
|
||||
# google\_compute\_https\_health\_check
|
||||
|
||||
Manages an HTTPS health check within GCE. This is used to monitor instances
|
||||
behind load balancers. Timeouts or HTTPS errors cause the instance to be
|
||||
removed from the pool. For more information, see [the official
|
||||
Manages an HTTPS health check within GCE. This is used to monitor instances
|
||||
behind load balancers. Timeouts or HTTPS errors cause the instance to be
|
||||
removed from the pool. For more information, see [the official
|
||||
documentation](https://cloud.google.com/compute/docs/load-balancing/health-checks)
|
||||
and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/httpsHealthChecks).
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_https_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/health_check"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/health_check"
|
||||
|
||||
timeout_sec = 1
|
||||
check_interval_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -30,6 +31,11 @@ resource "google_compute_https_health_check" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `check_interval_sec` - (Optional) How often to poll each instance (default 5).
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
@ -38,11 +44,11 @@ The following arguments are supported:
|
|||
|
||||
* `host` - (Optional) HTTPS host header field (default instance's public ip).
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `port` - (Optional) TCP port to connect to (default 443).
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `request_path` - (Optional) URL path to query (default /).
|
||||
|
||||
* `timeout_sec` - (Optional) How long before declaring failure (default 5).
|
||||
|
|
|
@ -8,7 +8,7 @@ description: |-
|
|||
|
||||
# google\_compute\_instance
|
||||
|
||||
Manages a VM instance resource within GCE. For more information see
|
||||
Manages a VM instance resource within GCE. For more information see
|
||||
[the official documentation](https://cloud.google.com/compute/docs/instances)
|
||||
and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/instances).
|
||||
|
@ -16,39 +16,40 @@ and
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance" "default" {
|
||||
name = "test"
|
||||
machine_type = "n1-standard-1"
|
||||
zone = "us-central1-a"
|
||||
tags = ["foo", "bar"]
|
||||
name = "test"
|
||||
machine_type = "n1-standard-1"
|
||||
zone = "us-central1-a"
|
||||
|
||||
disk {
|
||||
image = "debian-7-wheezy-v20160301"
|
||||
}
|
||||
tags = ["foo", "bar"]
|
||||
|
||||
// Local SSD disk
|
||||
disk {
|
||||
type = "local-ssd"
|
||||
scratch = true
|
||||
}
|
||||
disk {
|
||||
image = "debian-7-wheezy-v20160301"
|
||||
}
|
||||
|
||||
network_interface {
|
||||
network = "default"
|
||||
access_config {
|
||||
// Ephemeral IP
|
||||
}
|
||||
}
|
||||
// Local SSD disk
|
||||
disk {
|
||||
type = "local-ssd"
|
||||
scratch = true
|
||||
}
|
||||
|
||||
metadata {
|
||||
foo = "bar"
|
||||
}
|
||||
network_interface {
|
||||
network = "default"
|
||||
access_config {
|
||||
// Ephemeral IP
|
||||
}
|
||||
}
|
||||
|
||||
metadata_startup_script = "echo hi > /test.txt"
|
||||
metadata {
|
||||
foo = "bar"
|
||||
}
|
||||
|
||||
service_account {
|
||||
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
|
||||
}
|
||||
metadata_startup_script = "echo hi > /test.txt"
|
||||
|
||||
service_account {
|
||||
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -56,39 +57,48 @@ resource "google_compute_instance" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `disk` - (Required) Disks to attach to the instance. This can be specified
|
||||
multiple times for multiple disks. Structure is documented below.
|
||||
|
||||
* `machine_type` - (Required) The machine type to create.To create a custom
|
||||
machine type, value should be set as specified
|
||||
[here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType)
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `description` - (Optional) A brief description of this resource.
|
||||
|
||||
* `machine_type` - (Required) The machine type to create.To create a custom machine type, value should be
|
||||
set as specified [here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType)
|
||||
|
||||
* `zone` - (Required) The zone that the machine should be created in.
|
||||
|
||||
* `disk` - (Required) Disks to attach to the instance. This can be specified
|
||||
multiple times for multiple disks. Structure is documented below.
|
||||
- - -
|
||||
|
||||
* `can_ip_forward` - (Optional) Whether to allow sending and receiving of
|
||||
packets with non-matching source or destination IPs.
|
||||
This defaults to false.
|
||||
|
||||
* `description` - (Optional) A brief description of this resource.
|
||||
|
||||
* `metadata` - (Optional) Metadata key/value pairs to make available from
|
||||
within the instance.
|
||||
|
||||
* `metadata_startup_script` - (Optional) An alternative to using the
|
||||
startup-script metadata key, except this one forces the instance to be
|
||||
recreated (thus re-running the script) if it is changed. This replaces the
|
||||
startup-script metadata key on the created instance and thus the two mechanisms
|
||||
are not allowed to be used simultaneously.
|
||||
startup-script metadata key, except this one forces the instance to be
|
||||
recreated (thus re-running the script) if it is changed. This replaces the
|
||||
startup-script metadata key on the created instance and thus the two
|
||||
mechanisms are not allowed to be used simultaneously.
|
||||
|
||||
* `network_interface` - (Required) Networks to attach to the instance. This can be
|
||||
specified multiple times for multiple networks, but GCE is currently limited
|
||||
to just 1. Structure is documented below.
|
||||
* `network_interface` - (Required) Networks to attach to the instance. This can
|
||||
be specified multiple times for multiple networks, but GCE is currently
|
||||
limited to just 1. Structure is documented below.
|
||||
|
||||
* `network` - (DEPRECATED, Required) Networks to attach to the instance. This can be
|
||||
specified multiple times for multiple networks. Structure is documented
|
||||
below.
|
||||
* `network` - (DEPRECATED, Required) Networks to attach to the instance. This
|
||||
can be specified multiple times for multiple networks. Structure is
|
||||
documented below.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `scheduling` - (Optional) The scheduling strategy to use. More details about
|
||||
this configuration option are detailed below.
|
||||
|
||||
* `service_account` - (Optional) Service account to attach to the instance.
|
||||
|
||||
|
@ -98,14 +108,14 @@ The `disk` block supports: (Note that either disk or image is required, unless
|
|||
the type is "local-ssd", in which case scratch must be true).
|
||||
|
||||
* `disk` - The name of the existing disk (such as those managed by
|
||||
`google_compute_disk`) to attach.
|
||||
`google_compute_disk`) to attach.
|
||||
|
||||
* `image` - The image from which to initialize this
|
||||
disk. Either the full URL, a contraction of the form "project/name", or just
|
||||
a name (in which case the current project is used).
|
||||
disk. Either the full URL, a contraction of the form "project/name", or
|
||||
just a name (in which case the current project is used).
|
||||
|
||||
* `auto_delete` - (Optional) Whether or not the disk should be auto-deleted.
|
||||
This defaults to true. Leave true for local SSDs.
|
||||
This defaults to true. Leave true for local SSDs.
|
||||
|
||||
* `type` - (Optional) The GCE disk type, e.g. pd-standard, pd-ssd, or local-ssd.
|
||||
|
||||
|
@ -113,7 +123,7 @@ the type is "local-ssd", in which case scratch must be true).
|
|||
persistent disk (required for local-ssd).
|
||||
|
||||
* `size` - (Optional) The size of the image in gigabytes. If not specified, it
|
||||
will inherit the size of its base image. Do not specify for local SSDs as
|
||||
will inherit the size of its base image. Do not specify for local SSDs as
|
||||
their size is fixed.
|
||||
|
||||
* `device_name` - (Optional) Name with which attached disk will be accessible
|
||||
|
@ -121,34 +131,36 @@ the type is "local-ssd", in which case scratch must be true).
|
|||
|
||||
The `network_interface` block supports:
|
||||
|
||||
* `network` - (Optional) The name of the network to attach this interface to. Either
|
||||
`network` or `subnetwork` must be provided.
|
||||
* `network` - (Optional) The name of the network to attach this interface to.
|
||||
Either `network` or `subnetwork` must be provided.
|
||||
|
||||
* `subnetwork` - (Optional) the name of the subnetwork to attach this interface to. The subnetwork
|
||||
must exist in the same region this instance will be created in. Either `network`
|
||||
or `subnetwork` must be provided.
|
||||
* `subnetwork` - (Optional) the name of the subnetwork to attach this interface
|
||||
to. The subnetwork must exist in the same region this instance will be
|
||||
created in. Either `network` or `subnetwork` must be provided.
|
||||
|
||||
* `access_config` - (Optional) Access configurations, i.e. IPs via which this instance can be
|
||||
accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet
|
||||
(this means that ssh provisioners will not work unless you are running Terraform can send traffic to
|
||||
the instance's network (e.g. via tunnel or because it is running on another cloud instance on that
|
||||
network). This block can be repeated multiple times. Structure documented below.
|
||||
* `access_config` - (Optional) Access configurations, i.e. IPs via which this
|
||||
instance can be accessed via the Internet. Omit to ensure that the instance
|
||||
is not accessible from the Internet (this means that ssh provisioners will
|
||||
not work unless you are running Terraform can send traffic tothe instance's
|
||||
network (e.g. via tunnel or because it is running on another cloud instance
|
||||
on that network). This block can be repeated multiple times. Structure
|
||||
documented below.
|
||||
|
||||
The `access_config` block supports:
|
||||
|
||||
* `nat_ip` - (Optional) The IP address that will be 1:1 mapped to the instance's network ip. If not
|
||||
given, one will be generated.
|
||||
* `nat_ip` - (Optional) The IP address that will be 1:1 mapped to the instance's
|
||||
network ip. If not given, one will be generated.
|
||||
|
||||
* `assigned_nat_ip` - (Optional) The IP address that is assigned to the
|
||||
instance. If `nat_ip` is filled, it will appear here. If `nat_ip` is left
|
||||
blank, the ephemeral assigned IP will appear here.
|
||||
instance. If `nat_ip` is filled, it will appear here. If `nat_ip` is left
|
||||
blank, the ephemeral assigned IP will appear here.
|
||||
|
||||
(DEPRECATED) The `network` block supports:
|
||||
|
||||
* `source` - (Required) The name of the network to attach this interface to.
|
||||
|
||||
* `address` - (Optional) The IP address of a reserved IP address to assign
|
||||
to this interface.
|
||||
to this interface.
|
||||
|
||||
The `service_account` block supports:
|
||||
|
||||
|
@ -159,8 +171,8 @@ The `scheduling` block supports:
|
|||
|
||||
* `preemptible` - (Optional) Is the instance preemptible.
|
||||
|
||||
* `on_host_maintenance` - (Optional) Describes maintenance behavior for
|
||||
the instance. Can be MIGRATE or TERMINATE, for more info, read
|
||||
* `on_host_maintenance` - (Optional) Describes maintenance behavior for the
|
||||
instance. Can be MIGRATE or TERMINATE, for more info, read
|
||||
[here](https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options)
|
||||
|
||||
* `automatic_restart` - (Optional) Specifies if the instance should be
|
||||
|
@ -168,8 +180,11 @@ The `scheduling` block supports:
|
|||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `machine_type` - The type of machine.
|
||||
* `zone` - The zone the machine lives in.
|
||||
* `metadata_fingerprint` - The unique fingerprint of the metadata.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
||||
* `tags_fingerprint` - The unique fingerprint of the tags.
|
||||
|
|
|
@ -10,38 +10,42 @@ description: |-
|
|||
|
||||
The Google Compute Engine Instance Group API creates and manages pools
|
||||
of homogeneous Compute Engine virtual machine instances from a common instance
|
||||
template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/unmanaged-groups)
|
||||
template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/unmanaged-groups)
|
||||
and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroups)
|
||||
|
||||
## Example Usage
|
||||
|
||||
### Empty instance group
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance_group" "test" {
|
||||
name = "terraform-test"
|
||||
description = "Terraform test instance group"
|
||||
zone = "us-central1-a"
|
||||
name = "terraform-test"
|
||||
description = "Terraform test instance group"
|
||||
zone = "us-central1-a"
|
||||
}
|
||||
```
|
||||
|
||||
### With instances and named ports
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance_group" "webservers" {
|
||||
name = "terraform-webservers"
|
||||
description = "Terraform test instance group"
|
||||
instances = [
|
||||
"${google_compute_instance.test.self_link}",
|
||||
"${google_compute_instance.test2.self_link}"
|
||||
]
|
||||
named_port {
|
||||
name = "http"
|
||||
port = "8080"
|
||||
}
|
||||
named_port {
|
||||
name = "https"
|
||||
port = "8443"
|
||||
}
|
||||
zone = "us-central1-a"
|
||||
name = "terraform-webservers"
|
||||
description = "Terraform test instance group"
|
||||
|
||||
instances = [
|
||||
"${google_compute_instance.test.self_link}",
|
||||
"${google_compute_instance.test2.self_link}"
|
||||
]
|
||||
|
||||
named_port {
|
||||
name = "http"
|
||||
port = "8080"
|
||||
}
|
||||
|
||||
named_port {
|
||||
name = "https"
|
||||
port = "8443"
|
||||
}
|
||||
|
||||
zone = "us-central1-a"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -50,32 +54,40 @@ resource "google_compute_instance_group" "webservers" {
|
|||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) The name of the instance group. Must be 1-63
|
||||
characters long and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
|
||||
Supported characters include lowercase letters, numbers, and hyphens.
|
||||
|
||||
* `description` - (Optional) An optional textual description of the instance
|
||||
group.
|
||||
|
||||
* `instances` - (Optional) List of instances in the group. They should be given as
|
||||
self_link URLs. When adding instances they must all be in the same network and
|
||||
zone as the instance group.
|
||||
|
||||
* `named_port` - (Optional) Named ports are key:value pairs that represent a
|
||||
service name and the port number that the service runs on. The key:value pairs
|
||||
are simple metadata that the Load Balancing service can use. This can specified
|
||||
multiple times
|
||||
characters long and comply with
|
||||
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters
|
||||
include lowercase letters, numbers, and hyphens.
|
||||
|
||||
* `zone` - (Required) The zone that this instance group should be created in.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) An optional textual description of the instance
|
||||
group.
|
||||
|
||||
* `instances` - (Optional) List of instances in the group. They should be given
|
||||
as self_link URLs. When adding instances they must all be in the same
|
||||
network and zone as the instance group.
|
||||
|
||||
* `named_port` - (Optional) The named port configuration. See the section below
|
||||
for details on configuration.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
The `named_port` block supports:
|
||||
|
||||
* `name` - The name which the port will be mapped to.
|
||||
* `port` - The port number to map the name to.
|
||||
* `name` - (Required) The name which the port will be mapped to.
|
||||
|
||||
* `port` - (Required) The port number to map the name to.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `network` - The network the instance group is in.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
||||
* `size` - The number of instances in the group.
|
||||
* `self_link` - The URL of the created resource.
|
||||
|
|
|
@ -10,27 +10,28 @@ description: |-
|
|||
|
||||
The Google Compute Engine Instance Group Manager API creates and manages pools
|
||||
of homogeneous Compute Engine virtual machine instances from a common instance
|
||||
template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/manager)
|
||||
template. For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/manager)
|
||||
and [API](https://cloud.google.com/compute/docs/instance-groups/manager/v1beta2/instanceGroupManagers)
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance_group_manager" "foobar" {
|
||||
description = "Terraform test instance group manager"
|
||||
name = "terraform-test"
|
||||
instance_template = "${google_compute_instance_template.foobar.self_link}"
|
||||
update_strategy= "NONE"
|
||||
target_pools = ["${google_compute_target_pool.foobar.self_link}"]
|
||||
base_instance_name = "foobar"
|
||||
zone = "us-central1-a"
|
||||
target_size = 2
|
||||
name = "terraform-test"
|
||||
description = "Terraform test instance group manager"
|
||||
|
||||
named_port {
|
||||
name = "customHTTP"
|
||||
port = 8888
|
||||
}
|
||||
base_instance_name = "foobar"
|
||||
instance_template = "${google_compute_instance_template.foobar.self_link}"
|
||||
update_strategy = "NONE"
|
||||
zone = "us-central1-a"
|
||||
|
||||
target_pools = ["${google_compute_target_pool.foobar.self_link}"]
|
||||
target_size = 2
|
||||
|
||||
named_port {
|
||||
name = "customHTTP"
|
||||
port = 8888
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -39,35 +40,47 @@ resource "google_compute_instance_group_manager" "foobar" {
|
|||
The following arguments are supported:
|
||||
|
||||
* `base_instance_name` - (Required) The base instance name to use for
|
||||
instances in this group. The value must be a valid [RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name.
|
||||
Supported characters are lowercase letters, numbers, and hyphens (-). Instances
|
||||
are named by appending a hyphen and a random four-character string to the base
|
||||
instance name.
|
||||
|
||||
* `description` - (Optional) An optional textual description of the instance
|
||||
group manager.
|
||||
instances in this group. The value must be a valid
|
||||
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt) name. Supported characters
|
||||
are lowercase letters, numbers, and hyphens (-). Instances are named by
|
||||
appending a hyphen and a random four-character string to the base instance
|
||||
name.
|
||||
|
||||
* `instance_template` - (Required) The full URL to an instance template from
|
||||
which all new instances will be created.
|
||||
|
||||
* `update_strategy` - (Optional, Default `"RESTART"`) If the `instance_template` resource is
|
||||
modified, a value of `"NONE"` will prevent any of the managed instances from
|
||||
being restarted by Terraform. A value of `"RESTART"` will restart all of the
|
||||
instances at once. In the future, as the GCE API matures we will support
|
||||
`"ROLLING_UPDATE"` as well.
|
||||
which all new instances will be created.
|
||||
|
||||
* `name` - (Required) The name of the instance group manager. Must be 1-63
|
||||
characters long and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
|
||||
Supported characters include lowercase letters, numbers, and hyphens.
|
||||
characters long and comply with
|
||||
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Supported characters
|
||||
include lowercase letters, numbers, and hyphens.
|
||||
|
||||
* `target_size` - (Optional) If not given at creation time, this defaults to 1. Do not specify this
|
||||
if you are managing the group with an autoscaler, as this will cause fighting.
|
||||
* `zone` - (Required) The zone that instances in this group should be created
|
||||
in.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) An optional textual description of the instance
|
||||
group manager.
|
||||
|
||||
* `named_port` - (Optional) The named port configuration. See the section below
|
||||
for details on configuration.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `update_strategy` - (Optional, Default `"RESTART"`) If the `instance_template`
|
||||
resource is modified, a value of `"NONE"` will prevent any of the managed
|
||||
instances from being restarted by Terraform. A value of `"RESTART"` will
|
||||
restart all of the instances at once. In the future, as the GCE API matures
|
||||
we will support `"ROLLING_UPDATE"` as well.
|
||||
|
||||
* `target_size` - (Optional) If not given at creation time, this defaults to 1.
|
||||
Do not specify this if you are managing the group with an autoscaler, as
|
||||
this will cause fighting.
|
||||
|
||||
* `target_pools` - (Optional) The full URL of all target pools to which new
|
||||
instances in the group are added. Updating the target pools attribute does not
|
||||
affect existing instances.
|
||||
|
||||
* `zone` - (Required) The zone that instances in this group should be created in.
|
||||
instances in the group are added. Updating the target pools attribute does
|
||||
not affect existing instances.
|
||||
|
||||
The `named_port` block supports: (Include a `named_port` block for each named-port required).
|
||||
|
||||
|
@ -77,7 +90,10 @@ The `named_port` block supports: (Include a `named_port` block for each named-po
|
|||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `fingerprint` - The fingerprint of the instance group manager.
|
||||
|
||||
* `instance_group` - The full URL of the instance group created by the manager.
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ description: |-
|
|||
|
||||
# google\_compute\_instance\_template
|
||||
|
||||
Manages a VM instance template resource within GCE. For more information see
|
||||
Manages a VM instance template resource within GCE. For more information see
|
||||
[the official documentation](https://cloud.google.com/compute/docs/instance-templates)
|
||||
and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/instanceTemplates).
|
||||
|
@ -17,42 +17,44 @@ and
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance_template" "foobar" {
|
||||
name = "terraform-test"
|
||||
description = "template description"
|
||||
instance_description = "description assigned to instances"
|
||||
machine_type = "n1-standard-1"
|
||||
can_ip_forward = false
|
||||
automatic_restart = true
|
||||
on_host_maintenance = "MIGRATE"
|
||||
tags = ["foo", "bar"]
|
||||
name = "terraform-test"
|
||||
description = "template description"
|
||||
|
||||
# Create a new boot disk from an image
|
||||
disk {
|
||||
source_image = "debian-7-wheezy-v20160301"
|
||||
auto_delete = true
|
||||
boot = true
|
||||
}
|
||||
tags = ["foo", "bar"]
|
||||
|
||||
# Use an existing disk resource
|
||||
disk {
|
||||
source = "foo_existing_disk"
|
||||
auto_delete = false
|
||||
boot = false
|
||||
}
|
||||
instance_description = "description assigned to instances"
|
||||
machine_type = "n1-standard-1"
|
||||
can_ip_forward = false
|
||||
automatic_restart = true
|
||||
on_host_maintenance = "MIGRATE"
|
||||
|
||||
network_interface {
|
||||
network = "default"
|
||||
}
|
||||
// Create a new boot disk from an image
|
||||
disk {
|
||||
source_image = "debian-7-wheezy-v20160301"
|
||||
auto_delete = true
|
||||
boot = true
|
||||
}
|
||||
|
||||
metadata {
|
||||
foo = "bar"
|
||||
}
|
||||
// Use an existing disk resource
|
||||
disk {
|
||||
source = "foo_existing_disk"
|
||||
auto_delete = false
|
||||
boot = false
|
||||
}
|
||||
|
||||
service_account {
|
||||
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
|
||||
}
|
||||
network_interface {
|
||||
network = "default"
|
||||
}
|
||||
|
||||
metadata {
|
||||
foo = "bar"
|
||||
}
|
||||
|
||||
service_account {
|
||||
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -62,128 +64,130 @@ Note that changing any field for this resource forces a new resource to be creat
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
|
||||
* `description` - (Optional) A brief description of this resource.
|
||||
|
||||
* `can_ip_forward` - (Optional) Whether to allow sending and receiving of
|
||||
packets with non-matching source or destination IPs.
|
||||
This defaults to false.
|
||||
|
||||
* `instance_description` - (Optional) A brief description to use for instances
|
||||
created from this template.
|
||||
* `disk` - (Required) Disks to attach to instances created from this template.
|
||||
This can be specified multiple times for multiple disks. Structure is
|
||||
documented below.
|
||||
|
||||
* `machine_type` - (Required) The machine type to create.
|
||||
|
||||
* `disk` - (Required) Disks to attach to instances created from this
|
||||
template. This can be specified multiple times for multiple disks.
|
||||
Structure is documented below.
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
|
||||
- - -
|
||||
|
||||
* `can_ip_forward` - (Optional) Whether to allow sending and receiving of
|
||||
packets with non-matching source or destination IPs. This defaults to false.
|
||||
|
||||
* `description` - (Optional) A brief description of this resource.
|
||||
|
||||
* `instance_description` - (Optional) A brief description to use for instances
|
||||
created from this template.
|
||||
|
||||
* `metadata` - (Optional) Metadata key/value pairs to make available from
|
||||
within instances created from this template.
|
||||
within instances created from this template.
|
||||
|
||||
* `network_interface` - (Required) Networks to attach to instances created from this template.
|
||||
This can be specified multiple times for multiple networks. Structure is
|
||||
documented below.
|
||||
* `network_interface` - (Required) Networks to attach to instances created from
|
||||
this template. This can be specified multiple times for multiple networks.
|
||||
Structure is documented below.
|
||||
|
||||
* `region` - (Optional) An instance template is a global resource that is not bound to a zone
|
||||
or a region. However, you can still specify some regional resources in an instance template,
|
||||
which restricts the template to the region where that resource resides. For example, a
|
||||
custom `subnetwork` resource is tied to a specific region.
|
||||
Defaults to the region of the Provider if no value is given.
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `automatic_restart` - (Optional, Deprecated - see `scheduling`)
|
||||
Specifies whether the instance should be
|
||||
automatically restarted if it is terminated by Compute Engine (not
|
||||
terminated by a user).
|
||||
This defaults to true.
|
||||
* `region` - (Optional) An instance template is a global resource that is not
|
||||
bound to a zone or a region. However, you can still specify some regional
|
||||
resources in an instance template, which restricts the template to the
|
||||
region where that resource resides. For example, a custom `subnetwork`
|
||||
resource is tied to a specific region. Defaults to the region of the
|
||||
Provider if no value is given.
|
||||
|
||||
* `on_host_maintenance` - (Optional, Deprecated - see `scheduling`)
|
||||
Defines the maintenance behavior for this instance.
|
||||
* `scheduling` - (Optional) The scheduling strategy to use. More details about
|
||||
this configuration option are detailed below.
|
||||
|
||||
* `service_account` - (Optional) Service account to attach to the instance.
|
||||
|
||||
* `tags` - (Optional) Tags to attach to the instance.
|
||||
|
||||
|
||||
|
||||
The `disk` block supports:
|
||||
|
||||
* `auto_delete` - (Optional) Whether or not the disk should be auto-deleted.
|
||||
This defaults to true.
|
||||
This defaults to true.
|
||||
|
||||
* `boot` - (Optional) Indicates that this is a boot disk.
|
||||
|
||||
* `device_name` - (Optional) A unique device name that is reflected into
|
||||
the /dev/ tree of a Linux operating system running within the instance.
|
||||
If not specified, the server chooses a default device name to apply to
|
||||
this disk.
|
||||
* `device_name` - (Optional) A unique device name that is reflected into the
|
||||
/dev/ tree of a Linux operating system running within the instance. If not
|
||||
specified, the server chooses a default device name to apply to this disk.
|
||||
|
||||
* `disk_name` - (Optional) Name of the disk. When not provided, this defaults
|
||||
to the name of the instance.
|
||||
to the name of the instance.
|
||||
|
||||
* `source_image` - (Required if source not set) The name of the image to base
|
||||
this disk off of.
|
||||
this disk off of.
|
||||
|
||||
* `interface` - (Optional) Specifies the disk interface to use for attaching
|
||||
this disk.
|
||||
this disk.
|
||||
|
||||
* `mode` - (Optional) The mode in which to attach this disk, either READ_WRITE
|
||||
or READ_ONLY. If you are attaching or creating a boot disk, this must
|
||||
read-write mode.
|
||||
or READ_ONLY. If you are attaching or creating a boot disk, this must
|
||||
read-write mode.
|
||||
|
||||
* `source` - (Required if source_image not set) The name of the disk (such as
|
||||
those managed by `google_compute_disk`) to attach.
|
||||
those managed by `google_compute_disk`) to attach.
|
||||
|
||||
* `disk_type` - (Optional) The GCE disk type. Can be either `"pd-ssd"`,
|
||||
`"local-ssd"`, or `"pd-standard"`.
|
||||
`"local-ssd"`, or `"pd-standard"`.
|
||||
|
||||
* `disk_size_gb` - (Optional) The size of the image in gigabytes. If not specified,
|
||||
it will inherit the size of its base image.
|
||||
* `disk_size_gb` - (Optional) The size of the image in gigabytes. If not
|
||||
specified, it will inherit the size of its base image.
|
||||
|
||||
* `type` - (Optional) The type of GCE disk, can be either `"SCRATCH"` or
|
||||
`"PERSISTENT"`.
|
||||
`"PERSISTENT"`.
|
||||
|
||||
The `network_interface` block supports:
|
||||
|
||||
* `network` - (Optional) The name of the network to attach this interface to. Use `network`
|
||||
attribute for Legacy or Auto subnetted networks and `subnetwork` for custom subnetted
|
||||
networks.
|
||||
* `network` - (Optional) The name of the network to attach this interface to.
|
||||
Use `network` attribute for Legacy or Auto subnetted networks and
|
||||
`subnetwork` for custom subnetted networks.
|
||||
|
||||
* `subnetwork` - (Optional) the name of the subnetwork to attach this interface to. The subnetwork
|
||||
must exist in the same `region` this instance will be created in. Either `network`
|
||||
or `subnetwork` must be provided.
|
||||
* `subnetwork` - (Optional) the name of the subnetwork to attach this interface
|
||||
to. The subnetwork must exist in the same `region` this instance will be
|
||||
created in. Either `network` or `subnetwork` must be provided.
|
||||
|
||||
* `access_config` - (Optional) Access configurations, i.e. IPs via which this instance can be
|
||||
accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet
|
||||
(this means that ssh provisioners will not work unless you are running Terraform can send traffic to
|
||||
the instance's network (e.g. via tunnel or because it is running on another cloud instance on that
|
||||
network). This block can be repeated multiple times. Structure documented below.
|
||||
* `access_config` - (Optional) Access configurations, i.e. IPs via which this
|
||||
instance can be accessed via the Internet. Omit to ensure that the instance
|
||||
is not accessible from the Internet (this means that ssh provisioners will
|
||||
not work unless you are running Terraform can send traffic to the instance's
|
||||
network (e.g. via tunnel or because it is running on another cloud instance
|
||||
on that network). This block can be repeated multiple times. Structure documented below.
|
||||
|
||||
The `access_config` block supports:
|
||||
|
||||
* `nat_ip` - (Optional) The IP address that will be 1:1 mapped to the instance's network ip. If not
|
||||
given, one will be generated.
|
||||
* `nat_ip` - (Optional) The IP address that will be 1:1 mapped to the instance's
|
||||
network ip. If not given, one will be generated.
|
||||
|
||||
The `service_account` block supports:
|
||||
|
||||
* `scopes` - (Required) A list of service scopes. Both OAuth2 URLs and gcloud
|
||||
short names are supported.
|
||||
short names are supported.
|
||||
|
||||
The `scheduling` block supports:
|
||||
|
||||
* `automatic_restart` - (Optional) Specifies whether the instance should be
|
||||
automatically restarted if it is terminated by Compute Engine (not
|
||||
terminated by a user).
|
||||
This defaults to true.
|
||||
automatically restarted if it is terminated by Compute Engine (not
|
||||
terminated by a user). This defaults to true.
|
||||
|
||||
* `on_host_maintenance` - (Optional) Defines the maintenance behavior for this instance.
|
||||
* `on_host_maintenance` - (Optional) Defines the maintenance behavior for this
|
||||
instance.
|
||||
|
||||
* `preemptible` - (Optional) Allows instance to be preempted. Read
|
||||
more on this [here](https://cloud.google.com/compute/docs/instances/preemptible).
|
||||
* `preemptible` - (Optional) Allows instance to be preempted. Read more on this
|
||||
[here](https://cloud.google.com/compute/docs/instances/preemptible).
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URL of the created resource.
|
||||
* `metadata_fingerprint` - The unique fingerprint of the metadata.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
||||
* `tags_fingerprint` - The unique fingerprint of the tags.
|
||||
|
|
|
@ -12,10 +12,10 @@ Manages a network within GCE.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_network" "default" {
|
||||
name = "test"
|
||||
ipv4_range = "10.0.0.0/16"
|
||||
name = "test"
|
||||
ipv4_range = "10.0.0.0/16"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -26,23 +26,31 @@ The following arguments are supported:
|
|||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `ipv4_range` - (Optional) The IPv4 address range that machines in this
|
||||
network are assigned to, represented as a CIDR block. If not
|
||||
set, an auto or custom subnetted network will be created, depending
|
||||
on the value of `auto_create_subnetworks` attribute. This attribute
|
||||
may not be used if `auto_create_subnets` is specified.
|
||||
- - -
|
||||
|
||||
* `auto_create_subnetworks` - (Optional) If set to true, this network
|
||||
will be created in auto subnet mode, and Google will create a
|
||||
subnet for each region automatically.
|
||||
If set to false, and `ipv4_range` is not set, a custom subnetted
|
||||
network will be created that can support `google_compute_subnetwork`
|
||||
resources. This attribute may not be used if `ipv4_range` is specified.
|
||||
* `auto_create_subnetworks` - (Optional) If set to true, this network will be
|
||||
created in auto subnet mode, and Google will create a subnet for each region
|
||||
automatically. If set to false, and `ipv4_range` is not set, a custom
|
||||
subnetted network will be created that can support
|
||||
`google_compute_subnetwork` resources. This attribute may not be used if
|
||||
`ipv4_range` is specified.
|
||||
|
||||
* `description` - (Optional) A brief description of this resource.
|
||||
|
||||
* `ipv4_range` - (Optional) The IPv4 address range that machines in this network
|
||||
are assigned to, represented as a CIDR block. If not set, an auto or custom
|
||||
subnetted network will be created, depending on the value of
|
||||
`auto_create_subnetworks` attribute. This attribute may not be used if
|
||||
`auto_create_subnets` is specified. This attribute is deprecated.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `ipv4_range` - The CIDR block of this network.
|
||||
* `gateway_ipv4` - The IPv4 address of the gateway.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -12,13 +12,13 @@ Manages metadata common to all instances for a project in GCE.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_project_metadata" "default" {
|
||||
metadata {
|
||||
foo = "bar"
|
||||
fizz = "buzz"
|
||||
13 = "42"
|
||||
}
|
||||
metadata {
|
||||
foo = "bar"
|
||||
fizz = "buzz"
|
||||
13 = "42"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -26,11 +26,14 @@ resource "google_compute_project_metadata" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `metadata` - (Required) A series of key value pairs. Changing this resource updates
|
||||
the GCE state.
|
||||
* `metadata` - (Required) A series of key value pairs. Changing this resource
|
||||
updates the GCE state.
|
||||
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `metadata` - Common instance metadata.
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
|
@ -12,18 +12,18 @@ Manages a network route within GCE.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_network" "foobar" {
|
||||
name = "test"
|
||||
ipv4_range = "10.0.0.0/16"
|
||||
name = "test"
|
||||
ipv4_range = "10.0.0.0/16"
|
||||
}
|
||||
|
||||
resource "google_compute_route" "foobar" {
|
||||
name = "test"
|
||||
dest_range = "15.0.0.0/24"
|
||||
network = "${google_compute_network.foobar.name}"
|
||||
next_hop_ip = "10.0.1.5"
|
||||
priority = 100
|
||||
name = "test"
|
||||
dest_range = "15.0.0.0/24"
|
||||
network = "${google_compute_network.foobar.name}"
|
||||
next_hop_ip = "10.0.1.5"
|
||||
priority = 100
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -31,44 +31,43 @@ resource "google_compute_route" "foobar" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `dest_range` - (Required) The destination IPv4 address range that this
|
||||
route applies to.
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `dest_range` - (Required) The destination IPv4 address range that this
|
||||
route applies to.
|
||||
|
||||
* `network` - (Required) The name of the network to attach this route to.
|
||||
|
||||
* `next_hop_ip` - (Optional) The IP address of the next hop if this route
|
||||
is matched.
|
||||
* `priority` - (Required) The priority of this route, used to break ties.
|
||||
|
||||
* `next_hop_instance` - (Optional) The name of the VM instance to route to
|
||||
if this route is matched.
|
||||
|
||||
* `next_hop_instance_zone` - (Required when `next_hop_instance` is specified) The zone of the instance specified
|
||||
in `next_hop_instance`.
|
||||
- - -
|
||||
|
||||
* `next_hop_gateway` - (Optional) The name of the internet gateway to route
|
||||
to if this route is matched.
|
||||
|
||||
* `next_hop_vpn_gateway` - (Optional) The name of the VPN to route to if this
|
||||
* `next_hop_instance` - (Optional) The name of the VM instance to route to
|
||||
if this route is matched.
|
||||
|
||||
* `next_hop_instance_zone` - (Required when `next_hop_instance` is specified)
|
||||
The zone of the instance specified in `next_hop_instance`.
|
||||
|
||||
* `next_hop_ip` - (Optional) The IP address of the next hop if this route
|
||||
is matched.
|
||||
|
||||
* `next_hop_vpn_tunnel` - (Optional) The name of the VPN to route to if this
|
||||
route is matched.
|
||||
|
||||
* `priority` - (Required) The priority of this route, used to break ties.
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `tags` - (Optional) The tags that this route applies to.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `dest_range` - The destination CIDR block of this route.
|
||||
* `network` - The name of the network of this route.
|
||||
* `next_hop_ip` - The IP address of the next hop, if available.
|
||||
* `next_hop_instance` - The name of the instance of the next hop, if available.
|
||||
* `next_hop_instance_zone` - The zone of the next hop instance, if available.
|
||||
* `next_hop_gateway` - The name of the next hop gateway, if available.
|
||||
* `next_hop_network` - The name of the next hop network, if available.
|
||||
* `priority` - The priority of this route.
|
||||
* `tags` - The tags this route applies to.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -16,12 +16,12 @@ For more information see
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_ssl_certificate" "default" {
|
||||
name = "my-certificate"
|
||||
description = "a description"
|
||||
private_key = "${file("path/to/private.key")}"
|
||||
certificate = "${file("path/to/certificate.crt")}"
|
||||
name = "my-certificate"
|
||||
description = "a description"
|
||||
private_key = "${file("path/to/private.key")}"
|
||||
certificate = "${file("path/to/certificate.crt")}"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -29,19 +29,29 @@ resource "google_compute_ssl_certificate" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `certificate` - (Required) A local certificate file in PEM format. The chain
|
||||
may be at most 5 certs long, and must include at least one intermediate
|
||||
cert. Changing this forces a new resource to be created.
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
* `description` - (Optional) An optional description of this resource.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `private_key` - (Required) Write only private key in PEM format.
|
||||
Changing this forces a new resource to be created.
|
||||
* `certificate` - (Required) A local certificate file in PEM format. The chain
|
||||
may be at most 5 certs long, and must include at least one intermediate cert.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) An optional description of this resource.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `id` - A unique ID for the certificated, assigned by GCE.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
* `id` - A unique ID assigned by GCE.
|
||||
|
|
|
@ -12,12 +12,12 @@ Manages a subnetwork within GCE.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_subnetwork" "default-us-east1" {
|
||||
name = "default-us-east1"
|
||||
ip_cidr_range = "10.0.0.0/16"
|
||||
network = "${google_compute_network.default.self_link}"
|
||||
region = "us-east1"
|
||||
name = "default-us-east1"
|
||||
ip_cidr_range = "10.0.0.0/16"
|
||||
network = "${google_compute_network.default.self_link}"
|
||||
region = "us-east1"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -25,23 +25,30 @@ resource "google_compute_subnetwork" "default-us-east1" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `ip_cidr_range` - (Required) The IP address range that machines in this
|
||||
network are assigned to, represented as a CIDR block.
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `network` - (Required) A link to the parent network of this subnetwork.
|
||||
The parent network must have been created in custom subnet mode.
|
||||
The parent network must have been created in custom subnet mode.
|
||||
|
||||
* `ip_cidr_range` - (Required) The IP address range that machines in this
|
||||
network are assigned to, represented as a CIDR block.
|
||||
|
||||
* `region` - (Required) The region this subnetwork will be created in.
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) Description of this subnetwork.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `region` - (Optional) The region this subnetwork will be created in. If
|
||||
unspecified, this defaults to the region configured in the provider.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `ip_cidr_range` - The CIDR block of this network.
|
||||
* `gateway_address` - The IP address of the gateway.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -16,48 +16,49 @@ documentation](https://cloud.google.com/compute/docs/load-balancing/http/target-
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_target_http_proxy" "default" {
|
||||
name = "test-proxy"
|
||||
description = "a description"
|
||||
url_map = "${google_compute_url_map.default.self_link}"
|
||||
name = "test-proxy"
|
||||
description = "a description"
|
||||
url_map = "${google_compute_url_map.default.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_url_map" "default" {
|
||||
name = "url-map"
|
||||
description = "a description"
|
||||
name = "url-map"
|
||||
description = "a description"
|
||||
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
name = "allpaths"
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
name = "allpaths"
|
||||
path_rule {
|
||||
paths = ["/*"]
|
||||
service = "${google_compute_backend_service.default.self_link}"
|
||||
}
|
||||
path_rule {
|
||||
paths = ["/*"]
|
||||
service = "${google_compute_backend_service.default.self_link}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_backend_service" "default" {
|
||||
name = "default-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
name = "default-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_http_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -65,16 +66,23 @@ resource "google_compute_http_health_check" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
* `description` - (Optional) A description of this resource.
|
||||
Changing this forces a new resource to be created.
|
||||
* `url_map` - (Required) The URL of a URL Map resource that defines the
|
||||
mapping from the URL to the BackendService.
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
* `url_map` - (Required) The URL of a URL Map resource that defines the mapping
|
||||
from the URL to the BackendService.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) A description of this resource. Changing this
|
||||
forces a new resource to be created.
|
||||
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `id` - A unique ID assigned by GCE.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
* `id` - A unique ID assigned by GCE.
|
||||
|
|
|
@ -16,56 +16,57 @@ documentation](https://cloud.google.com/compute/docs/load-balancing/http/target-
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_target_https_proxy" "default" {
|
||||
name = "test-proxy"
|
||||
description = "a description"
|
||||
url_map = "${google_compute_url_map.default.self_link}"
|
||||
ssl_certificates = ["${google_compute_ssl_certificate.default.self_link}"]
|
||||
name = "test-proxy"
|
||||
description = "a description"
|
||||
url_map = "${google_compute_url_map.default.self_link}"
|
||||
ssl_certificates = ["${google_compute_ssl_certificate.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_ssl_certificate" "default" {
|
||||
name = "my-certificate"
|
||||
description = "a description"
|
||||
private_key = "${file("path/to/private.key")}"
|
||||
certificate = "${file("path/to/certificate.crt")}"
|
||||
name = "my-certificate"
|
||||
description = "a description"
|
||||
private_key = "${file("path/to/private.key")}"
|
||||
certificate = "${file("path/to/certificate.crt")}"
|
||||
}
|
||||
|
||||
resource "google_compute_url_map" "default" {
|
||||
name = "url-map"
|
||||
description = "a description"
|
||||
name = "url-map"
|
||||
description = "a description"
|
||||
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
name = "allpaths"
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
default_service = "${google_compute_backend_service.default.self_link}"
|
||||
name = "allpaths"
|
||||
path_rule {
|
||||
paths = ["/*"]
|
||||
service = "${google_compute_backend_service.default.self_link}"
|
||||
}
|
||||
path_rule {
|
||||
paths = ["/*"]
|
||||
service = "${google_compute_backend_service.default.self_link}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_backend_service" "default" {
|
||||
name = "default-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
name = "default-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_http_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -73,19 +74,29 @@ resource "google_compute_http_health_check" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
* `description` - (Optional) A description of this resource.
|
||||
Changing this forces a new resource to be created.
|
||||
* `url_map` - (Required) The URL of a URL Map resource that defines the
|
||||
mapping from the URL to the BackendService.
|
||||
* `ssl_certificates` - (Required) The URLs of the SSL Certificate resources
|
||||
that authenticate connections between users and load balancing. Currently
|
||||
exactly one must be specified.
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
* `ssl_certificates` - (Required) The URLs of the SSL Certificate resources that
|
||||
authenticate connections between users and load balancing. Currently exactly
|
||||
one must be specified.
|
||||
|
||||
* `url_map` - (Required) The URL of a URL Map resource that defines the mapping
|
||||
from the URL to the BackendService.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) A description of this resource. Changing this
|
||||
forces a new resource to be created.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `id` - A unique ID assigned by GCE.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
* `id` - A unique ID assigned by GCE.
|
||||
|
|
|
@ -8,8 +8,8 @@ description: |-
|
|||
|
||||
# google\_compute\_target\_pool
|
||||
|
||||
Manages a Target Pool within GCE. This is a collection of instances used as
|
||||
target of a network load balancer (Forwarding Rule). For more information see
|
||||
Manages a Target Pool within GCE. This is a collection of instances used as
|
||||
target of a network load balancer (Forwarding Rule). For more information see
|
||||
[the official
|
||||
documentation](https://cloud.google.com/compute/docs/load-balancing/network/target-pools)
|
||||
and [API](https://cloud.google.com/compute/docs/reference/latest/targetPools).
|
||||
|
@ -17,11 +17,18 @@ and [API](https://cloud.google.com/compute/docs/reference/latest/targetPools).
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_target_pool" "default" {
|
||||
name = "test"
|
||||
instances = [ "us-central1-a/myinstance1", "us-central1-b/myinstance2" ]
|
||||
health_checks = [ "${google_compute_http_health_check.default.name}" ]
|
||||
name = "test"
|
||||
|
||||
instances = [
|
||||
"us-central1-a/myinstance1",
|
||||
"us-central1-b/myinstance2",
|
||||
]
|
||||
|
||||
health_checks = [
|
||||
"${google_compute_http_health_check.default.name}",
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -29,31 +36,40 @@ resource "google_compute_target_pool" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `backup_pool` - (Optional) URL to the backup target pool. Must also set
|
||||
failover\_ratio.
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `backup_pool` - (Optional) URL to the backup target pool. Must also set
|
||||
failover\_ratio.
|
||||
|
||||
* `description` - (Optional) Textual description field.
|
||||
|
||||
* `failover_ratio` - (Optional) Ratio (0 to 1) of failed nodes before using the
|
||||
backup pool (which must also be set).
|
||||
backup pool (which must also be set).
|
||||
|
||||
* `health_checks` - (Optional) List of zero or one healthcheck names.
|
||||
|
||||
* `instances` - (Optional) List of instances in the pool. They can be given as
|
||||
URLs, or in the form of "zone/name". Note that the instances need not exist
|
||||
at the time of target pool creation, so there is no need to use the Terraform
|
||||
interpolators to create a dependency on the instances from the target pool.
|
||||
* `instances` - (Optional) List of instances in the pool. They can be given as
|
||||
URLs, or in the form of "zone/name". Note that the instances need not exist
|
||||
at the time of target pool creation, so there is no need to use the
|
||||
Terraform interpolators to create a dependency on the instances from the
|
||||
target pool.
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `session_affinity` - (Optional) How to distribute load. Options are "NONE" (no affinity). "CLIENT\_IP" (hash of the source/dest addresses / ports), and "CLIENT\_IP\_PROTO" also includes the protocol (default "NONE").
|
||||
* `region` - (Optional) Where the target pool resides. Defaults to project
|
||||
region.
|
||||
|
||||
* `region` - (Optional) Where the target pool resides. Defaults to project region.
|
||||
* `session_affinity` - (Optional) How to distribute load. Options are "NONE" (no
|
||||
affinity). "CLIENT\_IP" (hash of the source/dest addresses / ports), and
|
||||
"CLIENT\_IP\_PROTO" also includes the protocol (default "NONE").
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `self_link` - The URL of the created resource.
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
---
|
||||
layout: "google"
|
||||
page_title: "Google: google_compute_url_map"
|
||||
sidebar_current: "docs-google-resource-url-map"
|
||||
sidebar_current: "docs-google-compute-url-map"
|
||||
description: |-
|
||||
Manages a URL Map resource in GCE.
|
||||
---
|
||||
|
||||
# google\_compute\_url\_map
|
||||
|
||||
Manages a URL Map resource within GCE. For more information see
|
||||
Manages a URL Map resource within GCE. For more information see
|
||||
[the official documentation](https://cloud.google.com/compute/docs/load-balancing/http/url-map)
|
||||
and
|
||||
[API](https://cloud.google.com/compute/docs/reference/latest/urlMaps).
|
||||
|
@ -16,63 +16,65 @@ and
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_url_map" "foobar" {
|
||||
name = "urlmap"
|
||||
description = "a description"
|
||||
name = "urlmap"
|
||||
description = "a description"
|
||||
|
||||
default_service = "${google_compute_backend_service.home.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
name = "allpaths"
|
||||
default_service = "${google_compute_backend_service.home.self_link}"
|
||||
|
||||
host_rule {
|
||||
hosts = ["mysite.com"]
|
||||
path_matcher = "allpaths"
|
||||
path_rule {
|
||||
paths = ["/home"]
|
||||
service = "${google_compute_backend_service.home.self_link}"
|
||||
}
|
||||
|
||||
path_matcher {
|
||||
default_service = "${google_compute_backend_service.home.self_link}"
|
||||
name = "allpaths"
|
||||
path_rule {
|
||||
paths = ["/home"]
|
||||
service = "${google_compute_backend_service.home.self_link}"
|
||||
}
|
||||
|
||||
path_rule {
|
||||
paths = ["/login"]
|
||||
service = "${google_compute_backend_service.login.self_link}"
|
||||
}
|
||||
path_rule {
|
||||
paths = ["/login"]
|
||||
service = "${google_compute_backend_service.login.self_link}"
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
service = "${google_compute_backend_service.home.self_link}"
|
||||
host = "hi.com"
|
||||
path = "/home"
|
||||
}
|
||||
test {
|
||||
service = "${google_compute_backend_service.home.self_link}"
|
||||
host = "hi.com"
|
||||
path = "/home"
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_backend_service" "login" {
|
||||
name = "login-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
name = "login-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_backend_service" "home" {
|
||||
name = "home-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
name = "home-backend"
|
||||
port_name = "http"
|
||||
protocol = "HTTP"
|
||||
timeout_sec = 10
|
||||
region = "us-central1"
|
||||
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
health_checks = ["${google_compute_http_health_check.default.self_link}"]
|
||||
}
|
||||
|
||||
resource "google_compute_http_health_check" "default" {
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
name = "test"
|
||||
request_path = "/"
|
||||
check_interval_sec = 1
|
||||
timeout_sec = 1
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -80,50 +82,62 @@ resource "google_compute_http_health_check" "default" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `default_service` - (Required) The URL of the backend service to use when none
|
||||
of the given rules match. See the documentation for formatting the service
|
||||
URL
|
||||
[here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#defaultService)
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) A brief description of this resource.
|
||||
|
||||
* `default_service` - (Required) The URL of the backend service to use when none of the
|
||||
given rules match. See the documentation for formatting the service URL
|
||||
[here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#defaultService)
|
||||
* `host_rule` - (Optional) A list of host rules. See below for configuration
|
||||
options.
|
||||
|
||||
The `host_rule` block supports: (Note that this block can be defined an arbitrary
|
||||
number of times.)
|
||||
* `path_matcher` - (Optional) A list of paths to match. See below for
|
||||
configuration options.
|
||||
|
||||
* `hosts` (Required) - A list of hosts to match against. See the documention
|
||||
for formatting each host [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#hostRules.hosts)
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `test` - (Optional) The test to perform. See below for configuration options.
|
||||
|
||||
The `host_rule` block supports: (This block can be defined multiple times).
|
||||
|
||||
* `hosts` (Required) - A list of hosts to match against. See the documentation
|
||||
for formatting each host
|
||||
[here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#hostRules.hosts)
|
||||
|
||||
* `description` - (Optional) An optional description of the host rule.
|
||||
|
||||
* `path_matcher` - (Required) The name of the `path_matcher` (defined below)
|
||||
to apply this host rule to.
|
||||
|
||||
The `path_matcher` block supports: (Note that this block can be defined an arbitrary
|
||||
number of times.)
|
||||
The `path_matcher` block supports: (This block can be defined multiple times)
|
||||
|
||||
* `default_service` - (Required) The URL for the backend service to use if none
|
||||
of the given paths match. See the documentation for formatting the service URL
|
||||
[here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatcher.defaultService)
|
||||
of the given paths match. See the documentation for formatting the service
|
||||
URL [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatcher.defaultService)
|
||||
|
||||
* `name` - (Required) The name of the `path_matcher` resource. Used by the `host_rule`
|
||||
block above.
|
||||
* `name` - (Required) The name of the `path_matcher` resource. Used by the
|
||||
`host_rule` block above.
|
||||
|
||||
* `description` - (Optional) An optional description of the host rule.
|
||||
|
||||
The `path_matcher.path_rule` sub-block supports: (Note that this block can be defined an arbitrary
|
||||
number of times.)
|
||||
The `path_matcher.path_rule` sub-block supports: (This block can be defined
|
||||
multiple times)
|
||||
|
||||
* `paths` - (Required) The list of paths to match against. See the
|
||||
documentation for formatting these [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatchers.pathRules.paths)
|
||||
|
||||
* `default_service` - (Required) The URL for the backend service to use if any
|
||||
of the given paths match. See the documentation for formatting the service URL
|
||||
[here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatcher.defaultService)
|
||||
of the given paths match. See the documentation for formatting the service
|
||||
URL [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatcher.defaultService)
|
||||
|
||||
The optional `test` block supports: (Note that this block can be defined an arbitary
|
||||
number of times.)
|
||||
The optional `test` block supports: (This block can be defined multiple times)
|
||||
|
||||
* `service` - (Required) The service that should be matched by this test.
|
||||
|
||||
|
@ -135,7 +149,11 @@ number of times.)
|
|||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `fingerprint` - The unique fingerprint for this resource.
|
||||
|
||||
* `id` - The GCE assigned ID of the resource.
|
||||
* `self_link` - A GCE assigned link to the resource.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -14,83 +14,91 @@ Manages a VPN Gateway in the GCE network. For more info, read the
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_network" "network1" {
|
||||
name = "network1"
|
||||
ipv4_range = "10.120.0.0/16"
|
||||
name = "network1"
|
||||
ipv4_range = "10.120.0.0/16"
|
||||
}
|
||||
|
||||
resource "google_compute_vpn_gateway" "target_gateway" {
|
||||
name = "vpn1"
|
||||
network = "${google_compute_network.network1.self_link}"
|
||||
region = "${var.region}"
|
||||
name = "vpn1"
|
||||
network = "${google_compute_network.network1.self_link}"
|
||||
region = "${var.region}"
|
||||
}
|
||||
|
||||
resource "google_compute_address" "vpn_static_ip" {
|
||||
name = "vpn-static-ip"
|
||||
region = "${var.region}"
|
||||
name = "vpn-static-ip"
|
||||
region = "${var.region}"
|
||||
}
|
||||
|
||||
resource "google_compute_forwarding_rule" "fr_esp" {
|
||||
name = "fr-esp"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "ESP"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
name = "fr-esp"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "ESP"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_forwarding_rule" "fr_udp500" {
|
||||
name = "fr-udp500"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
name = "fr-udp500"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_forwarding_rule" "fr_udp4500" {
|
||||
name = "fr-udp4500"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "4500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
name = "fr-udp4500"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "4500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_vpn_tunnel" "tunnel1" {
|
||||
name = "tunnel1"
|
||||
region = "${var.region}"
|
||||
peer_ip = "15.0.0.120"
|
||||
shared_secret = "a secret message"
|
||||
target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
depends_on = ["google_compute_forwarding_rule.fr_esp",
|
||||
"google_compute_forwarding_rule.fr_udp500",
|
||||
"google_compute_forwarding_rule.fr_udp4500"]
|
||||
name = "tunnel1"
|
||||
region = "${var.region}"
|
||||
peer_ip = "15.0.0.120"
|
||||
shared_secret = "a secret message"
|
||||
|
||||
target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
|
||||
depends_on = [
|
||||
"google_compute_forwarding_rule.fr_esp",
|
||||
"google_compute_forwarding_rule.fr_udp500",
|
||||
"google_compute_forwarding_rule.fr_udp4500",
|
||||
]
|
||||
}
|
||||
|
||||
resource "google_compute_route" "route1" {
|
||||
name = "route1"
|
||||
network = "${google_compute_network.network1.name}"
|
||||
next_hop_vpn_tunnel = "${google_compute_vpn_tunnel.tunnel1.self_link}"
|
||||
dest_range = "15.0.0.0/24"
|
||||
priority = 1000
|
||||
}
|
||||
name = "route1"
|
||||
network = "${google_compute_network.network1.name}"
|
||||
dest_range = "15.0.0.0/24"
|
||||
priority = 1000
|
||||
|
||||
next_hop_vpn_tunnel = "${google_compute_vpn_tunnel.tunnel1.self_link}"
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
* `network` - (Required) A link to the network this VPN gateway is accepting
|
||||
traffic for. Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) A description of the resource.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `network` - (Required) A link to the network this VPN gateway is accepting
|
||||
traffic for.
|
||||
Changing this forces a new resource to be created.
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `region` - (Optional) The region this gateway should sit in. If not specified,
|
||||
the project region will be used. Changing this forces a new resource to be
|
||||
|
@ -98,6 +106,7 @@ The following arguments are supported:
|
|||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - A GCE server assigned link to this resource.
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -13,104 +13,109 @@ Manages a VPN Tunnel to the GCE network. For more info, read the
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_network" "network1" {
|
||||
name = "network1"
|
||||
ipv4_range = "10.120.0.0/16"
|
||||
name = "network1"
|
||||
ipv4_range = "10.120.0.0/16"
|
||||
}
|
||||
|
||||
resource "google_compute_vpn_gateway" "target_gateway" {
|
||||
name = "vpn1"
|
||||
network = "${google_compute_network.network1.self_link}"
|
||||
region = "${var.region}"
|
||||
name = "vpn1"
|
||||
network = "${google_compute_network.network1.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_address" "vpn_static_ip" {
|
||||
name = "vpn-static-ip"
|
||||
region = "${var.region}"
|
||||
name = "vpn-static-ip"
|
||||
}
|
||||
|
||||
resource "google_compute_forwarding_rule" "fr_esp" {
|
||||
name = "fr-esp"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "ESP"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
name = "fr-esp"
|
||||
ip_protocol = "ESP"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_forwarding_rule" "fr_udp500" {
|
||||
name = "fr-udp500"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
name = "fr-udp500"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_forwarding_rule" "fr_udp4500" {
|
||||
name = "fr-udp4500"
|
||||
region = "${var.region}"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "4500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
name = "fr-udp4500"
|
||||
ip_protocol = "UDP"
|
||||
port_range = "4500"
|
||||
ip_address = "${google_compute_address.vpn_static_ip.address}"
|
||||
target = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
}
|
||||
|
||||
resource "google_compute_vpn_tunnel" "tunnel1" {
|
||||
name = "tunnel1"
|
||||
region = "${var.region}"
|
||||
peer_ip = "15.0.0.120"
|
||||
shared_secret = "a secret message"
|
||||
target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
depends_on = ["google_compute_forwarding_rule.fr_esp",
|
||||
"google_compute_forwarding_rule.fr_udp500",
|
||||
"google_compute_forwarding_rule.fr_udp4500"]
|
||||
name = "tunnel1"
|
||||
peer_ip = "15.0.0.120"
|
||||
shared_secret = "a secret message"
|
||||
|
||||
target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}"
|
||||
|
||||
depends_on = [
|
||||
"google_compute_forwarding_rule.fr_esp",
|
||||
"google_compute_forwarding_rule.fr_udp500",
|
||||
"google_compute_forwarding_rule.fr_udp4500",
|
||||
]
|
||||
}
|
||||
|
||||
resource "google_compute_route" "route1" {
|
||||
name = "route1"
|
||||
network = "${google_compute_network.network1.name}"
|
||||
next_hop_vpn_tunnel = "${google_compute_vpn_tunnel.tunnel1.self_link}"
|
||||
dest_range = "15.0.0.0/24"
|
||||
priority = 1000
|
||||
}
|
||||
name = "route1"
|
||||
network = "${google_compute_network.network1.name}"
|
||||
dest_range = "15.0.0.0/24"
|
||||
priority = 1000
|
||||
|
||||
next_hop_vpn_tunnel = "${google_compute_vpn_tunnel.tunnel1.self_link}"
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
* `name` - (Required) A unique name for the resource, required by GCE. Changing
|
||||
this forces a new resource to be created.
|
||||
|
||||
* `peer_ip` - (Required) The VPN gateway sitting outside of GCE. Changing this
|
||||
forces a new resource to be created.
|
||||
|
||||
* `shared_secret` - (Required) A passphrase shared between the two VPN gateways.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `description` - (Optional) A description of the resource.
|
||||
Changing this forces a new resource to be created.
|
||||
* `target_vpn_gateway` - (Required) A link to the VPN gateway sitting inside
|
||||
GCE. Changing this forces a new resource to be created.
|
||||
|
||||
* `peer_ip` - (Required) The VPN gateway sitting outside of GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) A description of the resource. Changing this forces
|
||||
a new resource to be created.
|
||||
|
||||
* `ike_version` - (Optional) Either version 1 or 2. Default is 2. Changing this
|
||||
forces a new resource to be created.
|
||||
|
||||
* `local_traffic_selector` - (Optional) Specifies which CIDR ranges are
|
||||
announced to the VPN peer. Mandatory if the VPN gateway is attached to a
|
||||
custom subnetted network. Refer to Google documentation for more
|
||||
information.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `region` - (Optional) The region this tunnel should sit in. If not specified,
|
||||
the project region will be used. Changing this forces a new resource to be
|
||||
created.
|
||||
|
||||
* `shared_secret` - (Required) A passphrase shared between the two VPN gateways.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `target_vpn_gateway` - (Required) A link to the VPN gateway sitting inside GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `ike_version` - (Optional) Either version 1 or 2. Default is 2.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `local_traffic_selector` - (Optional) Specifies which CIDR ranges are announced
|
||||
to the VPN peer. Mandatory if the VPN gateway is attached to a custom subnetted
|
||||
network. Refer to Google documentation for more information.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `self_link` - A GCE server assigned link to this resource.
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `detailed_status` - Information about the status of the VPN tunnel.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -8,64 +8,95 @@ description: |-
|
|||
|
||||
# google\_container\_cluster
|
||||
|
||||
-> **Note:** Due to limitations of the API, all arguments except `node_version` are non-updateable (changing any will cause recreation of the whole cluster).
|
||||
!> **Warning:** Due to limitations of the API, all arguments except
|
||||
`node_version` are non-updateable. Changing any will cause recreation of the
|
||||
whole cluster!
|
||||
|
||||
## Example usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_container_cluster" "primary" {
|
||||
name = "marcellus-wallace"
|
||||
zone = "us-central1-a"
|
||||
initial_node_count = 3
|
||||
name = "marcellus-wallace"
|
||||
zone = "us-central1-a"
|
||||
initial_node_count = 3
|
||||
|
||||
master_auth {
|
||||
username = "mr.yoda"
|
||||
password = "adoy.rm"
|
||||
}
|
||||
master_auth {
|
||||
username = "mr.yoda"
|
||||
password = "adoy.rm"
|
||||
}
|
||||
|
||||
node_config {
|
||||
oauth_scopes = [
|
||||
"https://www.googleapis.com/auth/compute",
|
||||
"https://www.googleapis.com/auth/devstorage.read_only",
|
||||
"https://www.googleapis.com/auth/logging.write",
|
||||
"https://www.googleapis.com/auth/monitoring"
|
||||
]
|
||||
}
|
||||
node_config {
|
||||
oauth_scopes = [
|
||||
"https://www.googleapis.com/auth/compute",
|
||||
"https://www.googleapis.com/auth/devstorage.read_only",
|
||||
"https://www.googleapis.com/auth/logging.write",
|
||||
"https://www.googleapis.com/auth/monitoring"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
* `name` - (Required) The name of the cluster, unique within the project and zone
|
||||
* `initial_node_count` - (Required) The number of nodes to create in this
|
||||
cluster (not including the Kubernetes master).
|
||||
|
||||
* `master_auth` - (Required) The authentication information for accessing the
|
||||
Kubernetes master.
|
||||
|
||||
* `name` - (Required) The name of the cluster, unique within the project and
|
||||
zone.
|
||||
|
||||
* `zone` - (Required) The zone that all resources should be created in.
|
||||
* `master_auth` - (Required) The authentication information for accessing the Kubernetes master
|
||||
* `initial_node_count` - (Required) The number of nodes to create in this cluster (not including the Kubernetes master)
|
||||
* `description` - (Optional) Description of the cluster
|
||||
* `node_version` - (Optional) The Kubernetes version on the nodes. Only valid for upgrading of existing cluster.
|
||||
Defaults to latest version supported by the server.
|
||||
* `cluster_ipv4_cidr` - (Optional) The IP address range of the container pods in this cluster.
|
||||
Default is an automatically assigned CIDR.
|
||||
* `logging_service` - (Optional) The logging service that the cluster should write logs to.
|
||||
Available options include `logging.googleapis.com` and `none`. Defaults to `logging.googleapis.com`
|
||||
* `monitoring_service` - (Optional) The monitoring service that the cluster should write metrics to.
|
||||
Available options include `monitoring.googleapis.com` and `none`. Defaults to `monitoring.googleapis.com`
|
||||
* `network` - (Optional) The name of the Google Compute Engine network to which the cluster is connected
|
||||
* `node_config` - (Optional) The machine type and image to use for all nodes in this cluster
|
||||
|
||||
- - -
|
||||
|
||||
* `cluster_ipv4_cidr` - (Optional) The IP address range of the container pods in
|
||||
this cluster. Default is an automatically assigned CIDR.
|
||||
|
||||
* `description` - (Optional) Description of the cluster.
|
||||
|
||||
* `logging_service` - (Optional) The logging service that the cluster should
|
||||
write logs to. Available options include `logging.googleapis.com` and
|
||||
`none`. Defaults to `logging.googleapis.com`
|
||||
|
||||
* `monitoring_service` - (Optional) The monitoring service that the cluster
|
||||
should write metrics to. Available options include
|
||||
`monitoring.googleapis.com` and `none`. Defaults to
|
||||
`monitoring.googleapis.com`
|
||||
|
||||
* `network` - (Optional) The name of the Google Compute Engine network to which
|
||||
the cluster is connected
|
||||
|
||||
* `node_config` - (Optional) The machine type and image to use for all nodes in
|
||||
this cluster
|
||||
|
||||
* `node_version` - (Optional) The Kubernetes version on the nodes. Only valid
|
||||
for upgrading of existing cluster. Defaults to latest version supported by
|
||||
the server.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
**Master Auth** supports the following arguments:
|
||||
|
||||
* `password` - The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint
|
||||
* `username` - The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint
|
||||
* `password` - The password to use for HTTP basic authentication when accessing
|
||||
the Kubernetes master endpoint
|
||||
|
||||
* `username` - The username to use for HTTP basic authentication when accessing
|
||||
the Kubernetes master endpoint
|
||||
|
||||
**Node Config** supports the following arguments:
|
||||
|
||||
* `machine_type` - (Optional) The name of a Google Compute Engine machine type.
|
||||
Defaults to `n1-standard-1`.
|
||||
* `disk_size_gb` - (Optional) Size of the disk attached to each node, specified in GB.
|
||||
The smallest allowed disk size is 10GB. Defaults to 100GB.
|
||||
* `oauth_scopes` - (Optional) The set of Google API scopes to be made available on all
|
||||
of the node VMs under the "default" service account. The following scopes are necessary
|
||||
to ensure the correct functioning of the cluster:
|
||||
Defaults to `n1-standard-1`.
|
||||
|
||||
* `disk_size_gb` - (Optional) Size of the disk attached to each node, specified
|
||||
in GB. The smallest allowed disk size is 10GB. Defaults to 100GB.
|
||||
|
||||
* `oauth_scopes` - (Optional) The set of Google API scopes to be made available
|
||||
on all of the node VMs under the "default" service account. The following
|
||||
scopes are necessary to ensure the correct functioning of the cluster:
|
||||
|
||||
* `https://www.googleapis.com/auth/compute`
|
||||
* `https://www.googleapis.com/auth/devstorage.read_only`
|
||||
|
@ -74,11 +105,19 @@ resource "google_container_cluster" "primary" {
|
|||
|
||||
## Attributes Reference
|
||||
|
||||
* `master_auth.client_certificate` - Base64 encoded public certificate
|
||||
used by clients to authenticate to the cluster endpoint.
|
||||
* `master_auth.client_key` - Base64 encoded private key used by clients
|
||||
to authenticate to the cluster endpoint
|
||||
* `master_auth.cluster_ca_certificate` - Base64 encoded public certificate
|
||||
that is the root of trust for the cluster
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `endpoint` - The IP address of this cluster's Kubernetes master
|
||||
* `instance_group_urls` - List of instance group URLs which have been assigned to the cluster
|
||||
|
||||
* `instance_group_urls` - List of instance group URLs which have been assigned
|
||||
to the cluster
|
||||
|
||||
* `master_auth.client_certificate` - Base64 encoded public certificate
|
||||
used by clients to authenticate to the cluster endpoint.
|
||||
|
||||
* `master_auth.client_key` - Base64 encoded private key used by clients
|
||||
to authenticate to the cluster endpoint
|
||||
|
||||
* `master_auth.cluster_ca_certificate` - Base64 encoded public certificate
|
||||
that is the root of trust for the cluster
|
||||
|
|
|
@ -12,11 +12,11 @@ Manages a zone within Google Cloud DNS.
|
|||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_dns_managed_zone" "prod" {
|
||||
name = "prod-zone"
|
||||
dns_name = "prod.mydomain.com."
|
||||
description = "Production DNS zone"
|
||||
name = "prod-zone"
|
||||
dns_name = "prod.mydomain.com."
|
||||
description = "Production DNS zone"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -24,19 +24,23 @@ resource "google_dns_managed_zone" "prod" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `dns_name` - (Required) The DNS name of this zone, e.g. "terraform.io".
|
||||
|
||||
* `name` - (Required) A unique name for the resource, required by GCE.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `dns_name` - (Required) The DNS name of this zone, e.g. "terraform.io".
|
||||
- - -
|
||||
|
||||
* `description` - (Optional) A textual description field. Defaults to 'Managed by Terraform'.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
* `dns_name` - The DNS name of this zone.
|
||||
* `name_servers` - The list of nameservers that will be authoritative for this
|
||||
domain. Use NS records to redirect from your DNS provider to these names,
|
||||
thus making Google Cloud DNS authoritative for this zone.
|
||||
domain. Use NS records to redirect from your DNS provider to these names,
|
||||
thus making Google Cloud DNS authoritative for this zone.
|
||||
|
|
|
@ -14,33 +14,34 @@ Manages a set of DNS records within Google Cloud DNS.
|
|||
|
||||
This example is the common case of binding a DNS name to the ephemeral IP of a new instance:
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_compute_instance" "frontend" {
|
||||
name = "frontend"
|
||||
machine_type = "g1-small"
|
||||
zone = "us-central1-b"
|
||||
name = "frontend"
|
||||
machine_type = "g1-small"
|
||||
zone = "us-central1-b"
|
||||
|
||||
disk {
|
||||
image = "debian-7-wheezy-v20160301"
|
||||
}
|
||||
disk {
|
||||
image = "debian-7-wheezy-v20160301"
|
||||
}
|
||||
|
||||
network_interface {
|
||||
network = "default"
|
||||
access_config {
|
||||
}
|
||||
}
|
||||
network_interface {
|
||||
network = "default"
|
||||
access_config {}
|
||||
}
|
||||
}
|
||||
resource "google_dns_managed_zone" "prod" {
|
||||
name = "prod-zone"
|
||||
dns_name = "prod.mydomain.com."
|
||||
name = "prod-zone"
|
||||
dns_name = "prod.mydomain.com."
|
||||
}
|
||||
|
||||
resource "google_dns_record_set" "frontend" {
|
||||
managed_zone = "${google_dns_managed_zone.prod.name}"
|
||||
name = "frontend.${google_dns_managed_zone.prod.dns_name}"
|
||||
type = "A"
|
||||
ttl = 300
|
||||
rrdatas = ["${google_compute_instance.frontend.network_interface.0.access_config.0.assigned_nat_ip}"]
|
||||
name = "frontend.${google_dns_managed_zone.prod.dns_name}"
|
||||
type = "A"
|
||||
ttl = 300
|
||||
|
||||
managed_zone = "${google_dns_managed_zone.prod.name}"
|
||||
|
||||
rrdatas = ["${google_compute_instance.frontend.network_interface.0.access_config.0.assigned_nat_ip}"]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -48,17 +49,23 @@ resource "google_dns_record_set" "frontend" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `managed_zone` - (Required) The name of the zone in which this record set will reside.
|
||||
* `managed_zone` - (Required) The name of the zone in which this record set will
|
||||
reside.
|
||||
|
||||
* `name` - (Required) The DNS name this record set will apply to.
|
||||
|
||||
* `type` - (Required) The DNS record set type.
|
||||
* `rrdatas` - (Required) The string data for the records in this record set
|
||||
whose meaning depends on the DNS type.
|
||||
|
||||
* `ttl` - (Required) The time-to-live of this record set (seconds).
|
||||
|
||||
* `rrdatas` - (Required) The string data for the records in this record set
|
||||
whose meaning depends on the DNS type.
|
||||
* `type` - (Required) The DNS record set type.
|
||||
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
All arguments are available as attributes.
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
|
@ -8,24 +8,26 @@ description: |-
|
|||
|
||||
# google\_pubsub\_subscripion
|
||||
|
||||
Creates a subscription in Google's pubsub queueing system. For more information see
|
||||
Creates a subscription in Google's pubsub queueing system. For more information see
|
||||
[the official documentation](https://cloud.google.com/pubsub/docs) and
|
||||
[API](https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions).
|
||||
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_pubsub_subscription" "default" {
|
||||
name = "default-subscription"
|
||||
topic = "default-topic"
|
||||
ack_deadline_seconds = 20
|
||||
push_config {
|
||||
endpoint = "https://example.com/push"
|
||||
attributes {
|
||||
x-goog-version = "v1"
|
||||
}
|
||||
name = "default-subscription"
|
||||
topic = "default-topic"
|
||||
|
||||
ack_deadline_seconds = 20
|
||||
|
||||
push_config {
|
||||
endpoint = "https://example.com/push"
|
||||
attributes {
|
||||
x-goog-version = "v1"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -39,10 +41,18 @@ The following arguments are supported:
|
|||
* `topic` - (Required) A topic to bind this subscription to, required by pubsub.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `ack_deadline_seconds` - (Optional) The maximum number of seconds a
|
||||
subscriber has to acknowledge a received message, otherwise the message is
|
||||
redelivered. Changing this forces a new resource to be created.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `push_config` - (Optional) Block configuration for push options. More
|
||||
configuration options are detailed below.
|
||||
|
||||
The optional `push_config` block supports:
|
||||
|
||||
* `push_endpoint` - (Optional) The URL of the endpoint to which messages should
|
||||
|
@ -54,3 +64,7 @@ The optional `push_config` block supports:
|
|||
delivery. For more information, read [the API docs
|
||||
here](https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions#PushConfig.FIELDS.attributes).
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
|
@ -8,16 +8,16 @@ description: |-
|
|||
|
||||
# google\_pubsub\_topic
|
||||
|
||||
Creates a topic in Google's pubsub queueing system. For more information see
|
||||
Creates a topic in Google's pubsub queueing system. For more information see
|
||||
[the official documentation](https://cloud.google.com/pubsub/docs) and
|
||||
[API](https://cloud.google.com/pubsub/reference/rest/v1/projects.topics).
|
||||
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_pubsub_topic" "default" {
|
||||
name = "default-topic"
|
||||
name = "default-topic"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -28,8 +28,11 @@ The following arguments are supported:
|
|||
* `name` - (Required) A unique name for the resource, required by pubsub.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `name` - The name of the resource.
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
|
@ -14,20 +14,19 @@ Creates a new Google SQL Database on a Google SQL Database Instance. For more in
|
|||
|
||||
Example creating a SQL Database.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_sql_database_instance" "master" {
|
||||
name = "master-instance"
|
||||
name = "master-instance"
|
||||
|
||||
settings {
|
||||
tier = "D0"
|
||||
}
|
||||
settings {
|
||||
tier = "D0"
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_sql_database" "users" {
|
||||
name = "image-store-bucket"
|
||||
instance = "${google_sql_database_instance.master.name}"
|
||||
name = "image-store-bucket"
|
||||
instance = "${google_sql_database_instance.master.name}"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
@ -38,8 +37,14 @@ The following arguments are supported:
|
|||
|
||||
* `instance` - (Required) The name of containing instance.
|
||||
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -14,13 +14,13 @@ Creates a new Google SQL Database Instance. For more information, see the [offic
|
|||
|
||||
Example creating a SQL Database.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_sql_database_instance" "master" {
|
||||
name = "master-instance"
|
||||
name = "master-instance"
|
||||
|
||||
settings {
|
||||
tier = "D0"
|
||||
}
|
||||
settings {
|
||||
tier = "D0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -28,42 +28,53 @@ resource "google_sql_database_instance" "master" {
|
|||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Optional, Computed) The name of the instance. If the name is left
|
||||
blank, Terraform will randomly generate one when the instance is first
|
||||
created. This is done because after a name is used, it cannot be reused
|
||||
for up to [two months](https://cloud.google.com/sql/docs/delete-instance).
|
||||
|
||||
* `region` - (Required) The region the instance will sit in. Note, this does
|
||||
not line up with the Google Compute Engine (GCE) regions - your options are
|
||||
`us-central`, `asia-west1`, `europe-west1`, and `us-east1`.
|
||||
not line up with the Google Compute Engine (GCE) regions - your options are
|
||||
`us-central`, `asia-west1`, `europe-west1`, and `us-east1`.
|
||||
|
||||
* `master_instance_name` - (Optional) The name of the instance that will act as
|
||||
the master in the replication setup. Note, this requires the master to have
|
||||
`binary_log_enabled` set, as well as existing backups.
|
||||
* `settings` - (Required) The settings to use for the database. The
|
||||
configuration is detailed below.
|
||||
|
||||
- - -
|
||||
|
||||
* `database_version` - (Optional, Default: `MYSQL_5_5`) The MySQL version to
|
||||
use. Can be either `MYSQL_5_5` or `MYSQL_5_6`.
|
||||
use. Can be either `MYSQL_5_5` or `MYSQL_5_6`.
|
||||
|
||||
* `name` - (Optional, Computed) The name of the instance. If the name is left
|
||||
blank, Terraform will randomly generate one when the instance is first
|
||||
created. This is done because after a name is used, it cannot be reused for
|
||||
up to [two months](https://cloud.google.com/sql/docs/delete-instance).
|
||||
|
||||
* `master_instance_name` - (Optional) The name of the instance that will act as
|
||||
the master in the replication setup. Note, this requires the master to have
|
||||
`binary_log_enabled` set, as well as existing backups.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `replica_configuration` - (Optional) The configuration for replication. The
|
||||
configuration is detailed below.
|
||||
|
||||
The required `settings` block supports:
|
||||
|
||||
* `tier` - (Required) The machine tier to use. See
|
||||
[pricing](https://cloud.google.com/sql/pricing) for more details and
|
||||
supported versions.
|
||||
[pricing](https://cloud.google.com/sql/pricing) for more details and
|
||||
supported versions.
|
||||
|
||||
* `activation_policy` - (Optional) This specifies when the instance should be
|
||||
active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
|
||||
active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
|
||||
|
||||
* `authorized_gae_applications` - (Optional) A list of Google App Engine (GAE) project names that
|
||||
are allowed to access this instance.
|
||||
* `authorized_gae_applications` - (Optional) A list of Google App Engine (GAE)
|
||||
project names that are allowed to access this instance.
|
||||
|
||||
* `crash_safe_replication` - (Optional) Specific to read instances, indicates
|
||||
when crash-safe replication flags are enabled.
|
||||
when crash-safe replication flags are enabled.
|
||||
|
||||
* `pricing_plan` - (Optional) Pricing plan for this instance, can be one of
|
||||
`PER_USE` or `PACKAGE`.
|
||||
`PER_USE` or `PACKAGE`.
|
||||
|
||||
* `replication_type` - (Optional) Replication type for this instance, can be one of
|
||||
`ASYNCHRONOUS` or `SYNCHRONOUS`.
|
||||
* `replication_type` - (Optional) Replication type for this instance, can be one
|
||||
of `ASYNCHRONOUS` or `SYNCHRONOUS`.
|
||||
|
||||
The optional `settings.database_flags` sublist supports:
|
||||
|
||||
|
@ -74,61 +85,60 @@ The optional `settings.database_flags` sublist supports:
|
|||
The optional `settings.backup_configuration` subblock supports:
|
||||
|
||||
* `binary_log_enabled` - (Optional) True iff binary logging is enabled. If
|
||||
`logging` is false, this must be as well.
|
||||
`logging` is false, this must be as well.
|
||||
|
||||
* `enabled` - (Optional) True iff backup configuration is enabled.
|
||||
|
||||
* `start_time` - (Optional) `HH:MM` format time indicating when backup
|
||||
configuration starts.
|
||||
configuration starts.
|
||||
|
||||
The optional `settings.ip_configuration` subblock supports:
|
||||
|
||||
* `ipv4_enabled` - (Optional) True iff the instance should be assigned an IP
|
||||
address.
|
||||
address.
|
||||
|
||||
* `require_ssl` - (Optional) True iff mysqld should default to `REQUIRE X509`
|
||||
for users connecting over IP.
|
||||
for users connecting over IP.
|
||||
|
||||
The optional `settings.ip_configuration.authorized_networks[]` sublist supports:
|
||||
|
||||
* `expiration_time` - (Optional) The [RFC
|
||||
3339](https://tools.ietf.org/html/rfc3339) formatted date time string
|
||||
indicating when this whitelist expires.
|
||||
* `expiration_time` - (Optional) The [RFC 3339](https://tools.ietf.org/html/rfc3339)
|
||||
formatted date time string indicating when this whitelist expires.
|
||||
|
||||
* `name` - (Optional) A name for this whitelist entry.
|
||||
|
||||
* `value` - (Optional) A CIDR notation IPv4 or IPv6 address that is allowed to
|
||||
access this instance. Must be set even if other two attributes are not for
|
||||
the whitelist to become active.
|
||||
access this instance. Must be set even if other two attributes are not for
|
||||
the whitelist to become active.
|
||||
|
||||
The optional `settings.location_preference` subblock supports:
|
||||
|
||||
* `follow_gae_application` - (Optional) A GAE application whose zone to remain
|
||||
in. Must be in the same region as this instance.
|
||||
in. Must be in the same region as this instance.
|
||||
|
||||
* `zone` - (Optional) The preferred compute engine
|
||||
[zone](https://cloud.google.com/compute/docs/zones?hl=en).
|
||||
[zone](https://cloud.google.com/compute/docs/zones?hl=en).
|
||||
|
||||
The optional `replica_configuration` block must have
|
||||
`master_instance_name` set to work, cannot be updated, and supports:
|
||||
The optional `replica_configuration` block must have `master_instance_name` set
|
||||
to work, cannot be updated, and supports:
|
||||
|
||||
* `ca_certificate` - (Optional) PEM representation of the trusted CA's x509
|
||||
certificate.
|
||||
certificate.
|
||||
|
||||
* `client_certificate` - (Optional) PEM representation of the slave's x509
|
||||
certificate.
|
||||
certificate.
|
||||
|
||||
* `client_key` - (Optional) PEM representation of the slave's private key.
|
||||
The corresponding public key in encoded in the `client_certificate`.
|
||||
* `client_key` - (Optional) PEM representation of the slave's private key. The
|
||||
corresponding public key in encoded in the `client_certificate`.
|
||||
|
||||
* `connect_retry_interval` - (Optional, Default: 60) The number of seconds
|
||||
between connect retries.
|
||||
between connect retries.
|
||||
|
||||
* `dump_file_path` - (Optional) Path to a SQL file in GCS from which slave
|
||||
instances are created. Format is `gs://bucket/filename`.
|
||||
instances are created. Format is `gs://bucket/filename`.
|
||||
|
||||
* `master_heartbeat_period` - (Optional) Time in ms between replication
|
||||
heartbeats.
|
||||
heartbeats.
|
||||
|
||||
* `password` - (Optional) Password for the replication connection.
|
||||
|
||||
|
@ -137,22 +147,19 @@ The optional `replica_configuration` block must have
|
|||
* `username` - (Optional) Username for replication connection.
|
||||
|
||||
* `verify_server_certificate` - (Optional) True iff the master's common name
|
||||
value is checked during the SSL handshake.
|
||||
value is checked during the SSL handshake.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `ip_address.ip_address` - The IPv4 address assigned.
|
||||
|
||||
* `ip_address.time_to_retire` - The time this IP address will be retired, in RFC
|
||||
3339 format.
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
||||
The `settings` block exports:
|
||||
|
||||
* `version` - Used to make sure changes to the `settings` block are atomic.
|
||||
|
||||
The `ip_address` block exports a list of IPv4 addresses assigned to this
|
||||
instance, with the following properties:
|
||||
|
||||
* `ip_address` - The IPv4 address assigned.
|
||||
|
||||
* `time_to_retire` - The time this IP address will be retired, in RFC 3339
|
||||
format.
|
||||
* `settings.version` - Used to make sure changes to the `settings` block are
|
||||
atomic.
|
||||
|
|
|
@ -14,34 +14,42 @@ Creates a new Google SQL User on a Google SQL User Instance. For more informatio
|
|||
|
||||
Example creating a SQL User.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_sql_database_instance" "master" {
|
||||
name = "master-instance"
|
||||
name = "master-instance"
|
||||
|
||||
settings {
|
||||
tier = "D0"
|
||||
}
|
||||
settings {
|
||||
tier = "D0"
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_sql_user" "users" {
|
||||
name = "me"
|
||||
instance = "${google_sql_database_instance.master.name}"
|
||||
host = "me.com"
|
||||
name = "me"
|
||||
instance = "${google_sql_database_instance.master.name}"
|
||||
host = "me.com"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) The name of the user.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `host` - (Required) The host the user can connect from. Can be an IP address.
|
||||
Changing this forces a new resource to be created.
|
||||
Changing this forces a new resource to be created.
|
||||
|
||||
* `instance` - (Required) The name of the Cloud SQL instance. Changing this
|
||||
forces a new resource to be created.
|
||||
|
||||
* `name` - (Required) The name of the user. Changing this forces a new resource
|
||||
to be created.
|
||||
|
||||
* `password` - (Required) The users password. Can be updated.
|
||||
|
||||
* `instance` - (Required) The name of the Cloud SQL instance.
|
||||
Changing this forces a new resource to be created.
|
||||
- - -
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
|
@ -15,16 +15,16 @@ Creates a new bucket in Google cloud storage service(GCS). Currently, it will no
|
|||
|
||||
Example creating a private bucket in standard storage, in the EU region.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_storage_bucket" "image-store" {
|
||||
name = "image-store-bucket"
|
||||
location = "EU"
|
||||
website {
|
||||
main_page_suffix = "index.html"
|
||||
not_found_page = "404.html"
|
||||
}
|
||||
}
|
||||
name = "image-store-bucket"
|
||||
location = "EU"
|
||||
|
||||
website {
|
||||
main_page_suffix = "index.html"
|
||||
not_found_page = "404.html"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
@ -32,18 +32,35 @@ resource "google_storage_bucket" "image-store" {
|
|||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) The name of the bucket.
|
||||
|
||||
- - -
|
||||
|
||||
* `force_destroy` - (Optional, Default: false) When deleting a bucket, this
|
||||
boolean option will delete all contained objects. If you try to delete a
|
||||
bucket that contains objects, Terraform will fail that run.
|
||||
|
||||
* `location` - (Optional, Default: 'US') The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
|
||||
|
||||
|
||||
* `predefined_acl` - (Optional, Deprecated) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) to apply. Please switch
|
||||
to `google_storage_bucket_acl.predefined_acl`.
|
||||
* `location` - (Optional, Default: 'US') The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
|
||||
* `force_destroy` - (Optional, Default: false) When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, Terraform will fail that run.
|
||||
|
||||
* `project` - (Optional) The project in which the resource belongs. If it
|
||||
is not provided, the provider project is used.
|
||||
|
||||
* `website` - (Optional) Configuration if the bucket acts as a website.
|
||||
|
||||
The optional `website` block supports:
|
||||
|
||||
* `main_page_suffix` - (Optional) Behaves as the bucket's directory index where missing objects are treated as potential directories.
|
||||
* `not_found_page` - (Optional) The custom object to return when a requested resource is not found.
|
||||
* `main_page_suffix` - (Optional) Behaves as the bucket's directory index where
|
||||
missing objects are treated as potential directories.
|
||||
|
||||
* `not_found_page` - (Optional) The custom object to return when a requested
|
||||
resource is not found.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `self_link` - The URI of the created resource.
|
||||
|
|
|
@ -14,23 +14,34 @@ Creates a new bucket ACL in Google cloud storage service(GCS).
|
|||
|
||||
Example creating an ACL on a bucket with one owner, and one reader.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_storage_bucket" "image-store" {
|
||||
name = "image-store-bucket"
|
||||
location = "EU"
|
||||
name = "image-store-bucket"
|
||||
location = "EU"
|
||||
}
|
||||
|
||||
resource "google_storage_bucket_acl" "image-store-acl" {
|
||||
bucket = "${google_storage_bucket.image_store.name}"
|
||||
role_entity = ["OWNER:user-my.email@gmail.com",
|
||||
"READER:group-mygroup"]
|
||||
}
|
||||
bucket = "${google_storage_bucket.image_store.name}"
|
||||
|
||||
role_entity = [
|
||||
"OWNER:user-my.email@gmail.com",
|
||||
"READER:group-mygroup",
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
* `bucket` - (Required) The name of the bucket it applies to.
|
||||
* `predefined_acl` - (Optional) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) to apply. Must be set if both `role_entity` and `default_acl` are not.
|
||||
|
||||
- - -
|
||||
|
||||
* `default_acl` - (Optional) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) to apply to future buckets. Must be set both `role_entity` and `predefined_acl` are not.
|
||||
|
||||
* `predefined_acl` - (Optional) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) to apply. Must be set if both `role_entity` and `default_acl` are not.
|
||||
|
||||
* `role_entity` - (Optional) List of role/entity pairs in the form `ROLE:entity`. See [GCS Bucket ACL documentation](https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls) for more details. Must be set if both `predefined_acl` and `default_acl` are not.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
|
@ -15,36 +15,39 @@ Creates a new object inside an exisiting bucket in Google cloud storage service
|
|||
|
||||
Example creating a public object in an existing `image-store` bucket.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_storage_bucket_object" "picture" {
|
||||
name = "butterfly01"
|
||||
source = "/images/nature/garden-tiger-moth.jpg"
|
||||
bucket = "image-store"
|
||||
name = "butterfly01"
|
||||
source = "/images/nature/garden-tiger-moth.jpg"
|
||||
bucket = "image-store"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `name` - (Required) The name of the object.
|
||||
|
||||
* `bucket` - (Required) The name of the containing bucket.
|
||||
|
||||
* `source` - (Optional) A path to the data you want to upload. Must be defined
|
||||
if `content` is not.
|
||||
* `name` - (Required) The name of the object.
|
||||
|
||||
- - -
|
||||
|
||||
* `content` - (Optional) Data as `string` to be uploaded. Must be defined if
|
||||
`source` is not.
|
||||
`source` is not.
|
||||
|
||||
* `predefined_acl` - (Optional, Deprecated) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) apply. Please switch
|
||||
to `google_storage_object_acl.predefined_acl`.
|
||||
|
||||
|
||||
* `source` - (Optional) A path to the data you want to upload. Must be defined
|
||||
if `content` is not.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `md5hash` - (Computed) Base 64 MD5 hash of the uploaded data.
|
||||
In addition to the arguments listed above, the following computed attributes are
|
||||
exported:
|
||||
|
||||
* `crc32c` - (Computed) Base 64 CRC32 hash of the uploaded data.
|
||||
|
||||
* `md5hash` - (Computed) Base 64 MD5 hash of the uploaded data.
|
||||
|
|
|
@ -14,30 +14,41 @@ Creates a new object ACL in Google cloud storage service (GCS)
|
|||
|
||||
Create an object ACL with one owner and one reader.
|
||||
|
||||
```
|
||||
```js
|
||||
resource "google_storage_bucket" "image-store" {
|
||||
name = "image-store-bucket"
|
||||
location = "EU"
|
||||
name = "image-store-bucket"
|
||||
location = "EU"
|
||||
}
|
||||
|
||||
resource "google_storage_bucket_object" "image" {
|
||||
name = "image1"
|
||||
bucket = "${google_storage_bucket.name}"
|
||||
source = "image1.jpg"
|
||||
name = "image1"
|
||||
bucket = "${google_storage_bucket.name}"
|
||||
source = "image1.jpg"
|
||||
}
|
||||
|
||||
resource "google_storage_object_acl" "image-store-acl" {
|
||||
bucket = "${google_storage_bucket.image_store.name}"
|
||||
object = "${google_storage_bucket_object.image_store.name}"
|
||||
role_entity = ["OWNER:user-my.email@gmail.com",
|
||||
"READER:group-mygroup"]
|
||||
}
|
||||
bucket = "${google_storage_bucket.image_store.name}"
|
||||
object = "${google_storage_bucket_object.image_store.name}"
|
||||
|
||||
role_entity = [
|
||||
"OWNER:user-my.email@gmail.com",
|
||||
"READER:group-mygroup",
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
* `bucket` - (Required) The name of the bucket it applies to.
|
||||
|
||||
* `object` - (Required) The name of the object it applies to.
|
||||
|
||||
- - -
|
||||
|
||||
* `predefined_acl` - (Optional) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) to apply. Must be set if `role_entity` is not.
|
||||
|
||||
* `role_entity` - (Optional) List of role/entity pairs in the form `ROLE:entity`. See [GCS Object ACL documentation](https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls) for more details. Must be set if `predefined_acl` is not.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
Only the arguments listed above are exposed as attributes.
|
||||
|
|
Loading…
Reference in New Issue