Skip to content

Draft: Add GraphQL endpoint for viewing Terraform state history

What does this MR do?

GraphQL examples

Query

{
  project(fullPath: "terraform/vpc-example") {
    id

    terraformStates {
      nodes {
        name
        
        versions {
          nodes {
            createdAt
          }
        }
      }
    }
  }
}

Response

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/20",
      "terraformStates": {
        "nodes": [
          {
            "name": "vpc-example",
            "versions": {
              "nodes": [
                {
                  "createdAt": "2020-10-16T00:44:45Z"
                },
                {
                  "createdAt": "2020-10-16T00:33:59Z"
                },
                {
                  "createdAt": "2020-10-16T00:19:34Z"
                }
              ]
            }
          }
        ]
      }
    }
  }
}

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

Related to #262916

Edited by Tiger Watson

Merge request reports