Skip to content

Add latest version field to Terraform state GraphQL type

Tiger Watson requested to merge 267147-terraform-state-versions-graphql into master

What does this MR do?

  • Adds a new GraphQL type to represent a Terraform state version, TerraformStateVersion.
  • Exposes latestVersion field on the existing TerraformState type.

GraphQL example

Query

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

    terraformStates {
      nodes {
        name
        
        latestVersion {
          createdAt
        }
      }
    }
  }
}

Response

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/20",
      "terraformStates": {
        "nodes": [
          {
            "name": "vpc-example",
            "latestVersion": {
              "createdAt": "2020-09-15T03:17:07Z"
            }
          }
        ]
      }
    }
  }
}

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 #267147 (closed)

Edited by Tiger Watson

Merge request reports