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

This project doesn't work #50

Open
donfirst opened this issue May 16, 2024 · 5 comments
Open

This project doesn't work #50

donfirst opened this issue May 16, 2024 · 5 comments

Comments

@donfirst
Copy link

donfirst commented May 16, 2024

Unfortunately, this project is broken

This is just a warning to everyone who wants to play around with this PLUGIN

using this command
cfn submit --set-default

You can't build the Lambda
So you can build and deploy two stack
CloudFormationManagedUploadInfrastructure
styra-opa-hook-role-stack

You can build and upload one zip file to the S3 (styra-opa-hook-{date}.zip)

But there is a missing step. to deploy lambda and connect that lambda to the hook

So the effect is that after. hook activation ALWAYS you will get an error message during CF deployment that it's impossible to connect to your opa server- hook is not able to connect to lambda ( lambda doesn't exist)

@anderseknert
Copy link
Member

Hi @donfirst!

And thanks for filing this issue. I'm aware of this issue from before, but unfortunately I haven't had the time to get around to it yet. Planning to set aside some time for this next week, and hopefully we can get things back to a working state then. Could you describe the steps you take and where exactly things break and how?

I'll make sure to keep you in the loop as I try to find out what's changed here since I worked on this the last time.

@donfirst
Copy link
Author

donfirst commented May 16, 2024

Hi @anderseknert

Wanted to say that you are doing an awesome job !!!

I have found a couple of issues
I'm using Mac Sonoma 14..5 and Python 3.12.3

  1. It would be good to put into README that you have to update .rdpk-config
    "language": "python{your_python_version}",
    "runtime": "python{your_python_version}",
  2. File validate.py in folder test -> line 109

should be
¯\(ツ)

image

3)Following instruction from
https://www.openpolicyagent.org/docs/latest/aws-cloudformation-hooks/

a)
git clone https://github.com/StyraInc/opa-aws-cloudformation-hook.git
cd opa-aws-cloudformation-hook
b)Change the file

image

c)cd hooks
cfn submit --set-default

c1)
image

d) So far so good :-)
e) Doing all exports
f)Activate the hook

Now I'm going to lambda -> no function has been created
CFstack hook is activated

Deploying any cf

image

Check lambda and there is no lambda
image
image
image

Seems that this CF file has not been deployed
image

image

@anderseknert
Copy link
Member

Thank you @donfirst! That's really helpful 👍 I'll use your findings as my starting point when I get to this. In the meantime, don't hesitate to submit corrections for any of the issues you've found here or in the OPA docs. Given that this used to work, it's likely "just" some change AWS did that we need to account for. The problem is of course identifying what that change might be :)

@donfirst
Copy link
Author

@anderseknert
I spent some time to discover how that project work - so now I know .
You can close that topic I managed everything to work

If you. are interested I can participate in that project - fix documentation and explain. how does it work
Let me know if you are interested in
Best Regards
Pete

@anderseknert
Copy link
Member

That's great! Yes, I'd be very happy for any help I can get here, as it's been quite a while since I worked on this 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants