Required. The parent in whose context the statefile is listed. The parent value is in the format: 'projects/{projectId}/locations/{location}/deployments/{deployment}'. It takes the form projects/{project}/locations/{location}/deployments/{deployment}.
Request body
The request body contains data with the following structure:
JSON representation
{"draft": boolean}
Fields
draft
boolean
Optional. If this flag is set to true, the exported deployment state file will be the draft state. This will enable the draft file to be validated before copying it over to the working state on unlock.
Response body
If successful, the response body contains an instance of Statefile.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[[["\u003cp\u003eThis endpoint exports the Terraform state file from a specified deployment.\u003c/p\u003e\n"],["\u003cp\u003eThe request is a \u003ccode\u003ePOST\u003c/code\u003e operation to a URL that uses gRPC Transcoding syntax, targeting a specific deployment via the \u003ccode\u003eparent\u003c/code\u003e path parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe request body can optionally include a \u003ccode\u003edraft\u003c/code\u003e flag to export the draft state file.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests return a \u003ccode\u003eStatefile\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003eAccess requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope and the \u003ccode\u003econfig.googleapis.com/config.deployments.getState\u003c/code\u003e IAM permission on the parent resource.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.deployments.exportState\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n- [Try it!](#try-it)\n\nExports Terraform state file from a given deployment.\n\n### HTTP request\n\n`POST https://config.googleapis.com/v1/{parent=projects/*/locations/*/deployments/*}:exportState`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Statefile](/infrastructure-manager/docs/reference/rest/v1/Statefile).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:\n\n- `config.googleapis.com/config.deployments.getState`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]