sparse-intern-71089
09/06/2023, 3:13 AMcreamy-monkey-35142
09/07/2023, 11:32 AMCLOUDFLARE_API_CLIENT_LOGGING=true TF_LOG=TRACE pulumi up -y --target "**<redacted>" --logtostderr --logflow -v=9 --skip-preview 2> out.txt
I have noticed that if I add into command --skip-preview then resource will be deleted, but if I remove --skip-preview then there is no resource deleted, no delete action recorded in log,
Someone please help me take a look 😞dry-keyboard-94795
09/07/2023, 11:35 AMcreamy-monkey-35142
09/07/2023, 11:42 AMcreamy-monkey-35142
09/07/2023, 11:47 AM{
"record-name": {
"value": "example",
"type": "A",
"proxied": true
}
}
then in python code, it read on every json entry as `value`and call to function Cloudfare.Record(**value) , to remove a record, I need go to this json file and remove an elementcreamy-monkey-35142
09/07/2023, 11:48 AM--skip-preview I can see events `DELETE`in logcreamy-monkey-35142
09/07/2023, 11:49 AM--skip-previewcreamy-monkey-35142
09/07/2023, 11:50 AMpulumi stack --show-urns didn’t show urn of record anymore but record still exist on Cloudflaredry-keyboard-94795
09/07/2023, 11:51 AMpulumi refresh, and it'll fix the state.
Does trying to remove a record work after the refresh?creamy-monkey-35142
09/07/2023, 11:52 AMpulumi refresh and pulumi refresh --target "**<domain_name" and it didn’t resolve the problemdry-keyboard-94795
09/07/2023, 12:01 PMRecord is called within the stack.
I've seen some people make resources within .apply() calls of an Output, which I can see causing issues like what you're seeing.dry-keyboard-94795
09/07/2023, 12:02 PM--target? I've faced problems with that before (wish I could use it in production)creamy-monkey-35142
09/07/2023, 12:02 PM--targetcreamy-monkey-35142
09/07/2023, 12:03 PMRecord will be calledcreamy-monkey-35142
09/07/2023, 12:04 PMDynamicFunction at utils.py with
def DynamicFunction(self, values, function_name = None):
"""
Provide a dynamic function to call cloudflare class like cloudflare.TeamsList
"""
# Get the function name from a calling module
if function_name is None:
function_name = inspect.stack()[1].function
# get attr of function name from Cloudflare
execute = getattr(cloudflare, function_name)
# **values to pass dictionary items as function arguments
result = execute(**values)
return resultcreamy-monkey-35142
09/07/2023, 12:04 PMexecute = getattr(cloudflare, Record)
# **values to pass dictionary items as function arguments
result = execute(**values)creamy-monkey-35142
09/07/2023, 12:05 PMCloudflare.Record(**value)dry-keyboard-94795
09/07/2023, 12:19 PMpdb doesn't work, but you should be able to setup debugpy and have vscode attach to itechoing-dinner-19531
09/07/2023, 12:52 PMcreamy-monkey-35142
09/08/2023, 3:25 AMcreamy-monkey-35142
09/08/2023, 3:27 AMdry-keyboard-94795
09/08/2023, 6:42 AM--target thendry-keyboard-94795
09/08/2023, 6:48 AMdry-keyboard-94795
09/08/2023, 6:55 AMdry-keyboard-94795
09/08/2023, 6:58 AM--diff on a previewcreamy-monkey-35142
09/08/2023, 7:01 AMv3.81.0 , issue also on Github Actions pulumi/actions@ddcac955fd004d13bc60bd0bdbbc389b1f524216 (suggested by @echoing-dinner-19531 before https://pulumi-community.slack.com/archives/C84L4E3N1/p1675078507601099)creamy-monkey-35142
09/08/2023, 7:03 AMpulumi/actions@v4.4.0 too but issue still existcreamy-monkey-35142
09/08/2023, 7:03 AMcreamy-monkey-35142
09/08/2023, 7:09 AMdry-keyboard-94795
09/08/2023, 7:09 AMdry-keyboard-94795
09/08/2023, 7:13 AMechoing-dinner-19531
09/08/2023, 7:55 AMcreamy-monkey-35142
09/08/2023, 7:56 AM--target for now. Thank you for your suggestion