Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulumi automation can not handle objectValue in Config #6809

Closed
ncd opened this issue Apr 19, 2021 · 5 comments · Fixed by #6838
Closed

Pulumi automation can not handle objectValue in Config #6809

ncd opened this issue Apr 19, 2021 · 5 comments · Fixed by #6838
Assignees
Labels
area/automation-api resolution/duplicate This issue is a duplicate of another issue

Comments

@ncd
Copy link

ncd commented Apr 19, 2021

I made pulumi config as an object.

ram:
    roles:
    - assume_policy: autoscaler_assume
      name: cluster-autoscaler
      policy_attachments:
        custom_policies:
        - cluster_autoscaler

When I run stack refresh/up using pulumi.x.automation module --> I always failed due to an error: unexpected keyword argument 'objectValue'.
Recheck with pulumi stack history command:

"devops-ram:ram": {
        "value": "{\"roles\":[{\"assume_policy\":\"autoscaler_assume\",\"name\":\"cluster-autoscaler\",\"policy_attachments\":{\"custom_policies\":[\"cluster_autoscaler\"]}}]}",
        "objectValue": {
          "roles": [
            {
              "assume_policy": "autoscaler_assume",
              "name": "cluster-autoscaler",
              "policy_attachments": {
                "custom_policies": [
                  "cluster_autoscaler"
                ]
              }
            }
          ]
        },
        "secret": false
      }
    }

Expected behavior

The code will run normally

Current behavior

The code has error

Steps to reproduce

  1. Run pulumi automation with configuration is in object type.

Context (Environment)

Affected feature

@ncd ncd added the kind/bug Some behavior is incorrect or out of spec label Apr 19, 2021
@leezen leezen added resolution/duplicate This issue is a duplicate of another issue and removed kind/bug Some behavior is incorrect or out of spec labels Apr 20, 2021
@leezen
Copy link
Contributor

leezen commented Apr 20, 2021

I believe this is a duplicate of #5506, which has some suggestions for potential workarounds.

@leezen leezen closed this as completed Apr 20, 2021
@komalali
Copy link
Member

komalali commented Apr 20, 2021

Hi, okay looking at this again I think I see what's going on here and it's not exatcly a dupe of #5506. This looks like something I fixed previously but it's possible there's been a regression.

@ncd it looks like you're using automation API with python. Is that right? What version are you using? Can you share more of your automation code?

@komalali komalali reopened this Apr 20, 2021
@komalali komalali added area/automation-api and removed resolution/duplicate This issue is a duplicate of another issue labels Apr 20, 2021
@komalali komalali self-assigned this Apr 20, 2021
@komalali
Copy link
Member

komalali commented Apr 21, 2021

Okay, I just rechecked that we did indeed fix this issue in Pulumi 2.21.0 and we have tests for it, so I'm going to close this out. If you are using the latest version and are somehow still hitting this error, please reopen.

@komalali komalali reopened this Apr 21, 2021
@followben
Copy link
Contributor

followben commented Apr 21, 2021

I'm striking the same issue. I have a similar code & setup as the local python example generates the following stacktrace immediately after performing the refresh or up operation on a stack:

Traceback (most recent call last):
  File "main.py", line 90, in <module>
    up_res = stack.up(on_output=print)
  File "/Users/bstovold/Documents/venv/lib/python3.8/site-packages/pulumi/automation/_stack.py", line 279, in up
    summary = self.info()
  File "/Users/bstovold/Documents/venv/lib/python3.8/site-packages/pulumi/automation/_stack.py", line 578, in info
    history = self.history(page_size=1)
  File "/Users/bstovold/Documents/venv/lib/python3.8/site-packages/pulumi/automation/_stack.py", line 559, in history
    summary = UpdateSummary(kind=summary_json["kind"],
  File "/Users/bstovold/Documents/venv/lib/python3.8/site-packages/pulumi/automation/_stack.py", line 91, in __init__
    self.config[key] = ConfigValue(**config[key])
TypeError: __init__() got an unexpected keyword argument 'objectValue'

FWIW, preview does not produce this error. Pip freeze tells me I've got pulumi==3.0.0.

@ncd
Copy link
Author

ncd commented Apr 22, 2021

@komalali Thank Komal, the updated code has fixed my issue. Besides, as I checked, the issue also happen in other languagues' automation package.

@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Apr 22, 2021
@lukehoban lukehoban added resolution/duplicate This issue is a duplicate of another issue and removed resolution/fixed This issue was fixed labels Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation-api resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants