func SetWorkspaceFlags()

in cobra/aid/workspace.go [12:77]


func SetWorkspaceFlags(cmd *cobra.Command) {

	// List
	usage := `A search string (partial workspace name) used to filter the results.`
	cmd.Flags().String("search", "", usage)

	usage = `A list of relations to include. See available resources https://www.terraform.io/docs/cloud/api/workspaces.html#available-related-resources`
	cmd.Flags().String("include", "", usage)

	// Create, Update

	usage = `The workspace ID`
	cmd.Flags().String("id", "", usage)

	usage = `Required when execution-mode is set to agent. The ID of the agent pool belonging to the workspace's organization. This value must not be specified if execution-mode is set to remote or local or if operations is set to true.`
	cmd.Flags().String("agent-pool-id", "", usage)

	usage = `Whether destroy plans can be queued on the workspace.`
	cmd.Flags().Bool("allow-destroy-plan", false, usage)

	usage = `Whether to automatically apply changes when a Terraform plan is successful.`
	cmd.Flags().Bool("auto-apply", false, usage)

	usage = `Which execution mode to use. Valid values are remote, local, and agent. When set to local, the workspace will be used for state storage only. This value must not be specified if operations is specified. 'agent' execution mode is not available in Terraform Enterprise.`
	cmd.Flags().String("execution-mode", "", usage)

	usage = `Whether to filter runs based on the changed files in a VCS push. If enabled, the working directory and trigger prefixes describe a set of paths which must contain changes for a VCS push to trigger a run. If disabled, any push will trigger a run.`
	cmd.Flags().Bool("file-triggers-enabled", false, usage)

	usage = `The legacy TFE environment to use as the source of the migration, in the form organization/environment. Omit this unless you are migrating a legacy environment.`
	cmd.Flags().String("migration-environment", "", usage)

	usage = `The name of the workspace, which can only include letters, numbers, -, and _. This will be used as an identifier and must be unique in the organization.`
	cmd.Flags().String("name", "", usage)

	usage = `A new name for the workspace, which can only include letters, numbers, -, and _. This will be used as an identifier and must be unique in the organization. Warning: Changing a workspace's name changes its URL in the API and UI.`
	cmd.Flags().String("new-name", "", usage)

	usage = `Whether to queue all runs. Unless this is set to true, runs triggered by
	a webhook will not be queued until at least one run is manually queued.`
	cmd.Flags().Bool("queue-all-runs", false, usage)

	usage = `Whether this workspace allows speculative plans. Setting this to false prevents Terraform Cloud or the Terraform Enterprise instance from running plans on pull requests, which can improve security if the VCS repository is public or includes untrusted contributors.`
	cmd.Flags().Bool("speculative-enabled", false, usage)

	usage = `The version of Terraform to use for this workspace. Upon creating a workspace, the latest version is selected unless otherwise specified.`
	cmd.Flags().String("terraform-version", "", usage)

	usage = `List of repository-root-relative paths which list all locations to be tracked for changes. See FileTriggersEnabled above for more details.`
	var emptyArray []string
	cmd.Flags().StringArray("trigger-prefixes", emptyArray, usage)

	// Create/Update/RemoveVCSConnectionOptions
	SetVCSRepoFlags(cmd)

	usage = `A relative path that Terraform will execute within. This defaults to the root of your repository and is typically set to a subdirectory matching the environment when multiple environments exist within the same repository.`
	cmd.Flags().String("working-directory", "", usage)

	// Lock
	usage = `Specifies the reason for locking the workspace.`
	cmd.Flags().String("reason", "", usage)

	// AssignSSHKey / UnassignSSHKey
	usage = `The SSH key ID to assign to a workspace. Must be created on the organization.`
	cmd.Flags().String("ssh-key-id", "", usage)
}