-
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
Various improvements to automation account & schedule (interval property for recurring) #1384
Conversation
df430d5
to
ec88b11
Compare
ec88b11
to
3ef04d6
Compare
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.
Looks good! Left some minor commentary, but nothing blocking in my opinion. 🚀
"strings" | ||
) | ||
|
||
func CaseDifference(_, old, new string, _ *schema.ResourceData) bool { |
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.
We should get this added into helper/schema 😄
"github.com/hashicorp/terraform/helper/schema" | ||
) | ||
|
||
func Rfc3339Time(_, old, new string, _ *schema.ResourceData) bool { |
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.
Ohhh this too! 👍
azurerm/helpers/validate/time.go
Outdated
"github.com/hashicorp/terraform/helper/schema" | ||
) | ||
|
||
//todo, now in terraform helper, switch over once vended, |
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.
Might be worth noting exactly what the helper is: https://godoc.org/github.com/hashicorp/terraform/helper/validation#ValidateRFC3339TimeString
@@ -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 |
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.
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 |
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.
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. |
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.
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
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 👉 [email protected]. Thanks! |
This adds an example and improves validation for automation accounts and schedules. This also adds the
interval
property toazurerm_automation_schedule
allowing for recurring automation.Fixes #463
Fixes #1127