Skip to content

Commit

Permalink
rebasing again
Browse files Browse the repository at this point in the history
  • Loading branch information
Gil ISAACS committed Sep 27, 2017
1 parent 9751062 commit c9ce889
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 133 deletions.
4 changes: 0 additions & 4 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,7 @@ func (c *Config) getArmClient() (*ArmClient, error) {
agc := network.NewApplicationGatewaysClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&agc.Client)
agc.Authorizer = auth
<<<<<<< HEAD
agc.Sender = sender
=======
agc.Sender = autorest.CreateSender(withRequestLogging())
>>>>>>> made sure files are added
client.applicationGatewayClient = agc

crc := containerregistry.NewRegistriesClientWithBaseURI(endpoint, c.SubscriptionID)
Expand Down
34 changes: 4 additions & 30 deletions azurerm/resource_arm_application_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/jen20/riviera/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func resourceArmApplicationGateway() *schema.Resource {
Expand Down Expand Up @@ -712,8 +712,8 @@ func resourceArmApplicationGatewayCreate(d *schema.ResourceData, meta interface{
}

gateway := network.ApplicationGateway{
Name: azure.String(name),
Location: azure.String(location),
Name: utils.String(name),
Location: utils.String(location),
Tags: expandTags(tags),
ApplicationGatewayPropertiesFormat: &properties,
}
Expand Down Expand Up @@ -843,7 +843,7 @@ func retrieveApplicationGatewayById(ApplicationGatewayID string, meta interface{

resp, err := client.Get(resGroup, name)
if err != nil {
if responseWasNotFound(resp.Response) {
if utils.ResponseWasNotFound(resp.Response) {
return nil, false, nil
}
return nil, false, fmt.Errorf("Error making Read request on Azure ApplicationGateway %s: %+v", name, err)
Expand Down Expand Up @@ -886,8 +886,6 @@ func expandApplicationGatewayWafConfig(d *schema.ResourceData) *network.Applicat

enabled := waf["enabled"].(bool)
mode := waf["firewall_mode"].(string)
<<<<<<< HEAD
<<<<<<< HEAD
rulesettype := waf["rule_set_type"].(string)
rulesetversion := waf["rule_set_version"].(string)

Expand All @@ -896,22 +894,6 @@ func expandApplicationGatewayWafConfig(d *schema.ResourceData) *network.Applicat
FirewallMode: network.ApplicationGatewayFirewallMode(mode),
RuleSetType: &rulesettype,
RuleSetVersion: &rulesetversion,
=======

return &network.ApplicationGatewayWebApplicationFirewallConfiguration{
Enabled: &enabled,
FirewallMode: network.ApplicationGatewayFirewallMode(mode),
>>>>>>> made sure files are added
=======
rulesettype := waf["rule_set_type"].(string)
rulesetversion := waf["rule_set_version"].(string)

return &network.ApplicationGatewayWebApplicationFirewallConfiguration{
Enabled: &enabled,
FirewallMode: network.ApplicationGatewayFirewallMode(mode),
RuleSetType: &rulesettype,
RuleSetVersion: &rulesetversion,
>>>>>>> changes based on reviewer feedback
}
}

Expand Down Expand Up @@ -1368,16 +1350,8 @@ func flattenApplicationGatewayWafConfig(waf *network.ApplicationGatewayWebApplic

result["enabled"] = *waf.Enabled
result["firewall_mode"] = string(waf.FirewallMode)
<<<<<<< HEAD
<<<<<<< HEAD
result["rule_set_type"] = waf.RuleSetType
result["rule_set_version"] = waf.RuleSetVersion
=======
>>>>>>> made sure files are added
=======
result["rule_set_type"] = waf.RuleSetType
result["rule_set_version"] = waf.RuleSetVersion
>>>>>>> changes based on reviewer feedback

return []interface{}{result}
}
Expand Down
99 changes: 0 additions & 99 deletions azurerm/resource_arm_application_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import (
"github.com/hashicorp/terraform/terraform"
)

<<<<<<< HEAD
func TestAccAzureRMApplicationGateway_basic_base(t *testing.T) {
=======
func TestAccAzureRMApplicationGateway_basic(t *testing.T) {
>>>>>>> made sure files are added
ri := acctest.RandInt()

resource.Test(t, resource.TestCase{
Expand All @@ -24,11 +20,7 @@ func TestAccAzureRMApplicationGateway_basic(t *testing.T) {
CheckDestroy: testCheckAzureRMApplicationGatewayDestroy,
Steps: []resource.TestStep{
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_basic(ri),
=======
Config: TestAccAzureRMApplicationGateway_basic(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-1"),
Expand All @@ -47,23 +39,15 @@ func TestAccAzureRMApplicationGateway_basic_changeSslCert(t *testing.T) {
CheckDestroy: testCheckAzureRMApplicationGatewayDestroy,
Steps: []resource.TestStep{
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_basic(ri),
=======
Config: TestAccAzureRMApplicationGateway_basic(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-1"),
),
Destroy: false,
},
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_basic_changeSslCert(ri),
=======
Config: TestAccAzureRMApplicationGateway_basic_changeSslCert(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-2"),
Expand All @@ -82,11 +66,7 @@ func TestAccAzureRMApplicationGateway_basic_authCert(t *testing.T) {
CheckDestroy: testCheckAzureRMApplicationGatewayDestroy,
Steps: []resource.TestStep{
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_basic_authCert(ri),
=======
Config: TestAccAzureRMApplicationGateway_basic_authCert(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-1"),
Expand All @@ -106,11 +86,7 @@ func TestAccAzureRMApplicationGateway_basic_changeAuthCert(t *testing.T) {
CheckDestroy: testCheckAzureRMApplicationGatewayDestroy,
Steps: []resource.TestStep{
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_basic_authCert(ri),
=======
Config: TestAccAzureRMApplicationGateway_basic_authCert(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-1"),
Expand All @@ -119,11 +95,7 @@ func TestAccAzureRMApplicationGateway_basic_changeAuthCert(t *testing.T) {
Destroy: false,
},
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_basic_changeAuthCert(ri),
=======
Config: TestAccAzureRMApplicationGateway_basic_changeAuthCert(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-1"),
Expand All @@ -148,11 +120,7 @@ func TestAccAzureRMApplicationGateway_waf(t *testing.T) {
CheckDestroy: testCheckAzureRMApplicationGatewayDestroy,
Steps: []resource.TestStep{
{
<<<<<<< HEAD
Config: testAccAzureRMApplicationGateway_waf(ri),
=======
Config: TestAccAzureRMApplicationGateway_waf(ri),
>>>>>>> made sure files are added
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApplicationGatewayExists("azurerm_application_gateway.test"),
testCheckAzureRMApplicationGatewaySslCertificateAssigned("azurerm_application_gateway.test", "ssl-1"),
Expand All @@ -176,11 +144,7 @@ func testCheckAzureRMApplicationGatewayExists(name string) resource.TestCheckFun
return fmt.Errorf("Bad: no resource group found in state for App Gateway: %s", ApplicationGatewayName)
}

<<<<<<< HEAD
conn := testAccProvider.Meta().(*ArmClient).applicationGatewayClient
=======
conn := testAccProvider.Meta().(*ArmClient).ApplicationGatewayClient
>>>>>>> made sure files are added

resp, err := conn.Get(resourceGroup, ApplicationGatewayName)
if err != nil {
Expand Down Expand Up @@ -208,11 +172,7 @@ func testCheckAzureRMApplicationGatewaySslCertificateAssigned(name string, certN
return fmt.Errorf("Bad: no resource group found in state for App Gateway: %s", ApplicationGatewayName)
}

<<<<<<< HEAD
conn := testAccProvider.Meta().(*ArmClient).applicationGatewayClient
=======
conn := testAccProvider.Meta().(*ArmClient).ApplicationGatewayClient
>>>>>>> made sure files are added

resp, err := conn.Get(resourceGroup, ApplicationGatewayName)
if err != nil {
Expand Down Expand Up @@ -258,11 +218,7 @@ func testCheckAzureRMApplicationGatewayAuthenticationCertificateAssigned(name st
return fmt.Errorf("Bad: no resource group found in state for App Gateway: %s", ApplicationGatewayName)
}

<<<<<<< HEAD
conn := testAccProvider.Meta().(*ArmClient).applicationGatewayClient
=======
conn := testAccProvider.Meta().(*ArmClient).ApplicationGatewayClient
>>>>>>> made sure files are added

resp, err := conn.Get(resourceGroup, ApplicationGatewayName)
if err != nil {
Expand Down Expand Up @@ -300,11 +256,7 @@ func testCheckAzureRMApplicationGatewayAuthenticationCertificateAssigned(name st
}

func testCheckAzureRMApplicationGatewayDestroy(s *terraform.State) error {
<<<<<<< HEAD
conn := testAccProvider.Meta().(*ArmClient).applicationGatewayClient
=======
conn := testAccProvider.Meta().(*ArmClient).ApplicationGatewayClient
>>>>>>> made sure files are added

for _, rs := range s.RootModule().Resources {
if rs.Type != "azurerm_application_gateway" {
Expand All @@ -328,11 +280,7 @@ func testCheckAzureRMApplicationGatewayDestroy(s *terraform.State) error {
return nil
}

<<<<<<< HEAD
func testAccAzureRMApplicationGateway_basic(rInt int) string {
=======
func TestAccAzureRMApplicationGateway_basic(rInt int) string {
>>>>>>> made sure files are added
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestrg-%d"
Expand Down Expand Up @@ -504,11 +452,7 @@ resource "azurerm_application_gateway" "test" {
ssl_certificate {
# id = computed
name = "ssl-1"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.pfx")}"
=======
data = "${file("resource_arm_app_gateway_test.pfx")}"
>>>>>>> made sure files are added
password = "terraform"
}
Expand All @@ -519,11 +463,7 @@ resource "azurerm_application_gateway" "test" {
`, rInt, rInt, rInt, rInt)
}

<<<<<<< HEAD
func testAccAzureRMApplicationGateway_basic_changeSslCert(rInt int) string {
=======
func TestAccAzureRMApplicationGateway_basic_changeSslCert(rInt int) string {
>>>>>>> made sure files are added
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestrg-%d"
Expand Down Expand Up @@ -695,11 +635,7 @@ resource "azurerm_application_gateway" "test" {
ssl_certificate {
# id = computed
name = "ssl-2"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.pfx")}"
=======
data = "${file("resource_arm_app_gateway_test.pfx")}"
>>>>>>> made sure files are added
password = "terraform"
}
Expand All @@ -710,11 +646,7 @@ resource "azurerm_application_gateway" "test" {
`, rInt, rInt, rInt, rInt)
}

<<<<<<< HEAD
func testAccAzureRMApplicationGateway_basic_authCert(rInt int) string {
=======
func TestAccAzureRMApplicationGateway_basic_authCert(rInt int) string {
>>>>>>> made sure files are added
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestrg-%d"
Expand Down Expand Up @@ -898,21 +830,13 @@ resource "azurerm_application_gateway" "test" {
authentication_certificate {
name = "auth-1"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.cer")}"
=======
data = "${file("resource_arm_app_gateway_test.cer")}"
>>>>>>> made sure files are added
}
ssl_certificate {
# id = computed
name = "ssl-1"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.pfx")}"
=======
data = "${file("resource_arm_app_gateway_test.pfx")}"
>>>>>>> made sure files are added
password = "terraform"
}
Expand All @@ -923,11 +847,7 @@ resource "azurerm_application_gateway" "test" {
`, rInt, rInt, rInt, rInt)
}

<<<<<<< HEAD
func testAccAzureRMApplicationGateway_basic_changeAuthCert(rInt int) string {
=======
func TestAccAzureRMApplicationGateway_basic_changeAuthCert(rInt int) string {
>>>>>>> made sure files are added
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestrg-%d"
Expand Down Expand Up @@ -1111,21 +1031,13 @@ resource "azurerm_application_gateway" "test" {
authentication_certificate {
name = "auth-2"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.cer")}"
=======
data = "${file("resource_arm_app_gateway_test.cer")}"
>>>>>>> made sure files are added
}
ssl_certificate {
# id = computed
name = "ssl-1"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.pfx")}"
=======
data = "${file("resource_arm_app_gateway_test.pfx")}"
>>>>>>> made sure files are added
password = "terraform"
}
Expand All @@ -1136,11 +1048,7 @@ resource "azurerm_application_gateway" "test" {
`, rInt, rInt, rInt, rInt)
}

<<<<<<< HEAD
func testAccAzureRMApplicationGateway_waf(rInt int) string {
=======
func TestAccAzureRMApplicationGateway_waf(rInt int) string {
>>>>>>> made sure files are added
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestrg-%d"
Expand Down Expand Up @@ -1186,11 +1094,8 @@ resource "azurerm_application_gateway" "test" {
waf_configuration {
enabled = "true"
firewall_mode = "Detection"
<<<<<<< HEAD
rule_set_type = "OWASP"
rule_set_version = "3.0"
=======
>>>>>>> made sure files are added
}
gateway_ip_configuration {
Expand Down Expand Up @@ -1322,11 +1227,7 @@ resource "azurerm_application_gateway" "test" {
ssl_certificate {
# id = computed
name = "ssl-1"
<<<<<<< HEAD
data = "${file("resource_arm_application_gateway_test.pfx")}"
=======
data = "${file("resource_arm_app_gateway_test.pfx")}"
>>>>>>> made sure files are added
password = "terraform"
}
Expand Down

0 comments on commit c9ce889

Please sign in to comment.