-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Locking on the Firewall Name - Handling resources being deleted outside of Terraform - Removing some crash points - Making the Protocol and Action type case-sensitive - Refactoring the virtual resource to allow for - Parsing the ID rather than using the config for the delete and read functions (so delete's are successful when the config's gone) - Rewriting some of the tests for the Network Rule Collections, to check the resource's state rather than the object - Updating the documentation (and including Import support for Network Rule Collections)
- Loading branch information
1 parent
7355277
commit a25e3d1
Showing
8 changed files
with
770 additions
and
590 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package azure | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" | ||
) | ||
|
||
// The API requires InternalPublicIPAddress to be set when for a CreateOrUpdate | ||
// operation, but Get operations return the property as PublicIPAddress | ||
// so we need to go through and copy the value to the correct property. | ||
func FixFirewallIPConfiguration(input *[]network.AzureFirewallIPConfiguration) (*[]network.AzureFirewallIPConfiguration, error) { | ||
if input == nil { | ||
return nil, fmt.Errorf("`input` was nil") | ||
} | ||
|
||
results := make([]network.AzureFirewallIPConfiguration, 0) | ||
for _, config := range *input { | ||
if config.Subnet == nil || config.Subnet.ID == nil { | ||
return nil, fmt.Errorf("`config.Subnet.ID` was nil") | ||
} | ||
|
||
if config.PublicIPAddress == nil || config.PublicIPAddress.ID == nil { | ||
return nil, fmt.Errorf("`config.PublicIPAddress.ID` was nil") | ||
} | ||
|
||
result := network.AzureFirewallIPConfiguration{ | ||
Name: config.Name, | ||
AzureFirewallIPConfigurationPropertiesFormat: &network.AzureFirewallIPConfigurationPropertiesFormat{ | ||
Subnet: &network.SubResource{ | ||
ID: config.Subnet.ID, | ||
}, | ||
InternalPublicIPAddress: &network.SubResource{ | ||
ID: config.PublicIPAddress.ID, | ||
}, | ||
}, | ||
} | ||
results = append(results, result) | ||
} | ||
|
||
return &results, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.