-
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: azurerm_cost_management_export_resource_group
#6131
Conversation
mbfrahry
commented
Mar 17, 2020
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.
Aside from a couple comments LGTM 👍
schedule := &costmanagement.ExportSchedule{ | ||
Recurrence: costmanagement.RecurrenceType(d.Get("recurrence_type").(string)), | ||
RecurrencePeriod: &costmanagement.ExportRecurrencePeriod{ | ||
From: &date.Time{Time: from}, | ||
To: &date.Time{Time: to}, | ||
}, | ||
Status: status, | ||
} | ||
|
||
properties := &costmanagement.ExportProperties{ | ||
Schedule: schedule, | ||
DeliveryInfo: expandExportDeliveryInfo(d.Get("delivery_info").([]interface{})), | ||
Format: costmanagement.Csv, | ||
Definition: expandExportQuery(d.Get("query").([]interface{})), | ||
} | ||
|
||
account := costmanagement.Export{ | ||
ExportProperties: properties, | ||
} |
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.
Should we consolidate this to be consistent with other resources?
schedule := &costmanagement.ExportSchedule{ | |
Recurrence: costmanagement.RecurrenceType(d.Get("recurrence_type").(string)), | |
RecurrencePeriod: &costmanagement.ExportRecurrencePeriod{ | |
From: &date.Time{Time: from}, | |
To: &date.Time{Time: to}, | |
}, | |
Status: status, | |
} | |
properties := &costmanagement.ExportProperties{ | |
Schedule: schedule, | |
DeliveryInfo: expandExportDeliveryInfo(d.Get("delivery_info").([]interface{})), | |
Format: costmanagement.Csv, | |
Definition: expandExportQuery(d.Get("query").([]interface{})), | |
} | |
account := costmanagement.Export{ | |
ExportProperties: properties, | |
} | |
schedule := | |
account := costmanagement.Export{ | |
ExportProperties: &costmanagement.ExportProperties{ | |
Schedule: &costmanagement.ExportSchedule{ | |
Recurrence: costmanagement.RecurrenceType(d.Get("recurrence_type").(string)), | |
RecurrencePeriod: &costmanagement.ExportRecurrencePeriod{ | |
From: &date.Time{Time: from}, | |
To: &date.Time{Time: to}, | |
}, | |
Status: status, | |
}, | |
DeliveryInfo: expandExportDeliveryInfo(d.Get("delivery_info").([]interface{})), | |
Format: costmanagement.Csv, | |
Definition: expandExportQuery(d.Get("query").([]interface{})), | |
}, | |
} |
|
||
id := *resp.ID | ||
// The ID is missing the prefix `/` which causes our uri parse to fail | ||
if !strings.HasPrefix(*resp.ID, "/") { |
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.
if !strings.HasPrefix(*resp.ID, "/") { | |
if !strings.HasPrefix(id, "/") { |
), | ||
}, | ||
data.ImportStep(), | ||
}, |
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.
Should we add a basic step here?
} | ||
|
||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-cmerg-%d" |
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 can just put the service here
name = "acctestRG-cmerg-%d" | |
name = "acctestRG-cm-%d" |
} | ||
|
||
resource "azurerm_cost_management_export_resource_group" "test" { | ||
name = "accrg%d" |
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.
Should we use some capitals here?
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.
Not this time. It only accepts lower case
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! |