cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

DynamoDB Global Table Import support

Open kayengar opened this issue 3 years ago • 9 comments

Cloudformation DynamoDB Global Table Import support

Quick Sample Summary:

  1. Title -> AWS::DynamoDB::GlobalTable Imports
  2. Scope of request -> AWS::DynamoDB::GlobalTable has Cloudformation support today, but an existing GlobalTable cannot be imported into a Cloudformation stack. We need to be able to import existing global tables into Cloudformation stacks.
  3. Expected behavior ->
  • When we import a CFN stack with DynamoDB global tables, it should be able to recognize and import the GlobalTable as a new resource into the template.
  • (Additional feature) - If it can determine 2017 Global Tables and can import it into a new stack, it is an added advantage since there is no way currently to convert 2017 Global Table to 2019 Global Table outside of console.
  1. Links to existing API doc ->
  • https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html
  • https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/57#issuecomment-844337982
  1. Category tag (optional) -> DB

kayengar avatar May 20 '21 02:05 kayengar

Hi @kayengar ! I just tested by creating an Amazon DynamoDB global table with the AWS Management Console. I was, subsequently, able to import the global table with a template describing the table as an AWS::DynamoDB::GlobalTable resource type. Are you still not able to perform the import? If so, can you please provide more information? Thank you!

mrinaudo-aws avatar Jun 02 '21 19:06 mrinaudo-aws

@mrinaudo-aws Thanks for getting back to me. Let me try it. Also, would we be able to import a 2017 Global Table into a new CFN stack?

kayengar avatar Jun 02 '21 22:06 kayengar

Hi @kayengar !

Were you able to perform the import?

To your question: we don't have a good way to convert a 2017 table to 2019 on the fly while the customer is importing the resource in CloudFormation, and currently it is not in our roadmap. You might want to consider creating a separate, specific issue for this: typically, we prioritize based on customer feedback, and +1s is a metric for that.

Thank you!

mrinaudo-aws avatar Jun 07 '21 18:06 mrinaudo-aws

Note that ::GlobalTable is not listed as supported in the documentation. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html

benkehoe avatar Jun 07 '21 20:06 benkehoe

Hi @benkehoe ! I will convey your feedback to the team, thank you!

mrinaudo-aws avatar Jun 09 '21 20:06 mrinaudo-aws

Hi @benkehoe ! The AWS::DynamoDB::GlobalTable resource is now listed in the documentation page you mentioned. Thank you again for your feedback!

mrinaudo-aws avatar Jun 10 '21 21:06 mrinaudo-aws

Hi @kayengar ! I am closing this issue, please feel free to reopen it if you have issues with performing the import. Thank you!

mrinaudo-aws avatar Jun 16 '21 17:06 mrinaudo-aws

This is still an issue

aws --version
aws-cli/2.9.5 Python/3.9.11 Darwin/21.6.0 exe/x86_64 prompt/off
    aws cloudformation create-change-set \
    --stack-name ${stackName} --change-set-name ImportChangeSet \
    --change-set-type IMPORT \
    --resources-to-import "[{\"ResourceType\":\"AWS::DynamoDB::GlobalTable\",\"LogicalResourceId\":\"${resource}\",\"ResourceIdentifier\":{\"TableName\":\"${tableName}\"}}]" \
    --template-url https://${bucket}.s3.${region}.amazonaws.com/${s3Prefix}/cfn/${template}--capabilities CAPABILITY_NAMED_IAM  --parameters "${params}"
  

An error occurred (ValidationError) when calling the CreateChangeSet operation: ResourceTypes [AWS::DynamoDB::GlobalTable] are not supported for Import

animaxcg avatar Dec 08 '22 01:12 animaxcg

Yes, this is still an issue. Sorry I have not worked on this for a while.

kayengar avatar Feb 01 '24 18:02 kayengar

@kayengar I have been able to do this import. Can you retest your situation and see if its working.

kddejong avatar Mar 28 '24 15:03 kddejong

Closing this issue because it is possible to import AWS::DynamoDB::GlobalTable. We can open additional issues if there are specific issues that aren't working.

kddejong avatar Mar 29 '24 14:03 kddejong