Merge pull request #8390 from hashicorp/b-google-compute-firewall-state-migrate

provider/google: Fix panic and state migration for google_compute_firewall
This commit is contained in:
James Nugent 2016-08-23 12:11:25 +02:00 committed by GitHub
commit ebe571f0fe
1 changed files with 12 additions and 11 deletions

View File

@ -23,31 +23,32 @@ func resourceComputeFirewall() *schema.Resource {
State: schema.ImportStatePassthrough,
},
SchemaVersion: 1,
MigrateState: resourceComputeFirewallMigrateState,
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"network": &schema.Schema{
"network": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"allow": &schema.Schema{
"allow": {
Type: schema.TypeSet,
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"protocol": &schema.Schema{
"protocol": {
Type: schema.TypeString,
Required: true,
},
"ports": &schema.Schema{
"ports": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
@ -57,38 +58,38 @@ func resourceComputeFirewall() *schema.Resource {
Set: resourceComputeFirewallAllowHash,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
},
"project": &schema.Schema{
"project": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
},
"self_link": &schema.Schema{
"self_link": {
Type: schema.TypeString,
Computed: true,
},
"source_ranges": &schema.Schema{
"source_ranges": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
"source_tags": &schema.Schema{
"source_tags": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
"target_tags": &schema.Schema{
"target_tags": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},