-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New resource: Automation Account/Credential/Runbook/Schedule #257
Merged
tombuildsstuff
merged 48 commits into
hashicorp:master
from
nexogen-international:automation_resource
Sep 20, 2017
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
d80fd0e
Add automation resources: account, credential, runbook, schedule
Kemyke 6c09115
Add issue links
Kemyke 523e08e
Formatting
Kemyke 1c34e27
Fix formatting and logging
Kemyke 9bfd535
Add documentation
Kemyke b969cbb
Merge branch 'master' into automation_resource
Kemyke f607970
Merge branch 'master' into automation_resource
Kemyke c283cbf
Merge branch 'master' of https://github.com/terraform-providers/terra…
3b04f54
Fix auto-merge
9002060
Use new utils library
50fa597
Fix method name
b220c77
Minor fixes based on the review
72d53c6
Fix formatting
a4d9c38
Refactor sku as List
4d62cd9
Get UserName from CredentialProperties instead of top level property
cb9e4d9
Extend content_link schema with hash and version
7dbda41
Use properties from RunbookProperties
fe3cd90
Use TypeList instead of TypeSet
612a1a9
Add timezone to schedule
124f466
Remove unsupported interval
3b9ee8d
Remove interval from schema
1b0425b
Remove interval from docs
fe7f536
Remove first_run field and switch start_time as required field
6b2c8e1
Fix example in documentation
3c93fe6
Fix typo in documentation
90f30d5
Remove nil association
cab95de
Add validate function for start_time field
1a9e856
Fix timezone in example
789bd76
Formatting
92f5b17
Add resrouce provider registration
8bde7e8
Remove publish content link from read
79f34c5
Merge branch 'master' into automation_resource
Kemyke 97b96a3
Fix test, add expirytime, fix logging
df7f71a
Merge branch 'automation_resource' of https://github.com/nexogen-inte…
6f5ea11
Remove Computed tag
7caaa74
Check from state
8d96426
Refactor credential tests
a540b75
Fix runbook import test
13a4bdb
Refactor logic
0b5f90a
Refactor schedule tests
816e856
Add diff function for start_time
5cdc5d9
Remove ExpectNonEmptyPlan
2fe3b66
Add DiffSuppressFunc, formatting
31d14da
Merge branch 'master' into automation_resource
tombuildsstuff 69b00d6
Fixing the broken build (caused by a bad rebase)
tombuildsstuff 231c7cc
Vendoring the Azure Automation SDK
tombuildsstuff d830bca
Vendoring (plus comma)
tombuildsstuff 17a304c
Upgrading to SDK 10.3
tombuildsstuff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(as above) - can we update this to name the field which isn't set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really solve this with the
Ignore
attribute. The output of the test is the following:The
start_time
is received in UTC and that's cause the difference. Can we handle this without theExpectNonEmptyPlan
attribute?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so in that case we should be able to add a
DiffSuppressFunc
to thestart_time
field, which will cast both dates to UTC time and then check if there's any difference?