|
| 1 | +--- |
| 2 | +layout: "tfe" |
| 3 | +page_title: "Terraform Enterprise: tfe_organization_default_settings |
| 4 | +description: |- |
| 5 | + Sets the workspace defaults for an organization |
| 6 | +--- |
| 7 | +
|
| 8 | +
|
| 9 | +<!-- Please do not edit this file, it is generated. --> |
| 10 | +# tfe_organization_default_settings |
| 11 | +
|
| 12 | +Primarily, this is used to set the default execution mode of an organization. Settings configured here will be used as the default for all workspaces in the organization, unless they specify their own values with a [`tfeWorkspaceSettings` resource](workspace_settings.html) (or deprecated attributes on the workspace resource). |
| 13 | +
|
| 14 | +## Example Usage |
| 15 | +
|
| 16 | +Basic usage: |
| 17 | +
|
| 18 | +```typescript |
| 19 | +// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug |
| 20 | +import { Construct } from "constructs"; |
| 21 | +import { TerraformStack } from "cdktf"; |
| 22 | +/* |
| 23 | + * Provider bindings are generated by running `cdktf get`. |
| 24 | + * See https://cdk.tf/provider-generation for more details. |
| 25 | + */ |
| 26 | +import { AgentPool } from "./.gen/providers/tfe/agent-pool"; |
| 27 | +import { Organization } from "./.gen/providers/tfe/organization"; |
| 28 | +import { OrganizationDefaultSettings } from "./.gen/providers/tfe/organization-default-settings"; |
| 29 | +import { Workspace } from "./.gen/providers/tfe/workspace"; |
| 30 | +class MyConvertedCode extends TerraformStack { |
| 31 | + constructor(scope: Construct, name: string) { |
| 32 | + super(scope, name); |
| 33 | + const test = new Organization(this, "test", { |
| 34 | + |
| 35 | + name: "my-org-name", |
| 36 | + }); |
| 37 | + const myAgents = new AgentPool(this, "my_agents", { |
| 38 | + name: "agent_smiths", |
| 39 | + organization: test.name, |
| 40 | + }); |
| 41 | + const orgDefault = new OrganizationDefaultSettings(this, "org_default", { |
| 42 | + defaultAgentPoolId: myAgents.id, |
| 43 | + defaultExecutionMode: "agent", |
| 44 | + organization: test.name, |
| 45 | + }); |
| 46 | + new Workspace(this, "my_workspace", { |
| 47 | + dependsOn: [orgDefault], |
| 48 | + name: "my-workspace", |
| 49 | + }); |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +``` |
| 54 | +
|
| 55 | +## Argument Reference |
| 56 | +
|
| 57 | +The following arguments are supported: |
| 58 | +
|
| 59 | +* `defaultExecutionMode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) |
| 60 | + to use as the default for all workspaces in the organization. Valid values are `remote`, `local` or`agent`. |
| 61 | +* `defaultAgentPoolId` - (Optional) The ID of an agent pool to assign to the workspace. Requires `default_execution_mode` to be set to `agent`. This value _must not_ be provided if `default_execution_mode` is set to any other value. |
| 62 | +* `organization` - (Optional) Name of the organization. If omitted, organization must be defined in the provider config. |
| 63 | + |
| 64 | + |
| 65 | +## Import |
| 66 | + |
| 67 | +Organization default execution mode can be imported; use `<ORGANIZATION NAME>` as the import ID. For example: |
| 68 | + |
| 69 | +```shell |
| 70 | +terraform import tfe_organization_default_execution_mode.test my-org-name |
| 71 | +``` |
| 72 | + |
| 73 | +<!-- cache-key: cdktf-0.19.0 input-131403d8bfaba1dae78b9751415a0563f3f8e7f7bc52ca8bb1517c4637beb7bb --> |
0 commit comments