https://pulumi.com logo
#python
Title
# python
a

able-honey-93860

12/26/2021, 4:36 PM
Does anyone know if the Okta package allows for
deleteBeforeReplace
? Can't get it to work but I'm basing it off the AWS examples so maybe need a different syntax?
Hmm looks like the documentation is a little inaccurate. Online documentation shows the below, which results in “NameError: name ‘ResourceOptions’ is not defined”
opts=ResourceOptions(delete_before_replace=True)
Proper format seems to be the below which was found based off this GitHub issue https://github.com/pulumi/pulumi/issues/5750
opts=pulumi.ResourceOptions(delete_before_replace=True)
Now I don't get the error, but still isn't happy that a policy rule name is already in use. I think it might be due to the SignOn rule being set with a policy rule set, when updating the SignOn rule it wants to remake the policy rule which isn't going to allow two rules with the same name. thought the delete before replace would solve this but I think I might need a different workaround
b

billowy-army-68599

12/27/2021, 12:43 PM
@able-honey-93860 that looks to be a python ism, it depends how you import your pulumi library. If you do:
from pulumi import ResourceOptions
the first will work
a

able-honey-93860

12/27/2021, 3:32 PM
Neat, thanks!
3 Views