Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

IAM policy slides – command line error

In this lecture you mention several times the add-iam-policy-binding command line, however, it doesn’t seem to be correct. 

The slides show this cmd:

gcloud compute add-iam-policy-binding myvm1 …..

The correct command (for compute) seem to be:

gcloud alpha compute instances add-iam-policy-binding INSTANCE_NAME –member=MEMBER –role=ROLE [–zone=ZONE] [GCLOUD_WIDE_FLAG …]

as per the doc:

1 Answers

You are absolutely right that the example command I gave was wrong. 😢 I had tried to change my example from a project-level one to an instance-level one–because I thought it would do a better job of showing off policies–but I mangled it in the process and neglected to test it. So thank you for pointing it out!

As far as I could tell, the error was restricted to the one example–as the generic pattern will work fine in normal gcloud (i.e. non-alpha, non-beta) for some resources (like projects)–but if there are any more errors, please let me know!

I have now fixed (and tested!) the example command and updated the lecture.

Thanks, again.


Roman Mezhibovski

Tnx – I would link to the gcloud documentation as its very useful and easy to follow.

Mattias Andersson

Good suggestion! Thank you! I’ve now done this–but since there are so many different resources that support add-iam-policy-binding, I had to link to them with a google search. 🙂

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?