Skip to content
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 a DMS target endpoint #4447

Merged
merged 3 commits into from
May 7, 2018

Conversation

microamp
Copy link
Contributor

@microamp microamp commented May 4, 2018

This is a port of #1685 by @altay13 with suggested changes from the pull request. (The PR hasn't been active lately and had many conflicts to resolve, so I decided to work on it. Hope I'm not stepping on someone's toes.)

Notes:

  • bucket_name and bucket_folder were removed from the top-level attribute namespace. They are now available under s3_settings. This is consistent with how the MongoDB endpoint is implemented which follows the convention as seen in the output of aws dms create-endpoint --generate-cli-skeleton (see below).
{
  ...
  "DynamoDbSettings": {
    "ServiceAccessRoleArn": "",
  },
  "S3Settings": {
    "ServiceAccessRoleArn": "",
    "ExternalTableDefinition": "",
    "CsvRowDelimiter": "",
    "CsvDelimiter": "",
    "BucketFolder": "",
    "BucketName": "",
    "CompressionType": "none"
  },
  "MongoDbSettings": {
    ...
  }
}
  • The existing service_access_role attribute shouldn't be reused as there is now service_access_role_arn under s3_settings. I suggest moving service_access_role to dynamodb_settings (currently missing) in the future and remove it from the top-level namespace.
  • Helper functions (dmsEndpointTargetUpdateConfig and dmsEndpointTargetUpdateConfigUpdate) were removed from the test suite, to keep each endpoint test completely independent of each other despite some repetitions in the config strings.
  • Conflicts were resolved in the merge commit below in order to keep the original work alive (instead of rebased).
  • This PR is for target endpoint only. Currently, dms.S3Settings provides fields for target endpoint only. See https://github.com/microamp/terraform-provider-aws/blob/dms-target-endpoint-s3/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go#L10558-L10587 for more details.
    • Setting up source endpoint attributes is possible via extra_connection_attributes, but that has not been tested as part of this work.
  • All acceptance tests for DMS endpoint continue to pass.
$ make testacc TEST=./aws TESTARGS='-run=TestAccAwsDmsEndpoint'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAwsDmsEndpoint -timeout 120m
=== RUN   TestAccAwsDmsEndpointBasic
--- PASS: TestAccAwsDmsEndpointBasic (65.44s)
=== RUN   TestAccAwsDmsEndpointS3
--- PASS: TestAccAwsDmsEndpointS3 (143.07s)
=== RUN   TestAccAwsDmsEndpointDynamoDb
--- PASS: TestAccAwsDmsEndpointDynamoDb (79.62s)
=== RUN   TestAccAwsDmsEndpointMongoDb
--- PASS: TestAccAwsDmsEndpointMongoDb (60.60s)
PASS
ok     github.com/microamp/terraform-provider-aws/aws 348.744s

Thanks, please let me know if I missed anything.

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label May 4, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/databasemigrationservice labels May 4, 2018
@microamp microamp closed this May 6, 2018
@bflad bflad reopened this May 7, 2018
@bflad bflad added this to the v1.18.0 milestone May 7, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulling this in -- thanks for @altay13 and @microamp for their work here 🚀

4 tests passed (all tests)
=== RUN   TestAccAwsDmsEndpointBasic
--- PASS: TestAccAwsDmsEndpointBasic (13.15s)
=== RUN   TestAccAwsDmsEndpointMongoDb
--- PASS: TestAccAwsDmsEndpointMongoDb (13.14s)
=== RUN   TestAccAwsDmsEndpointDynamoDb
--- PASS: TestAccAwsDmsEndpointDynamoDb (34.96s)
=== RUN   TestAccAwsDmsEndpointS3
--- PASS: TestAccAwsDmsEndpointS3 (35.02s)

@bflad bflad merged commit 322253a into hashicorp:master May 7, 2018
bflad added a commit that referenced this pull request May 7, 2018
@microamp microamp deleted the dms-target-endpoint-s3 branch May 10, 2018 04:23
@bflad
Copy link
Contributor

bflad commented May 10, 2018

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.

@ghost
Copy link

ghost commented Apr 6, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants