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

google_project resource works with project ID/number instead of name as seen in the docs #39

Closed
walterdolce opened this issue Jul 21, 2018 · 1 comment
Assignees

Comments

@walterdolce
Copy link
Contributor

I'm trying inspec-gcp for the first time. I followed the steps and I have implemented the following InSpec resource:

    describe google_project(project: File.read('./terraform-gcp-provider-config-project')) do
        it { should exist }
        its('lifecycle_state') { should eq "ACTIVE" }
    end

The file shown above contains the project name in GCP. When executing inspec, I get an error saying:

×  Project
     The caller does not have permission

When I pass the project ID or the project number, instead, the resource runs as normal passing the test successfully.

The documentation states that the "google_project resource block declares the tests for a single GCP project by name.", so I am not sure who's right in this instance: the code or the documentation?

Thank you.

@walterdolce walterdolce changed the title google_project resource works with project number instead of name. Docs advertise name. google_project resource works with project ID/number instead of name as seen in the docs Jul 21, 2018
@skpaterson skpaterson self-assigned this Jul 30, 2018
@skpaterson
Copy link

You're absolutely right, the google_project docs are confusing in their current state. I'll update these to reflect that the resource works with either project_id or project_number as argument. Thanks for raising this, all the resource documents are hand-crafted so errors can creep in!

skpaterson added a commit that referenced this issue Jul 30, 2018
…ted test to explicitly cover both project_id and project_number cases.

Signed-off-by: Stuart Paterson <[email protected]>
russellseymour added a commit that referenced this issue Aug 13, 2018
Update the google_project version as per #39.  Also udpate the associ…
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