# Method: projects.locations.spaces.applicationTemplates.generate

- [HTTP request](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#body.aspect_1)
- [IACFormat](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#IACFormat)
- [Try it!](https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#try-it)

Generates Terraform files for an application template. This is a SYNCHRONOUS operation and returns the generated IaC directly in the response. It does NOT download external module sources; it only uses remote sources.

### HTTP request

`POST https://designcenter.googleapis.com/v1/{name=projects/*/locations/*/spaces/*/applicationTemplates/*}:generate`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of the application template. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "iacFormat": enum (`https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#IACFormat`), "gcsUri": string, "artifactLocation": { object (`https://docs.cloud.google.com/application-design-center/docs/reference/rest/Shared.Types/ArtifactLocation`) } } ``` |

| Fields ||
|---|---|
| `iacFormat` | ``enum (`https://docs.cloud.google.com/application-design-center/docs/reference/rest/v1/projects.locations.spaces.applicationTemplates/generate#IACFormat`)`` Optional. The IaC format to generate. |
| `gcsUri (deprecated)` | `string` Optional. The Cloud Storage URI to write the generated IaC to. DEPRECATED: Use the 'artifactLocation' field instead. |
| `artifactLocation` | ``object (`https://docs.cloud.google.com/application-design-center/docs/reference/rest/Shared.Types/ArtifactLocation`)`` Optional. Specifies the destination for the generated IaC, which can be Cloud Storage or a Developer Connect repository. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/application-design-center/docs/reference/rest/Shared.Types/GenerateApplicationTemplateIaCResponse`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `designcenter.applicationTemplates.get`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## IACFormat

The IaC format to generate.

| Enums ||
|---|---|
| `IAC_FORMAT_UNSPECIFIED` | IaC format is unspecified. |
| `TERRAFORM` | IaC format is Terraform. |
| `HELM` | IaC format is HELM. |