-
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 data source: azurerm_dynatrace_monitor
#28381
base: main
Are you sure you want to change the base?
Conversation
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.
Hi @jiaweitao001 - Thanks for the PR. Some comments to take a look at below if you could please?
"environment_properties": { | ||
Type: pluginsdk.TypeList, | ||
Computed: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"environment_info": { | ||
Type: pluginsdk.TypeList, | ||
Computed: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"environment_id": { | ||
Type: pluginsdk.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, |
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.
Is there a reason we're doing 2 levels of nesting here for a single value? Can this just be flattened to the top level?
Also, this property doesn't appear to be supported by the related resource, should it even be included 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.
We'd better not flatten this because according to the service team, there are a bunch of other attributes under environment_properties
and environment_info
, but they do not want them on TF right now. We will have to onboard them once they request in the future.
This property is not supported by the related resource is because it's an optional + computed attribute and its value comes from the API response only, that's why we will have to onboard the data source first. Then I'll add it to the related resource.
Identity: identityProps, | ||
EnvironmentProperties: FlattenDynatraceEnvironmentProperties(props.DynatraceEnvironmentProperties), | ||
PlanData: FlattenDynatracePlanData(props.PlanData), | ||
UserInfo: FlattenDynatraceUserInfo(metadata.ResourceData.Get("user").([]interface{})), |
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.
This is computed only, so we cannot "Get" it here, if this is not returned by the API, it cannot be included in the Data Source as it will always be empty.
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.
Will fix.
first_name = "Alice" | ||
last_name = "Bobab" | ||
email = "[email protected]" | ||
phone_number = "123456" | ||
country = "westus" |
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.
Why are we now supplying data directly here? This looks like it might actually be a real email (or could be in future?) Is this a mistake from local testing that should be removed?
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.
Right, it was for local testing, will remove them.
|
||
--- | ||
|
||
A `user` block supports the following: |
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.
and here
A `user` block supports the following: | |
A `user` block exports the following: |
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.
Will fix.
|
||
--- | ||
|
||
A `plan` block supports the following: |
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.
same here
A `plan` block supports the following: | |
A `plan` block exports the following: |
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.
Will fix.
|
||
--- | ||
|
||
A `identity` block supports the following: |
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 this block is computed only, it's exports rather than supports.
A `identity` block supports the following: | |
An `identity` block exports the following: |
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.
Will fix.
|
||
A `identity` block supports the following: | ||
|
||
* `type` - The type of identity used for the resource. Only possible value is `SystemAssigned`. |
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 this is computed only, we don't specify possible values.
* `type` - The type of identity used for the resource. Only possible value is `SystemAssigned`. | |
* `type` - The type of identity used for the resource. |
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.
Will fix.
Community Note
Description
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.