https://pulumi.com logo
Title
g

green-intern-27665

07/27/2021, 8:57 AM
Hi!!! I have one question about DynamoDb tables. I’m creating a dynamoDB table and passing this TTL configuration:
ttl=aws.dynamodb.TableTtlArgs(
            attribute_name="TimeToExist",
            enabled=False,
        ))
I can create the tablet without any issue but if I redeploy my stack I get and error informing that
ttl
is already defined. Any idea about how can I execute this statement just the first time that I create the table and not the rest of the times that I update the stack?
l

little-cartoon-10569

07/27/2021, 9:40 PM
Add the
ignore_changes
opt?
g

green-intern-27665

07/28/2021, 9:33 PM
@little-cartoon-10569 I have tried to ignored the
ttl
property but it doesn’t work. If the
ttl
is disable in every redeploy the stack tries to add the
attribute_name="TimeToExist"
property and if I remove it I got a validation error. On the contrary, if I set ttl True after adding the redeploy doesn’t claim. It seems like the
attribute_name
doesn’t exist on AWS if the
ttl
is disabled but pulumi is always trying to create it. In this moment AWS complains about this because they says that the ttl is already disabled for that table.
l

little-cartoon-10569

07/28/2021, 9:36 PM
Does this problem also apply to the equivalent Terraform code? If this is a problem with an essentially non-declarative pattern being invoked from Pulumi/Terraform, then you might need to remove this code from your Pulumi app and run it in a separate step. AutomationAPi helps with this sort of thing.
g

green-intern-27665

07/29/2021, 4:54 AM
I would say that it also happens to Terraform, because finding a solution for the problem I have seen people complaining about it. In fact there is an open issue in terraform to manage it https://github.com/hashicorp/terraform-provider-aws/issues/10304