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

Implement Billing Account Role #53

Merged
merged 7 commits into from
Oct 19, 2018

Conversation

knitterb
Copy link
Contributor

This adds to the helper script the optional creation of the IAM billing role for the service account that is required. Other small changes include:

  • Additional output when the hep script is run so that the user understands what steps are being executed. This could be helpful for any debugging or failure.
  • Explicit details on how to add a service account to the gcloud auth list

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @adrienthebo to review as well

Copy link
Contributor

@adrienthebo adrienthebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that the script runs as expected with and without a billing account, and the changes are reasonable. LGTM.

Copy link
Contributor

@adrienthebo adrienthebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a small error where we don't clean up the billing account policy file, could you fix that before we merge this?

echo "Could not set roles/billing.user on service account $SERVICE_ACCOUNT.\
Please perform this manually."
fi
rm -f policy-tmp-$$.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extension of this file is incorrect, it should be .yml but is .json.

\ \ role: roles/billing.user" policy-tmp-$$.yml
gcloud beta billing accounts set-iam-policy $BILLING_ACCOUNT policy-tmp-$$.yml
else
echo "Could not set roles/billing.user on service account $SERVICE_ACCOUNT.\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small fixup: since we used a 2 space indent in the previous code, could we switch this block to use 2 spaces as well?

@knitterb
Copy link
Contributor Author

knitterb commented Oct 19, 2018

Fixed both requested changes @adrienthebo

@morgante morgante merged commit 8b3fd57 into terraform-google-modules:master Oct 19, 2018
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

Successfully merging this pull request may close these issues.

3 participants