-
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.
New resource: Automation Account/Credential/Runbook/Schedule (#257)
* Add automation resources: account, credential, runbook, schedule * Add issue links * Formatting * Fix formatting and logging * Add documentation * Fix auto-merge * Use new utils library * Fix method name * Minor fixes based on the review * Fix formatting * Refactor sku as List Remove name AccountCreateOrUpdateProperties * Get UserName from CredentialProperties instead of top level property * Extend content_link schema with hash and version * Use properties from RunbookProperties * Use TypeList instead of TypeSet * Add timezone to schedule * Remove unsupported interval * Remove interval from schema * Remove interval from docs * Remove first_run field and switch start_time as required field * Fix example in documentation * Fix typo in documentation * Remove nil association * Add validate function for start_time field * Fix timezone in example * Formatting * Add resrouce provider registration * Remove publish content link from read * Fix test, add expirytime, fix logging * Remove Computed tag * Check from state * Refactor credential tests * Fix runbook import test * Refactor logic * Refactor schedule tests * Add diff function for start_time * Remove ExpectNonEmptyPlan * Add DiffSuppressFunc, formatting * Fixing the broken build (caused by a bad rebase) Also swapping the re-initialisation of `sender` to use the shared variable * Vendoring the Azure Automation SDK * Vendoring (plus comma) * Upgrading to SDK 10.3
- Loading branch information
1 parent
3e78d8d
commit 97bcbc5
Showing
51 changed files
with
14,046 additions
and
2 deletions.
There are no files selected for viewing
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
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,56 @@ | ||
package azurerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAzureRMAutomationAccount_importAccountWithFreeSku(t *testing.T) { | ||
resourceName := "azurerm_automation_account.test" | ||
|
||
ri := acctest.RandInt() | ||
config := testAccAzureRMAutomationAccount_skuFree(ri, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMAutomationAccountDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
|
||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMAutomationAccount_importAccountWithBasicSku(t *testing.T) { | ||
resourceName := "azurerm_automation_account.test" | ||
|
||
ri := acctest.RandInt() | ||
config := testAccAzureRMAutomationAccount_skuBasic(ri, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMAutomationAccountDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
|
||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} |
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,33 @@ | ||
package azurerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAzureRMAutomationCredential_importCredential(t *testing.T) { | ||
resourceName := "azurerm_automation_credential.test" | ||
|
||
ri := acctest.RandInt() | ||
config := testAccAzureRMAutomationCredential_complete(ri, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMAutomationCredentialDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
|
||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"password"}, | ||
}, | ||
}, | ||
}) | ||
} |
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,33 @@ | ||
package azurerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAzureRMAutomationRunbook_importRunbookPSWorkflow(t *testing.T) { | ||
resourceName := "azurerm_automation_runbook.test" | ||
|
||
ri := acctest.RandInt() | ||
config := testAccAzureRMAutomationRunbook_PSWorkflow(ri, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMAutomationRunbookDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
|
||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"publish_content_link"}, | ||
}, | ||
}, | ||
}) | ||
} |
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,32 @@ | ||
package azurerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAzureRMAutomationSchedule_importScheduleOneTime(t *testing.T) { | ||
resourceName := "azurerm_automation_schedule.test" | ||
|
||
ri := acctest.RandInt() | ||
config := testAccAzureRMAutomationSchedule_oneTime(ri, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMAutomationScheduleDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
|
||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} |
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.