Skip to content
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

Various improvements to automation account & schedule (interval property for recurring) #1384

Merged
merged 6 commits into from
Jun 15, 2018

Conversation

katbyte
Copy link
Collaborator

@katbyte katbyte commented Jun 13, 2018

This adds an example and improves validation for automation accounts and schedules. This also adds the interval property to azurerm_automation_schedule allowing for recurring automation.

Fixes #463
Fixes #1127

@katbyte katbyte added this to the 1.7.0 milestone Jun 13, 2018
@katbyte katbyte changed the title Various improvements to automation account & schedule (interval property for recurring) [WIP] Various improvements to automation account & schedule (interval property for recurring) Jun 13, 2018
@katbyte katbyte changed the title [WIP] Various improvements to automation account & schedule (interval property for recurring) Various improvements to automation account & schedule (interval property for recurring) Jun 15, 2018
@katbyte katbyte requested a review from a team June 15, 2018 07:13
@katbyte katbyte force-pushed the b-automation_schedule_interval branch 2 times, most recently from df430d5 to ec88b11 Compare June 15, 2018 07:16
@katbyte
Copy link
Collaborator Author

katbyte commented Jun 15, 2018

Tests pass:
screen shot 2018-06-15 at 00 27 42

@katbyte katbyte force-pushed the b-automation_schedule_interval branch from ec88b11 to 3ef04d6 Compare June 15, 2018 07:28
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Left some minor commentary, but nothing blocking in my opinion. 🚀

"strings"
)

func CaseDifference(_, old, new string, _ *schema.ResourceData) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get this added into helper/schema 😄

"github.com/hashicorp/terraform/helper/schema"
)

func Rfc3339Time(_, old, new string, _ *schema.ResourceData) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh this too! 👍

"github.com/hashicorp/terraform/helper/schema"
)

//todo, now in terraform helper, switch over once vended,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -25,6 +27,11 @@ func resourceArmAutomationAccount() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(
//todo this will not allow single character names, even thou they are valid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just wrap the part after the first character with (...)?

regexp.MustCompile(`^[0-9a-zA-Z]([-0-9a-zA-Z]{0,48}[0-9a-zA-Z])?$`),

resourceName := "azurerm_automation_schedule.test"
ri := acctest.RandInt()

//the API returns the time in the timezone we pass in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these comments!

@@ -46,17 +47,19 @@ The following arguments are supported:

* `resource_group_name` - (Required) The name of the resource group in which the Schedule is created. Changing this forces a new resource to be created.

* `account_name` - (Required) The name of the automation account in which the Schedule is created. Changing this forces a new resource to be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we do not have versioned documentation at the moment, not sure if we should leave the old argument documented with deprecated and noting the new name to reduce any confusion

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants