Skip to content

Commit

Permalink
base64encode(file -> filebase64
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Apr 18, 2019
1 parent 5a50dc5 commit 66ea83a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion azurerm/data_source_batch_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.pfx"))}"
certificate = "${filebase64("testdata/batch_certificate.pfx")}"
format = "Pfx"
password = "terraform"
thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_batch_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.pfx"))}"
certificate = "${filebase64("testdata/batch_certificate.pfx")}"
format = "Pfx"
password = "terraform"
thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_api_management_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ resource "azurerm_api_management_certificate" "test" {
name = "example-cert"
api_management_name = "${azurerm_api_management.test.name}"
resource_group_name = "${azurerm_resource_group.test.name}"
data = "${base64encode(file("testdata/keyvaultcert.pfx"))}"
data = "${filebase64("testdata/keyvaultcert.pfx")}"
password = ""
}
`, rInt, location, rInt)
Expand Down
8 changes: 4 additions & 4 deletions azurerm/resource_arm_batch_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.pfx"))}"
certificate = "${filebase64("testdata/batch_certificate.pfx")}"
format = "Pfx"
password = "terraform"
thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"
Expand All @@ -155,7 +155,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.pfx"))}"
certificate = "${filebase64("testdata/batch_certificate.pfx")}"
format = "Pfx"
thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"
thumbprint_algorithm = "SHA1"
Expand All @@ -179,7 +179,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.cer"))}"
certificate = "${filebase64("testdata/batch_certificate.cer")}"
format = "Cer"
thumbprint = "312D31A79FA0CEF49C00F769AFC2B73E9F4EDF34"
thumbprint_algorithm = "SHA1"
Expand All @@ -203,7 +203,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.cer"))}"
certificate = "${filebase64("testdata/batch_certificate.cer")}"
format = "Cer"
password = "should not have a password for Cer"
thumbprint = "312D31A79FA0CEF49C00F769AFC2B73E9F4EDF34"
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_batch_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,15 +871,15 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "testcer" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.cer"))}"
certificate = "${filebase64("testdata/batch_certificate.cer")}"
format = "Cer"
thumbprint = "312d31a79fa0cef49c00f769afc2b73e9f4edf34" # deliberately using lowercase here as verification
thumbprint_algorithm = "SHA1"
}
resource "azurerm_batch_certificate" "testpfx" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("testdata/batch_certificate.pfx"))}"
certificate = "${filebase64("testdata/batch_certificate.pfx")}"
format = "Pfx"
password = "terraform"
thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/api_management_certificate.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "azurerm_api_management_certificate" "test" {
name = "example-cert"
api_management_name = "${azurerm_api_management.test.name}"
resource_group_name = "${azurerm_resource_group.test.name}"
data = "${base64encode(file("example.pfx"))}"
data = "${filebase64("example.pfx")}"
}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/batch_certificate.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("certificate.pfx"))}"
certificate = "${filebase64("certificate.pfx")}"
format = "Pfx"
password = "terraform"
thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/batch_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "azurerm_batch_account" "test" {
resource "azurerm_batch_certificate" "testcer" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
certificate = "${base64encode(file("certificate.cer"))}"
certificate = "${filebase64("certificate.cer")}"
format = "Cer"
thumbprint = "312d31a79fa0cef49c00f769afc2b73e9f4edf34"
thumbprint_algorithm = "SHA1"
Expand Down

0 comments on commit 66ea83a

Please sign in to comment.