2 Answers
- Newest
- Most votes
- Most comments
1
As mentioned here: https://github.com/aws/aws-cdk/blob/v1-main/packages/aws-cdk/README.md#cdk-import
You must also make sure to exactly model the state that the resource currently has. For the example of the Bucket, be sure to include KMS keys, life cycle policies, and anything else that's relevant about the bucket. If you do not, subsequent update operations may not do what you expect
So in your case, as the s3 construct may default to certain properties if not specified, the same may apply for rds.
I would suggest you to be explicit and define properties based on the construct: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseInstance.html to avoid any surprise
Relevant content
- asked 2 years ago
- asked 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
thanks so much , what about the billing part ? i.e. Is it valid to import an RDS instance from another account i.e. Account B to a stack which is in Account A ? if is it valid , is it the best approach ? also, do I get billed twice ? one for the RDS which is in Account B and one for the Imported one into Account A.
Is it valid to import an RDS instance from another account (Account B) to a stack in Account A?
Yes, it is valid to import an RDS instance from one AWS account to another using cross-account IAM roles.
Is it the best approach?
Using cross-account services can be a viable approach, but whether it is the best option depends on your specific use case, as well as considerations related to security, management, and compliance.
Do I get billed twice, one for the RDS in Account B and one for the imported one into Account A?
No, you will not be billed twice. The billing will continue to be based on the account where the RDS instance is physically located (Account B). (Note: you are accessing the existing instance in Account B from Account A. In this scenario, you will not be billed twice)