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

⭐️ unique platform id for terraform when used with git #1983

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

chris-rock
Copy link
Member

@chris-rock chris-rock commented Sep 29, 2023

This is a followup to #1975

cnquery shell gitlab --group example --discover terraform 
→ loaded configuration from /Users/chris/.config/mondoo/mondoo.yml using source default

    Available assets                                                               
                                                                                   
  > 1. Terraform Static Analysis example/example-gitlab (terraform-hcl)         
    2. Terraform Static Analysis example/example-playground (terraform-hcl)     
    3. Terraform Static Analysis example/example-code (terraform-hcl) 
    4. Terraform Static Analysis example/example-demo-environment (terraform-hcl)            

@chris-rock chris-rock changed the title Chris rock/terraform git platform ⭐️ unique platform id for terraform when used with git Sep 29, 2023
@chris-rock chris-rock force-pushed the chris-rock/terraform-git-platform-id branch from 3f425ed to 7af74d5 Compare September 29, 2023 11:47
}
platformID := "//platformid.api.mondoo.app/runtime/terraform/domain/" + domain + "/org/" + org + "/repo/" + repo
asset.Connections[0].PlatformId = platformID
asset.PlatformIds = []string{platformID}
Copy link
Contributor

Choose a reason for hiding this comment

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

could we add both platform ids to the platform ids array? so that if someone scans terraform directly and via gitlab they would come up with the same asset

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we should, lets do this in a followup PR.

Copy link
Contributor

@vjeffrey vjeffrey left a comment

Choose a reason for hiding this comment

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

thank you! this is working well, i can make the platform ids change in a followup since i'm working on the list all groups stuff right now

@chris-rock chris-rock merged commit ce2f1fd into main Sep 29, 2023
@chris-rock chris-rock deleted the chris-rock/terraform-git-platform-id branch September 29, 2023 16:43
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants