Reputation: 572
I have a terraform stack that is managed using the python version of cdktf
where each instance has some tags associated with it, something like:
start_time = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M")
self.instance = Instance(
self,
f"some-instance",
ami=ami,
instance_type=instance_type,
...
tags=dict(
start_time=start_time,
...
)
)
When I do a cdktf deploy
with this, I always get a change to the "starting" tag. I would like to avoid this being marked as a diff so going by this post it seems it should be possible to add a lifecycle
entry and it will be ignored:
self.instance = Instance(
...
lifecycle=dict(ignore_changes=["tags.start_time"]),
)
However, this doesn't seem to work. It doesn't seem to have much documentation in this area so I suspect I'm doing something wrong with the format.
Does anyone know what the correct format is? Or if this should even work?
Upvotes: 0
Views: 330