-
Notifications
You must be signed in to change notification settings - Fork 2
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
Imported AclPolicy needs replacement #227
Comments
Hi @cynicaljoy. I am unable to reproduce the bug. Your script was very helpful getting everything setup. I was able to import and then run P.S. The run script has a typo: -export NOAD_ADDRESS="http://127.0.0.1:4646/"
+export NOMAD_ADDRESS="http://127.0.0.1:4646/" |
Ah, sorry about that! I'm using Nomad 1.5.3 |
I just went through the same steps with Nomad 1.6.2 and repo'd 😕 |
I recreated it with Docker too: docker-compose.yml
DockerfileFROM pulumi/pulumi-python:3.104.2
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt requirements.txt
__main__.pyimport pulumi
import pulumi_nomad as nomad
with open("full-access.hcl", "r") as file:
full_access_hcl = file.read()
nomad.AclPolicy(
"full-access-policy",
name="full-access",
description="Full Access Policy",
# read full-access.hcl file into string
rules_hcl=full_access_hcl,
opts=pulumi.ResourceOptions(
provider=nomad.Provider(
"nomad-provider",
address="http://nomad:4646",
),),
) Pretty much the same steps, but a few extra since I didn't take the time to automate everything out and the nomad image doesn't have Repro stepsdocker cp full-access.hcl pulumi-nomad-acls-sandbox-nomad-1:full-access.hcl
docker exec -it pulumi-nomad-acls-sandbox-nomad-1 /bin/sh
nomad acl bootstrap
# manually copy Secret ID
export NOMAD_TOKEN="<Secret ID>"
export NOMAD_ADDRESS="http://127.0.0.1:4646/"
export NOMAD_REGION=""
nomad acl policy apply -description "Full Access Policy" full-access full-access.hcl
nomad acl token create -name="Pulumi Testing" -policy="full-access" -type=client -ttl=8h
exit
docker exec -it pulumi-nomad-acls-sandbox-sandbox-1 /bin/bash
export NOMAD_TOKEN="<Secret ID>"
export NOMAD_ADDRESS="http://nomad:4646/"
export NOMAD_REGION=""
pulumi login --local
# I had to re-init my Python venv, but that could have just been from me mucking about 🙈 -- if pulumi yells, delete it and recreate it
pulumi stack init sandbox
pulumi import nomad:index/aclPolicy:AclPolicy full-access-policy full-access -y
pulumi pre --diff --expect-no-changes Same result as before: pulumi pre --diff
|
Thanks again @cynicaljoy docker-compose is handy we probably should set this up for running examples locally. Looks like something nefarious is going on with "id" which is a special property, not a regular property. My team will get back to you debugging this as time permits. PULUMI_DEBUG_GRPC="$PWD/here.json" logs could be useful from the import, as well as checking up on |
Unfortunately, it looks like this issue hasn't seen any updates in a while. If you're still encountering this problem, could you leave a quick comment to let us know so we can prioritize it? (Commenting will bump it back into our triage queue.) |
@mjeffryes we're still waiting on a fix/workaround for the issue. |
Thank you for verifying. We will take a look as soon as we can. |
What happened?
After importing my Nomad AclPolicy into my stack and running a
pulumi pre --diff
I noticed it was ending up in a state where it was going to bereplaced
. I sandbox this out in a local environment and ran thepulumi up
and it doesn't just replace the Acl it actually destroyed it. Luckily running a pulumi refresh and pulumi up recreates it and the tokens associated are still in-tact. But, it shouldn't be necessary to jump through those hoops. I'd expect an imported AclPolicy to have no diffs.I tried to add
ignore_changes=["id"]
to the resource options, that didn't help.Example
full-access.hcl
Output of
pulumi about
CLI
Version 3.103.1
Go Version go1.21.6
Go Compiler gc
Plugins
NAME VERSION
aws 6.19.0
nomad 2.1.0
python unknown
Host
OS darwin
Version 14.2.1
Arch x86_64
This project is written in python: executable='/usr/local/share/mise/installs/python/3.9/bin/python3' version='3.9.18'
Current Stack: nomad-acls-sandbox/local
TYPE URN
pulumi:pulumi:Stack urn:pulumi:local::nomad-acls-sandbox::pulumi:pulumi:Stack::nomad-acls-sandbox-local
pulumi:providers:nomad urn:pulumi:local::nomad-acls-sandbox::pulumi:providers:nomad::default_2_1_0
nomad:index/aclPolicy:AclPolicy urn:pulumi:local::nomad-acls-sandbox::nomad:index/aclPolicy:AclPolicy::full-access-policy
Found no pending operations associated with local
Backend
Dependencies:
NAME VERSION
pip 23.3.2
pulumi_aws 6.19.0
pulumi_nomad 2.1.0
setuptools 69.0.3
wheel 0.42.0
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: