-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add support for S3 as an AWS DMS Endpoint (target). #1685
Conversation
Hi, Awesome - when will this be released? Great stuff will be super useful |
Hi, @stack72 |
Very useful, cheers for the work! Not had the chance to test yet, resource creation was successful, however I have a couple of observations
It would be good to be able to control these or just allow the extra_connection_attributes attribute to pass these in because there are more than what you have hard coded. |
@robbruce |
Hey @robbruce
|
Thanks @altay13, I can confirm these are working. |
@radeksimko - when can this be merged in? @altay13 - any chance you can update your branch with master? Having to run from a compiled version of your code, but new features have been released |
7e962a5
to
72efec2
Compare
@radeksimko @robbruce master branch is synced and commits are squashed. |
@altay13 looks like some changes were made and so now this conflicts, are you able to re-merge again? @radeksimko its a bit unfair for a pull request to exist for so long and to expect the author to keep their code in line with upstream changes. Can this be escalated? |
Are we any closer to getting this? |
@robbruce @melvinio16 @radeksimko |
Hi everyone, what are the options that need to be set to test this?
Thanks in advance! |
In |
@bflad can you help to get this in the v1.14.0 release? |
Sorry I do not have time to look at this today before the release is cut. For those interested, we use 👍 votes on the original issue or PR comment to help with prioritization. |
@bflad I suspect that this will not get voted for that often as DMS is not a commonly used service within AWS, however S3 DMS Endpoint has been supported by AWS since the 7th March 2017. Currently the workaround is to either use this code as a patched version or to use an embedded CloudFormation template; Cloudformation supported DMS in July 2017. Can it be in v1.15.0? |
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.
Thanks @altay13 for this contribution! Can you please see my initial comments below and let me know if you have any questions or do not have time to implement the feedback?
@@ -117,6 +120,14 @@ func resourceAwsDmsEndpoint() *schema.Resource { | |||
Type: schema.TypeString, | |||
Optional: true, | |||
}, | |||
"bucket_name": { |
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.
To better match the AWS API and SDK, we should nest these attributes under a new configuration block:
"s3_settings": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"bucket_name": {
Type: schema.TypeString,
Required: true,
},
"bucket_folder": {
Type: schema.TypeString,
Optional: true,
},
},
},
This will allow us to also implement other attributes of the S3 configuration better such as compression_type
, csv_delimiter
, and csv_row_delimiter
without polluting the top attribute namespace.
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.
Good idea
Will implement it also
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.
@bflad
I have checked it. If we will implement it like this, then what should we do with extra_connection_attributes attribute? Because even if it is not like that in AWS API, but it is like this in AWS UI. Only bucket_name and folder is separated in UI.
|
||
hasChanges = true | ||
|
||
goto DONE |
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 please implement this without goto
? Even if that means duplicated code.
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.
Thanks for the feedback @bflad
Ok I will implement without goto.
Usually I also don't like goto approach, but usually as I thought it is normal in GO 👍
Will fix it and other feedback right away
d.Set("service_access_role", endpoint.S3Settings.ServiceAccessRoleArn) | ||
d.Set("bucket_folder", endpoint.S3Settings.BucketFolder) | ||
d.Set("bucket_name", endpoint.S3Settings.BucketName) | ||
d.Set("extra_connection_attributes", |
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 seems these should available attributes nested under the new s3_settings
configuration rather than creating our own attribute implementation.
`, randId, engineName, actionList) | ||
} | ||
|
||
func dmsEndpointDynamoDbConfig(randId string) string { |
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 don't we just statically assign all the dynamodb:*
and s3:*
permissions?
@altay13 @bflad Really glad this is getting some traction. The S3 connection attributes differ depending if the endpoint is a source or a target: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.S3.html Please make sure that extra connection attributes can still be passed through for anything which is not part of s3_settings |
I wonder if we should only stick to the target endpoint for S3 in this PR to keep it simple. Is that an option? @bflad I understand that both source and target endpoints are supported but
|
I created a new pull request which has some additional work on top of @altay13's existing commit. Please have a look if you have been following this PR. |
@microamp |
Sorry if I made you feel that way. It wasn't intentional at all. In my defence, I could see no indication that it was still being actively worked on. You posted a comment
23 days ago as of today. The PR was labelled as 'waiting-response' on the same day and it hasn't changed since. I also saw someone making a pull request on behalf of someone else in this project after 20 days of inactivity. Perhaps not directly comparable to this one, but I doubt he violated CoC then. I also did not steal your work. I clearly acknowledged that and kept your commit around in my pull request even though that meant additional work involved in fixing conflicts, etc. I will close my pull request. I hope this gets merged soon. |
@microamp Again, thanks for understanding. |
For what its worth, the implementation of #4447 is almost exactly what we would expect this PR to look like and had it not been closed, it was likely to be merged since it properly attributed credit to the original author and passed acceptance testing.
As a project we cannot reasonably make concessions for any implementation prior to officially released resources of the provider when they introduce potential maintenance burdens or unexpected behavior with the API. In almost all cases we prefer to follow the API implementation. Using the API implementation offers a simpler translation from other AWS SDK/CloudFormation/CLI implementations, lowering the barrier of entry for migrating between these projects or cross-referencing documentation of those projects. For reference, other AWS projects utilize S3 settings as such to follow the API:
Extra connection attributes can still be used to control configuration like |
To be honest, @bflad and @microamp, now it is already late to close the pull request and to redo the stuff what was done. If you @bflad say it is normal way and it would be merged, then I am ok with that to reopen the #4447 pull request and merge it and as if you say it is done on top of this branch. |
Many thanks to both of you for handling this professionally. I regret not asking first, and I will be more careful next time. Thanks guys. |
This has been released in version 1.18.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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. Thanks! |
As AWS added the new feature to use a S3 DMS endpoint as a target endpoint we would be happy to have it also in terraform. We at Takeaway.com are using terraform for provisioning our AWS infrastructure. Currently we are implementing the DMS for replicating the data from production slave database to Redshift and S3 as a separate task, as we want to have a backup of the data.
The feature is already tested in our environment and working in forked project.
Hope everything done in a proper way including the description.
Thanks in advance.