happy-iron-52048
12/02/2024, 5:54 PMdef with_target(stack, urn):
start_time = time.time() # Record the start time
stack.refresh(target=[urn])
end_time = time.time() # Record the end time
elapsed_time = end_time - start_time
print(f"Time taken to refresh the stack for URN '{urn}': {elapsed_time:.2f} seconds")
def without_target(stack):
start_time = time.time() # Record the start time
stack.refresh()
end_time = time.time() # Record the end time
elapsed_time = end_time - start_time
print(f"Without Target : {elapsed_time:.2f} seconds")
with_target(pulumi_service_stack2.stack,'urn:pulumi:pulsar-test-stack-3::pulumi_poc::aws:ec2/instance:Instance::bookie-4')
Time taken to refresh the stack for URN 'urn:pulumi:pulsar-test-stack-3::pulumi_poc::aws:ec2/instance:Instance::bookie-4': 7.78 seconds
without_target(pulumi_service_stack2.stack)
Without Target : 7.38 seconds
So this particular stack has about 15 ec2 resources.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by