adventurous-butcher-54166
04/06/2024, 12:05 PMpulumiverse_time.Rotating
for triggering rotation of a client credential. And now as soon it expired it throws an error...
• Can't run any pulumi operations
• Removing the resource definition from code doesn't help
• Explicitly destroying the Rotating resource pulumi destroy --target <the rotating urn>
doesn't work
The state seems to be broken after this happened.
Diagnostics:
time:index:Rotating (rotate-credentials-lz-dev):
error: Preview failed: Expected an Object, got: {<nil>}
Any ideas on how to resolve this?miniature-musician-31262
04/07/2024, 11:31 AMbig-architect-71258
04/08/2024, 7:57 AMpulumi refresh
again. Please let us know the outcome.
cc @enough-garden-22763adventurous-butcher-54166
04/08/2024, 9:26 AMv0.0.16
and I had already tried updating to v0.0.17
without resolving the issue. pulumi refresh
doesn't work either – still getting the same error.big-architect-71258
04/08/2024, 9:40 AMadventurous-butcher-54166
04/08/2024, 9:41 AMpulumiverse-time = "0.0.16"
big-architect-71258
04/08/2024, 9:42 AM--target
command line option pulumi destroy --target <the rotating urn>
?adventurous-butcher-54166
04/08/2024, 9:43 AMbig-architect-71258
04/08/2024, 9:44 AMadventurous-butcher-54166
04/08/2024, 9:45 AMbig-architect-71258
04/08/2024, 9:49 AMpulumi destroy --target
won't work. If the resource is still present in the state, you must use pulumi state delete
to remove it.big-architect-71258
04/08/2024, 9:50 AMpulumi state delete --help
how to use it and for valuable hints like how to find the resource URNs.adventurous-butcher-54166
04/08/2024, 9:53 AMoptions:
refresh: always
When I disable refresh I'm able to run preview – so this seems to be connected with that.big-architect-71258
04/08/2024, 9:56 AMpulumi preview --refresh
shouldn't work either. Only to get it straight: pulumi preview
(without a refresh) works? And if so: what's the diff shown afterwards?adventurous-butcher-54166
04/08/2024, 10:11 AMpulumi pre --refresh
and it will show Rotating will be created.big-architect-71258
04/08/2024, 10:12 AMadventurous-butcher-54166
04/08/2024, 10:13 AMadventurous-butcher-54166
04/08/2024, 10:16 AMadventurous-butcher-54166
04/08/2024, 10:36 AMrefresh: always
enabled
__main__.py
from pulumiverse_time import Rotating, RotatingArgs
rotation = Rotating(
resource_name="rotation",
args=RotatingArgs(
rotation_minutes=1,
),
)
First I ran this with v0.0.17
installed and after 1 minute had passed it replaced the Rotating resource successfully.
However after destroying the stack and creating again with v0.0.16
installed the error will show up when running after the rotation expiration time has passed.
Relevant runtime information:
• Pulumi CLI version 3.112.0
• Go version go1.22.1
• Python version 3.12.2
• Arch: Apple Silicon Darwin/arm64big-architect-71258
04/08/2024, 10:59 AMbig-architect-71258
04/08/2024, 11:00 AMHowever after destroying the stack and creating again withSeems to me thatinstalled the error will show up when running after the rotation expiration time has passed.v0.0.16
v0.0.16
is broken. If you create and destroy by sticking to v0.0.17
, will the error show up as well?big-architect-71258
04/08/2024, 11:18 AMadventurous-butcher-54166
04/08/2024, 11:21 AMbig-architect-71258
04/08/2024, 11:22 AMadventurous-butcher-54166
04/08/2024, 11:28 AMancient-policeman-24615
04/08/2024, 12:00 PMYes that’s the expected behavior because that’s how Terraform and it’s providers work. No, refresh, no change on the resource. But I wanna loop in @enough-garden-22763 and @ancient-policeman-24615 here, because they have more in-depth knowledge of the Pulumi Terraform Bridge and if it might be possible to have wrapped resources like the ones from the Time provider to change/trigger without a refresh. (edited)I think the correct way to implement Rotation is with Diff, not refresh (both for pulumi and terraform). If this doesn’t work well with TF without refresh, it’s not going to work super well with Pulumi unless refresh is used. There aren’t any bridge hooks to override this kind of behavior yet. If
time
works correctly in TF without refresh, then it’s just a bridge bug and we can fix it.
Perhaps we should create a native Pulumi Provider instead of wrapping the TF provider. I have the suspicion that this approach would be better suited to Pulumi’s lifecycle, as the time provider’s resources are very special. @ancient-policeman-24615Given ☝️, I’m sure that you can build a native provider that works better then the bridged version.
big-architect-71258
04/08/2024, 12:08 PMIf this doesn’t work well with TF without refresh@ancient-policeman-24615 I think the TF Time provider is build around the lifecycle of TF and thus relies on the refresh cylce that TF always carries out. Currently they use a plan modifier to force an update on the resource when the rotation time is over. https://github.com/hashicorp/terraform-provider-time/blob/536dec8b9dd951e3045d575c0d8c159f3fa782e9/internal/provider/resource_time_rotating.go#L262 Not sure though when the modifier is called. My suspicion is that it only gets called on refresh.
ancient-policeman-24615
04/08/2024, 1:17 PMpulumi-aws
maintains it’s own global tags implementation because TF’s version doesn’t work with refresh disabled.big-architect-71258
04/08/2024, 1:38 PMrefresh
for TF with the TIME provider it'll behave like the wrapped provider when running without an refresh using Pulumi. Right?ancient-policeman-24615
04/08/2024, 1:39 PM