cloudposse / terraform-aws-dms

Terraform modules for provisioning and managing AWS DMS resources
https://cloudposse.com/accelerate
Apache License 2.0
7 stars 7 forks source link

feat: dms serverless replication #25

Open oycyc opened 5 months ago

oycyc commented 5 months ago

what

Something @Gowiem was previously working on, DMS Serverless replication, which is the same as the migration replication task but doesn't need an instance because it's serverless.

Thought it would be a good addition here with the other resources.

I've added the module and also an example within the examples/complete using the DBs created there as well.

references

https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Serverless.html

Gowiem commented 5 months ago

cc @AdamTylerLynch, if I'm remembering correctly, you were looking Serverless DMS support within Cloud Posse modules! Check this out and let @oycyc or I know if there are any enhancements you would want to make prior to merge 👍

Gowiem commented 5 months ago

/terratest

Gowiem commented 5 months ago

/terratest

milldr commented 5 months ago

@oycyc Terratest is failing because this IAM role name is hard-coded

https://github.com/cloudposse/terraform-aws-dms/blob/main/modules/dms-iam/main.tf#L38 https://github.com/cloudposse/actions/actions/runs/9781915755/job/27007106494#step:10:2666

TestExamplesComplete 2024-07-03T17:10:30Z logger.go:66: │ Error: creating IAM Role (dms-access-for-endpoint): operation error IAM: CreateRole, https response error StatusCode: 409, RequestID: cb6a7c41-7de6-4ae2-a46e-31833fb2394a, EntityAlreadyExists: Role with name dms-access-for-endpoint already exists.

It's not necessarily related to this PR, but we unfortunately need to fix the tests to merge this PR

oycyc commented 5 months ago

@oycyc Terratest is failing because this IAM role name is hard-coded

https://github.com/cloudposse/terraform-aws-dms/blob/main/modules/dms-iam/main.tf#L38 https://github.com/cloudposse/actions/actions/runs/9781915755/job/27007106494#step:10:2666

TestExamplesComplete 2024-07-03T17:10:30Z logger.go:66: │ Error: creating IAM Role (dms-access-for-endpoint): operation error IAM: CreateRole, https response error StatusCode: 409, RequestID: cb6a7c41-7de6-4ae2-a46e-31833fb2394a, EntityAlreadyExists: Role with name dms-access-for-endpoint already exists.

It's not necessarily related to this PR, but we unfortunately need to fix the tests to merge this PR

Looking into this!

oycyc commented 4 months ago

@oycyc Terratest is failing because this IAM role name is hard-coded

https://github.com/cloudposse/terraform-aws-dms/blob/main/modules/dms-iam/main.tf#L38 https://github.com/cloudposse/actions/actions/runs/9781915755/job/27007106494#step:10:2666

TestExamplesComplete 2024-07-03T17:10:30Z logger.go:66: │ Error: creating IAM Role (dms-access-for-endpoint): operation error IAM: CreateRole, https response error StatusCode: 409, RequestID: cb6a7c41-7de6-4ae2-a46e-31833fb2394a, EntityAlreadyExists: Role with name dms-access-for-endpoint already exists.

It's not necessarily related to this PR, but we unfortunately need to fix the tests to merge this PR

@milldr Can you rerun the test? Just pushed a commit that should fix that, and also the other error with name exceeding the character limit.

milldr commented 4 months ago

/terratest

oycyc commented 4 months ago

@milldr ah I see why it wasn't already previously using the null label, the role name has to explicitly hard coded like dms-vpc-role. (https://repost.aws/questions/QU61eADUU7SnO-t7MmhxgfPA/dms-service-roles#AN4e6MtkTATtyEN2THAO6csA)

It's not being referenced by any of the resources provisioned in this module but it's being used by AWS so now Terratest is failing changing the name

image

But if it's explicitly using that name in the codebase, it fails because it's already created in Terratest's environment (didn't get destroyed in previous run?)

I reverted it for now.

milldr commented 4 months ago

/terratest

gberenice commented 3 months ago

Related discussion about test failure started in this PR https://github.com/cloudposse/terraform-aws-dms/pull/30#issuecomment-2321292307

gberenice commented 3 months ago

/terratest

gberenice commented 3 months ago

/terratest

gberenice commented 3 months ago

@oycyc tests are failing due to serverless config creation time out:

TestExamplesComplete 2024-09-01T11:28:41Z logger.go:66: module.dms_serverless_replication_config.aws_dms_replication_config.default[0]: Still creating... [48m50s elapsed]
panic: test timed out after 1h0m0s

Have you run them locally? Does it behave another way?