-
Notifications
You must be signed in to change notification settings - Fork 190
INTMDB-185: Added parameter regions for GCP network container #418
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
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.
LGTM - needs DOU review and good to merge. Thank you!
@@ -61,6 +61,13 @@ func dataSourceMongoDBAtlasNetworkContainer() *schema.Resource { | |||
Type: schema.TypeString, | |||
Computed: true, | |||
}, | |||
"regions": { |
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 know it's a data source but question, this will returned by all the types ?
@@ -124,6 +131,10 @@ func dataSourceMongoDBAtlasNetworkContainerRead(d *schema.ResourceData, meta int | |||
return fmt.Errorf("error setting `vnet_name` for Network Container (%s): %s", d.Id(), err) | |||
} | |||
|
|||
if err = d.Set("regions", container.Regions); err != nil { |
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 mean , if it's azure, aws or gcp, the api returns always the regions field? (even 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.
No, if not using, it will not appear in response neither in state, for now it can be only used for gcp, for azure is the singular region
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.
yea, I see the client code, curious do we get any warning, because moving from nil to empty type?
Regions []string json:"regions,omitempty"
// Regions are available for GCP
@@ -70,6 +70,13 @@ func dataSourceMongoDBAtlasNetworkContainers() *schema.Resource { | |||
Type: schema.TypeString, | |||
Computed: true, | |||
}, | |||
"regions": { |
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
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.
LGTM just confirm the regions field is not affected in the set for azure or gcp.
And do a negative testing , create an azure and set the regions field.
I know it's late , but all these fields with the same names ,
region, region_name, regions is really confusing
would not be better to have like an gcp_regions , or subobject for
gcp {
regions = []
}
You can put regions using azure but it will not send in request because it's validated to only in gcp like azure with region or aws with region_name in create function, also if you do that you could get an update-in-change behavior in the re apply. |
Description
regions
for GCP in resource/datasource(s) of network containerTestAccResourceMongoDBAtlasNetworkContainer_WithRegionsGCP
TestAccDataSourceMongoDBAtlasNetworkContainer_WithGCPRegions
TestAccDataSourceMongoDBAtlasNetworkContainer_WithGCPRegions
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments
Before the atlas client should be released first so I can updated the go.mod with official tag instead of auto generated with
go get