Skip to content

Add GraphQL endpoint for Terraform state metadata

Tiger Watson requested to merge 216571-terraform-states-graphql-endpoint into master

What does this MR do?

Adds a GraphQL type & resolver to retrieve a list of Terraform states for a project.

The actual content of the file is not yet included, as it probably makes more sense to request this on an individual basis.

Examples

{
  project(fullPath: "my/project/path") {
    id
    
    terraformStates {
      nodes {
        id
        name
        lockedAt
        createdAt
        updatedAt
        
        lockedByUser {
          id
        }
      }
    }
  }
}
{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/20",
      "terraformStates": {
        "nodes": [
          {
            "id": "gid://gitlab/Terraform::State/3",
            "name": "vpc-example",
            "lockedAt": null,
            "createdAt": "2020-09-15T03:13:11Z",
            "updatedAt": "2020-09-15T03:17:07Z",
            "lockedByUser": null
        }
    }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

#216571 (closed)

Edited by Tiger Watson

Merge request reports