amazon-web-servicesamazon-dynamodbcicdsecondary-indexes

What is the correct approach to adding projected attributes to a GSI in AWS setup with a CI/CD pipeline?


I need to add additional projected attributes to a global secondary index for a DynamoDB table in AWS, controlled through a CI/CD pipeline.

I know a GSI cannot be edited; I believe I have to first delete it, and then recreate it.
However, what does this specifically entail?
I have not been able to find any references that go into detail for a CI/CD pipeline.

Are the steps below the correct approach?

  1. "Delete" the GSI by commenting out all code referencing it
  2. Deploy to the CI/CD pipeline
  3. Uncomment the previous GSI code and add the new projected attributes
  4. Deploy to the CI/CD pipeline

Solution

  • Yes, your steps is exactly what will work. Just make sure the index is dropped before continuing with step 4.