-
Notifications
You must be signed in to change notification settings - Fork 190
AWS and AZURE Private Endpoints (INTMDB-123 & INTMDB-124) #349
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
It's looking good, just fix the linting |
@leofigy and @coderGo93 I'm concerned with how the deprecation is being performed here, it seems to be simply a rename of the existing resource and creating a new one, this gives no time for existing AWS privatelink users to transition from the old resource/datasource to the new (i.e. following https://www.terraform.io/docs/extend/best-practices/deprecations.html#provider-data-source-or-resource-removal) Am I mis-understanding? |
Thanks for the eye, @themantissa , forgot to add that deprecate messages, will do that |
Hi @leofigy , just made changes with renamed after discussing with @themantissa , did testing about importing with new resource from old resource and it works for me |
LGTM |
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.
Some minor changes but I think over all looks really good!
@@ -0,0 +1,81 @@ | |||
# Example - Microsoft Azure and MongoDB Atlas Private Endpoint |
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.
Well this is surprising! We have had some internal team members adding examples and while this is useful was not technically in scope for the ticket. We can do more of these during development if we are able to get more hours and if we do the actual addition work first and then add the example. For now I do want to recognize that you saw what we've been doing and followed the example and I truly applaud and appreciate that but please try to keep in the scoped work till we can add on time for example generation :)
endpoint_service_id = mongodbatlas_private_endpoint.test.private_link_id | ||
private_endpoint_ip_address = azurerm_private_endpoint.test.private_service_connection.0.private_ip_address | ||
provider_name = "AZURE" | ||
} |
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.
There's a couple of files giving the no newline warning so please add - some linters will pick those up
@@ -42,6 +42,7 @@ func dataSourceMongoDBAtlasPrivateEndpointInterfaceLink() *schema.Resource { | |||
Computed: true, | |||
}, | |||
}, | |||
DeprecationMessage: "use mongodbatlas_privatelink_endpoint_service datasource instead", |
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.
Let's expand this a bit:
"this data source is deprecated, please transition as soon as possible to mongodbatlas_privatelink_endpoint_service",
@@ -43,6 +43,7 @@ func dataSourceMongoDBAtlasPrivateEndpoint() *schema.Resource { | |||
Computed: true, | |||
}, | |||
}, | |||
DeprecationMessage: "use mongodbatlas_privatelink_endpoint datasource instead", |
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.
Expanding out a bit "this data source is deprecated, please transition as soon as possible to mongodbatlas_privatelink_endpoint_service",
@@ -71,19 +71,20 @@ func resourceMongoDBAtlasPrivateEndpoint() *schema.Resource { | |||
Computed: true, | |||
}, | |||
}, | |||
DeprecationMessage: "use mongodbatlas_privatelink_endpoint resource instead", |
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 resource is deprecated, please transition as soon as possible to mongodbatlas_privatelink_endpoint",
* `provider_name` - (Required) Cloud provider for which you want to retrieve a private endpoint service. Atlas accepts `AWS` or `AZURE`. | ||
|
||
|
||
## Attributes Reference |
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 think this may be missing the Azure attributes (there are two tabs in the api docs, one with AWS and one with azure)
* `project_id` - Required Unique identifier for the project. | ||
* `providerName` - (Required) Name of the cloud provider for which you want to create the private endpoint service. Atlas accepts `AWS` or `AZURE`. | ||
* `region` - (Required) Cloud provider region in which you want to create the private endpoint connection. | ||
Accepted values are: |
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 have had a hard time keeping these updated so please just link to the api doc for these, for example:
Updated accepted values can found in the main API documentation: MongoDB API Private Endpoint Service
* `provider_name` - (Required) Cloud provider for which you want to create a private endpoint. Atlas accepts `AWS` or `AZURE`. | ||
* `private_endpoint_ip_address` - (Optional) Private IP address of the private endpoint network interface you created in your Azure VNet. Only for `AZURE`. | ||
|
||
## Attributes Reference |
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.
Need to be sure to include which are for AWS and which for Azure.
@coderGo93 can you share with me the steps to you did to move from old to new in your test and I'll write up a guide. @shum added you to just give it a look since you were close to this one. |
Hi @themantissa , for steps to import from old to new are like this: For PrivateLink Endpoint can be read in README.md
For PrivateLink Endpoint Service
NOTE: Provider name for both resources are case sensitive. Once done it should appear the info of imported resource with |
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 - thanks @coderGo93 for the fixes. Let's just have @shum take a quick look and we are good.
@coderGo93 but you first need to remove them from terraform state with the old resource, correct? and thanks for including here. |
@themantissa That's correct, you need to remove first the terraform state otherwise it will say it already has info or something like that IIRC |
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.
Generally LGTM. A few comments. Will review again after Thanksgiving!
} | ||
|
||
variable "subscription_id" { | ||
default = "AZURE SUSCRIPTION 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.
default = "AZURE SUSCRIPTION ID" | |
default = "AZURE SUBSCRIPTION ID" |
errorGetRead = "error reading cloud provider access %s" | ||
) | ||
|
||
func dataSourceMongoDBAtlasCloudProviderAccessList() *schema.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.
This reads like it would have been a part of INTMDB-131 - is this intentional?
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 it? @leofigy
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.
It's weird, I did a PR but it was to grab your changes into my branch #353, because I needed your changes because you changed the client. I did a commit right now to remove the provider access files
|
||
const ( | ||
errorCloudProviderAccessCreate = "error creating cloud provider access %s" | ||
errorCloudProviderAccessUpdate = "error update cloud provider access %s" |
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.
errorCloudProviderAccessUpdate = "error update cloud provider access %s" | |
errorCloudProviderAccessUpdate = "error updating cloud provider access %s" |
const ( | ||
errorCloudProviderAccessCreate = "error creating cloud provider access %s" | ||
errorCloudProviderAccessUpdate = "error update cloud provider access %s" | ||
errorCloudProviderAccessDelete = "error delete cloud provider access %s" |
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.
errorCloudProviderAccessDelete = "error delete cloud provider access %s" | |
errorCloudProviderAccessDelete = "error deleting cloud provider access %s" |
errorCloudProviderAccessCreate = "error creating cloud provider access %s" | ||
errorCloudProviderAccessUpdate = "error update cloud provider access %s" | ||
errorCloudProviderAccessDelete = "error delete cloud provider access %s" | ||
errorCloudProviderAccessImporter = "error in import for cloud provider access %s" |
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.
errorCloudProviderAccessImporter = "error in import for cloud provider access %s" | |
errorCloudProviderAccessImporter = "error importing cloud provider access %s" |
errorCloudProviderAccessImporter = "error in import for cloud provider access %s" | ||
) | ||
|
||
func resourceMongoDBAtlasCloudProviderAccess() *schema.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.
This again, looks like INTMDB-131 - intentional? I will ignore for now.
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.
Actually, I don't have any blocking comments on the actual private endpoint changes. If we can remove the cloud_provider_access
files, I think we're good to go.
…ider-mongodbatlas into private-endpoints
Description
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments